Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions api/v1/jobrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ type JobRequestPodSpecFrom struct {
// +kubebuilder:validation:Enum=apps/v1;
Group string `json:"group"`
// +kubebuilder:validation:Enum=Deployment;
Kind string `json:"kind"`
Kind string `json:"kind"`
// Selector for the resource which contains the pod spec to use for the job.
LabelSelector metav1.LabelSelector `json:"labelSelector"`
}

Expand All @@ -46,6 +47,7 @@ type JobRequestSpec struct {
}

// JobRequestStatus defines the observed state of JobRequest.

type JobRequestStatus struct {
// Name of the Kubernetes Job created for this job request.
JobName string `json:"jobName,omitempty"`
Expand All @@ -60,9 +62,14 @@ type JobRequestStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=jr
// +kubebuilder:printcolumn:name="Command",type=string,JSONPath=`.spec.command`
// +kubebuilder:printcolumn:name="Arguments",type=string,JSONPath=`.spec.args`
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
// +kubebuilder:printcolumn:name="Job Name",type=string,JSONPath=`.status.jobName`
// +kubebuilder:printcolumn:name="Requested By",type=string,JSONPath=`.status.requestedBy`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// JobRequest is the Schema for the jobrequests API
// JobRequest represents a request to run a command in the cluster.
type JobRequest struct {
metav1.TypeMeta `json:",inline"`

Expand Down
4 changes: 4 additions & 0 deletions api/v1/jobrequestreview_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ type JobRequestReviewStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=jrr
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Job Request",type=string,JSONPath=`.spec.jobRequestName`
// +kubebuilder:printcolumn:name="Decision",type=string,JSONPath=`.spec.decision`
// +kubebuilder:printcolumn:name="Reviewed By",type=string,JSONPath=`.status.reviewedBy`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// JobRequestReview is the Schema for the jobrequestreviews API
type JobRequestReview struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ spec:
singular: jobrequestreview
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- jsonPath: .spec.jobRequestName
name: Job Request
type: string
- jsonPath: .spec.decision
name: Decision
type: string
- jsonPath: .status.reviewedBy
name: Reviewed By
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: JobRequestReview is the Schema for the jobrequestreviews API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,28 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.command
name: Command
type: string
- jsonPath: .spec.args
name: Arguments
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .status.jobName
name: Job Name
type: string
- jsonPath: .status.requestedBy
name: Requested By
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: JobRequest is the Schema for the jobrequests API
description: JobRequest represents a request to run a command in the cluster.
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -72,10 +87,8 @@ spec:
- Deployment
type: string
labelSelector:
description: |-
A label selector is a label query over a set of resources. The result of matchLabels and
matchExpressions are ANDed. An empty label selector matches all objects. A null
label selector matches no objects.
description: Selector for the resource which contains the
pod spec to use for the job.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
Expand Down