2020-03-18 17:24:33 +08:00
|
|
|
/*
|
|
|
|
|
* v1_topology_spread_constraint.h
|
|
|
|
|
*
|
|
|
|
|
* TopologySpreadConstraint specifies how to spread matching pods among the given topology.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _v1_topology_spread_constraint_H_
|
|
|
|
|
#define _v1_topology_spread_constraint_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_topology_spread_constraint_t v1_topology_spread_constraint_t;
|
|
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_label_selector.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct v1_topology_spread_constraint_t {
|
|
|
|
|
struct v1_label_selector_t *label_selector; //model
|
2022-09-26 01:26:15 +00:00
|
|
|
list_t *match_label_keys; //primitive container
|
2020-03-18 17:24:33 +08:00
|
|
|
int max_skew; //numeric
|
2022-06-05 18:16:17 +00:00
|
|
|
int min_domains; //numeric
|
2022-09-26 01:26:15 +00:00
|
|
|
char *node_affinity_policy; // string
|
|
|
|
|
char *node_taints_policy; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
char *topology_key; // string
|
2022-06-05 18:16:17 +00:00
|
|
|
char *when_unsatisfiable; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
} v1_topology_spread_constraint_t;
|
|
|
|
|
|
|
|
|
|
v1_topology_spread_constraint_t *v1_topology_spread_constraint_create(
|
|
|
|
|
v1_label_selector_t *label_selector,
|
2022-09-26 01:26:15 +00:00
|
|
|
list_t *match_label_keys,
|
2020-03-18 17:24:33 +08:00
|
|
|
int max_skew,
|
2022-06-05 18:16:17 +00:00
|
|
|
int min_domains,
|
2022-09-26 01:26:15 +00:00
|
|
|
char *node_affinity_policy,
|
|
|
|
|
char *node_taints_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
char *topology_key,
|
2022-06-05 18:16:17 +00:00
|
|
|
char *when_unsatisfiable
|
2020-03-18 17:24:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
void v1_topology_spread_constraint_free(v1_topology_spread_constraint_t *v1_topology_spread_constraint);
|
|
|
|
|
|
|
|
|
|
v1_topology_spread_constraint_t *v1_topology_spread_constraint_parseFromJSON(cJSON *v1_topology_spread_constraintJSON);
|
|
|
|
|
|
|
|
|
|
cJSON *v1_topology_spread_constraint_convertToJSON(v1_topology_spread_constraint_t *v1_topology_spread_constraint);
|
|
|
|
|
|
|
|
|
|
#endif /* _v1_topology_spread_constraint_H_ */
|
|
|
|
|
|