diff --git a/api/v1alpha2/template.go b/api/v1alpha2/template.go index 33a64ebe3..3dc2ea7d7 100644 --- a/api/v1alpha2/template.go +++ b/api/v1alpha2/template.go @@ -49,11 +49,9 @@ type Action struct { // +optional Volumes []Volume `json:"volumes,omitempty"` - // NetworkNamespace defines the network namespace to run the container in. This enables access - // to the host network namespace. - // See https://man7.org/linux/man-pages/man7/namespaces.7.html. + // Namespaces defines the Linux namespaces this container should execute in. // +optional - NetworkNamespace *string `json:"networkNamespace,omitempty"` + Namespaces *Namespaces `json:"namespaces,omitempty"` } // Volume is a specification for mounting a volume in an action. Volumes take the form @@ -71,6 +69,18 @@ type Action struct { // See https://docs.docker.com/storage/volumes/ for additional details. type Volume string +// Namespace defines the Linux namespaces to use for the container. +// See https://man7.org/linux/man-pages/man7/namespaces.7.html. +type Namespaces struct { + // Network defines the network namespace. + // +optional + Network *string + + // PID defines the PID namespace + // +optional + PID *int +} + // +kubebuilder:object:root=true // +kubebuilder:resource:categories=tinkerbell,shortName=tpl // +kubebuilder:unservedversion