github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/domain/entities/play.go (about)

     1  package entities
     2  
     3  import (
     4  	"net"
     5  
     6  	"github.com/containers/image/v5/types"
     7  )
     8  
     9  // PlayKubeOptions controls playing kube YAML files.
    10  type PlayKubeOptions struct {
    11  	// Annotations - Annotations to add to Pods
    12  	Annotations map[string]string
    13  	// Authfile - path to an authentication file.
    14  	Authfile string
    15  	// Indicator to build all images with Containerfile or Dockerfile
    16  	Build types.OptionalBool
    17  	// CertDir - to a directory containing TLS certifications and keys.
    18  	CertDir string
    19  	// ContextDir - directory containing image contexts used for Build
    20  	ContextDir string
    21  	// Down indicates whether to bring contents of a yaml file "down"
    22  	// as in stop
    23  	Down bool
    24  	// Replace indicates whether to delete and recreate a yaml file
    25  	Replace bool
    26  	// Do not create /etc/hosts within the pod's containers,
    27  	// instead use the version from the image
    28  	NoHosts bool
    29  	// Username for authenticating against the registry.
    30  	Username string
    31  	// Password for authenticating against the registry.
    32  	Password string
    33  	// Networks - name of the network to connect to.
    34  	Networks []string
    35  	// Quiet - suppress output when pulling images.
    36  	Quiet bool
    37  	// SignaturePolicy - path to a signature-policy file.
    38  	SignaturePolicy string
    39  	// SkipTLSVerify - skip https and certificate validation when
    40  	// contacting container registries.
    41  	SkipTLSVerify types.OptionalBool
    42  	// SeccompProfileRoot - path to a directory containing seccomp
    43  	// profiles.
    44  	SeccompProfileRoot string
    45  	// StaticIPs - Static IP address used by the pod(s).
    46  	StaticIPs []net.IP
    47  	// StaticMACs - Static MAC address used by the pod(s).
    48  	StaticMACs []net.HardwareAddr
    49  	// ConfigMaps - slice of pathnames to kubernetes configmap YAMLs.
    50  	ConfigMaps []string
    51  	// LogDriver for the container. For example: journald
    52  	LogDriver string
    53  	// LogOptions for the log driver for the container.
    54  	LogOptions []string
    55  	// Start - don't start the pod if false
    56  	Start types.OptionalBool
    57  	// ServiceContainer - creates a service container that is started before and is stopped after all pods.
    58  	ServiceContainer bool
    59  	// Userns - define the user namespace to use.
    60  	Userns string
    61  }
    62  
    63  // PlayKubePod represents a single pod and associated containers created by play kube
    64  type PlayKubePod struct {
    65  	// ID - ID of the pod created as a result of play kube.
    66  	ID string
    67  	// Containers - the IDs of the containers running in the created pod.
    68  	Containers []string
    69  	// InitContainers - the IDs of the init containers to be run in the created pod.
    70  	InitContainers []string
    71  	// Logs - non-fatal errors and log messages while processing.
    72  	Logs []string
    73  	// ContainerErrors - any errors that occurred while starting containers
    74  	// in the pod.
    75  	ContainerErrors []string
    76  }
    77  
    78  // PlayKubeVolume represents a single volume created by play kube.
    79  type PlayKubeVolume struct {
    80  	// Name - Name of the volume created by play kube.
    81  	Name string
    82  }
    83  
    84  // PlayKubeReport contains the results of running play kube.
    85  type PlayKubeReport struct {
    86  	// Pods - pods created by play kube.
    87  	Pods []PlayKubePod
    88  	// Volumes - volumes created by play kube.
    89  	Volumes []PlayKubeVolume
    90  	PlayKubeTeardown
    91  }
    92  
    93  // PlayKubeDownOptions are options for tearing down pods
    94  type PlayKubeDownOptions struct{}
    95  
    96  // PlayKubeDownReport contains the results of tearing down play kube
    97  type PlayKubeTeardown struct {
    98  	StopReport []*PodStopReport
    99  	RmReport   []*PodRmReport
   100  }