Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LabelInstanceID is used to group all pods created by a single ruleset. LabelInstanceID = "compliance.gardener.cloud/instanceID" // LabelComplianceRoleKey is used to label pods related to compliance operations in the cluster. LabelComplianceRoleKey = "compliance.gardener.cloud/role" // LabelComplianceRolePrivPod is used as the label value for LabelComplianceRoleKey indicating privileged diki pods. LabelComplianceRolePrivPod = "diki-privileged-pod" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PodContext ¶
type PodContext interface { Create(ctx context.Context, podConstructorFn func() *corev1.Pod) (PodExecutor, error) Delete(ctx context.Context, name, namespace string) error }
PodContext creates and deletes Pods.
type PodExecutor ¶
type PodExecutor interface {
Execute(ctx context.Context, command string, commandArg string) (string, error)
}
PodExecutor executes commands inside a pod.
type SimplePodContext ¶
type SimplePodContext struct { // IntervalWait is the time between wait API calls. IntervalWait time.Duration // TimeoutWait is the time waited for a pod to reach Running state or be deleted. TimeoutWait time.Duration // contains filtered or unexported fields }
SimplePodContext can create and delete pods.
func NewSimplePodContext ¶
NewSimplePodContext creates a new SimplePodContext.
func (*SimplePodContext) Create ¶
func (spc *SimplePodContext) Create(ctx context.Context, podConstructorFn func() *corev1.Pod) (PodExecutor, error)
Create creates a Pod and waits for it to get in Running state.
type SimplePodExecutor ¶
type SimplePodExecutor struct {
// contains filtered or unexported fields
}
SimplePodExecutor can execute commands in a pod.
func NewPodExecutor ¶
func NewPodExecutor(client client.Client, config *rest.Config, name, namespace string) (*SimplePodExecutor, error)
NewPodExecutor creates a new SimplePodExecutor.
Click to show internal directories.
Click to hide internal directories.