2020-03-18 17:24:33 +08:00
|
|
|
/*
|
|
|
|
|
* v1_pod_affinity_term.h
|
|
|
|
|
*
|
|
|
|
|
* 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 <topologyKey> matches that of any node on which a pod of the set of pods is running
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _v1_pod_affinity_term_H_
|
|
|
|
|
#define _v1_pod_affinity_term_H_
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "../external/cJSON.h"
|
|
|
|
|
#include "../include/list.h"
|
|
|
|
|
#include "../include/keyValuePair.h"
|
2020-06-20 09:41:15 +08:00
|
|
|
#include "../include/binary.h"
|
|
|
|
|
|
|
|
|
|
typedef struct v1_pod_affinity_term_t v1_pod_affinity_term_t;
|
|
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_label_selector.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct v1_pod_affinity_term_t {
|
|
|
|
|
struct v1_label_selector_t *label_selector; //model
|
2024-01-23 12:51:46 +00:00
|
|
|
list_t *match_label_keys; //primitive container
|
|
|
|
|
list_t *mismatch_label_keys; //primitive container
|
2021-09-14 21:52:06 +08:00
|
|
|
struct v1_label_selector_t *namespace_selector; //model
|
2020-03-18 17:24:33 +08:00
|
|
|
list_t *namespaces; //primitive container
|
|
|
|
|
char *topology_key; // string
|
|
|
|
|
|
|
|
|
|
} v1_pod_affinity_term_t;
|
|
|
|
|
|
|
|
|
|
v1_pod_affinity_term_t *v1_pod_affinity_term_create(
|
|
|
|
|
v1_label_selector_t *label_selector,
|
2024-01-23 12:51:46 +00:00
|
|
|
list_t *match_label_keys,
|
|
|
|
|
list_t *mismatch_label_keys,
|
2021-09-14 21:52:06 +08:00
|
|
|
v1_label_selector_t *namespace_selector,
|
2020-03-18 17:24:33 +08:00
|
|
|
list_t *namespaces,
|
|
|
|
|
char *topology_key
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
void v1_pod_affinity_term_free(v1_pod_affinity_term_t *v1_pod_affinity_term);
|
|
|
|
|
|
|
|
|
|
v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinity_termJSON);
|
|
|
|
|
|
|
|
|
|
cJSON *v1_pod_affinity_term_convertToJSON(v1_pod_affinity_term_t *v1_pod_affinity_term);
|
|
|
|
|
|
|
|
|
|
#endif /* _v1_pod_affinity_term_H_ */
|
|
|
|
|
|