Skip to content

Commit

Permalink
Refactor v1alpha2 Linux namespace definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Doherty <[email protected]>
  • Loading branch information
chrisdoherty4 committed Oct 24, 2023
1 parent 75b4200 commit fb62c3d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions api/v1alpha2/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fb62c3d

Please sign in to comment.