root/lib/pengine/variant.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2022 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PE_VARIANT__H
  11 #  define PE_VARIANT__H
  12 
  13 #  if PE__VARIANT_BUNDLE
  14 
  15 typedef struct {
  16     int offset;
  17     char *ipaddr;
  18     pe_node_t *node;
  19     pe_resource_t *ip;
  20     pe_resource_t *child;
  21     pe_resource_t *container;
  22     pe_resource_t *remote;
  23 } pe__bundle_replica_t;
  24 
  25 enum pe__bundle_mount_flags {
  26     pe__bundle_mount_none       = 0x00,
  27 
  28     // mount instance-specific subdirectory rather than source directly
  29     pe__bundle_mount_subdir     = 0x01
  30 };
  31 
  32 typedef struct {
  33     char *source;
  34     char *target;
  35     char *options;
  36     uint32_t flags; // bitmask of pe__bundle_mount_flags
  37 } pe__bundle_mount_t;
  38 
  39 typedef struct {
  40     char *source;
  41     char *target;
  42 } pe__bundle_port_t;
  43 
  44 enum pe__container_agent {
  45     PE__CONTAINER_AGENT_UNKNOWN,
  46     PE__CONTAINER_AGENT_DOCKER,
  47     PE__CONTAINER_AGENT_RKT,
  48     PE__CONTAINER_AGENT_PODMAN,
  49 };
  50 
  51 #define PE__CONTAINER_AGENT_UNKNOWN_S "unknown"
  52 #define PE__CONTAINER_AGENT_DOCKER_S  "docker"
  53 #define PE__CONTAINER_AGENT_RKT_S     "rkt"
  54 #define PE__CONTAINER_AGENT_PODMAN_S  "podman"
  55 
  56 typedef struct pe__bundle_variant_data_s {
  57         int promoted_max;
  58         int nreplicas;
  59         int nreplicas_per_host;
  60         char *prefix;
  61         char *image;
  62         const char *ip_last;
  63         char *host_network;
  64         char *host_netmask;
  65         char *control_port;
  66         char *container_network;
  67         char *ip_range_start;
  68         gboolean add_host;
  69         gchar *container_host_options;
  70         char *container_command;
  71         char *launcher_options;
  72         const char *attribute_target;
  73 
  74         pe_resource_t *child;
  75 
  76         GList *replicas;    // pe__bundle_replica_t *
  77         GList *ports;       // pe__bundle_port_t *
  78         GList *mounts;      // pe__bundle_mount_t *
  79 
  80         enum pe__container_agent agent_type;
  81 } pe__bundle_variant_data_t;
  82 
  83 #    define get_bundle_variant_data(data, rsc)                       \
  84         CRM_ASSERT(rsc != NULL);                                        \
  85         CRM_ASSERT(rsc->variant == pe_container);                       \
  86         CRM_ASSERT(rsc->variant_opaque != NULL);                        \
  87         data = (pe__bundle_variant_data_t *)rsc->variant_opaque;                \
  88 
  89 #  endif
  90 
  91 #endif

/* [previous][next][first][last][top][bottom][index][help] */