/* tslint:disable */ /* eslint-disable */ /** * KubeVirt API * This is KubeVirt API an add-on for Kubernetes. * * The version of the OpenAPI document: 1.0.0 * Contact: kubevirt-dev@googlegroups.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists } from '../runtime'; import { K8sIoApimachineryPkgApisMetaV1LabelSelector, K8sIoApimachineryPkgApisMetaV1LabelSelectorFromJSON, K8sIoApimachineryPkgApisMetaV1LabelSelectorToJSON, } from './'; /** * 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 * @export * @interface K8sIoApiCoreV1PodAffinityTerm */ export interface K8sIoApiCoreV1PodAffinityTerm { /** * * @type {K8sIoApimachineryPkgApisMetaV1LabelSelector} * @memberof K8sIoApiCoreV1PodAffinityTerm */ labelSelector?: K8sIoApimachineryPkgApisMetaV1LabelSelector; /** * MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). * @type {Array} * @memberof K8sIoApiCoreV1PodAffinityTerm */ matchLabelKeys?: Array; /** * MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). * @type {Array} * @memberof K8sIoApiCoreV1PodAffinityTerm */ mismatchLabelKeys?: Array; /** * * @type {K8sIoApimachineryPkgApisMetaV1LabelSelector} * @memberof K8sIoApiCoreV1PodAffinityTerm */ namespaceSelector?: K8sIoApimachineryPkgApisMetaV1LabelSelector; /** * 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} * @memberof K8sIoApiCoreV1PodAffinityTerm */ namespaces?: Array; /** * 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} * @memberof K8sIoApiCoreV1PodAffinityTerm */ topologyKey: string; } export function K8sIoApiCoreV1PodAffinityTermFromJSON(json: any): K8sIoApiCoreV1PodAffinityTerm { return K8sIoApiCoreV1PodAffinityTermFromJSONTyped(json, false); } export function K8sIoApiCoreV1PodAffinityTermFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): K8sIoApiCoreV1PodAffinityTerm { if (json === undefined || json === null) { return json; } return { labelSelector: !exists(json, 'labelSelector') ? undefined : K8sIoApimachineryPkgApisMetaV1LabelSelectorFromJSON(json['labelSelector']), matchLabelKeys: !exists(json, 'matchLabelKeys') ? undefined : json['matchLabelKeys'], mismatchLabelKeys: !exists(json, 'mismatchLabelKeys') ? undefined : json['mismatchLabelKeys'], namespaceSelector: !exists(json, 'namespaceSelector') ? undefined : K8sIoApimachineryPkgApisMetaV1LabelSelectorFromJSON(json['namespaceSelector']), namespaces: !exists(json, 'namespaces') ? undefined : json['namespaces'], topologyKey: json['topologyKey'], }; } export function K8sIoApiCoreV1PodAffinityTermToJSON( value?: K8sIoApiCoreV1PodAffinityTerm | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { labelSelector: K8sIoApimachineryPkgApisMetaV1LabelSelectorToJSON(value.labelSelector), matchLabelKeys: value.matchLabelKeys, mismatchLabelKeys: value.mismatchLabelKeys, namespaceSelector: K8sIoApimachineryPkgApisMetaV1LabelSelectorToJSON(value.namespaceSelector), namespaces: value.namespaces, topologyKey: value.topologyKey, }; }