Files
c/kubernetes/model/v1_pod_affinity_term.h

49 lines
1.6 KiB
C
Raw Normal View History

/*
* 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"
#include "../include/binary.h"
typedef struct v1_pod_affinity_term_t v1_pod_affinity_term_t;
#include "v1_label_selector.h"
typedef struct v1_pod_affinity_term_t {
struct v1_label_selector_t *label_selector; //model
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
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,
list_t *match_label_keys,
list_t *mismatch_label_keys,
2021-09-14 21:52:06 +08:00
v1_label_selector_t *namespace_selector,
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_ */