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
54 changes: 54 additions & 0 deletions api/v1alpha1/sentinelrunjob_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package v1alpha1

import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Namespaced
//+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id",description="ID of the SentinelRunJob in the Console API."
//+kubebuilder:printcolumn:name="JobStatus",type="string",JSONPath=".status.jobStatus",description="Status of the Job created by this SentinelRunJob."

// SentinelRunJob is the Schema for the sentinel run job
type SentinelRunJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec SentinelRunJobSpec `json:"spec,omitempty"`
Status SentinelRunJobStatus `json:"status,omitempty"`
}

type SentinelRunJobSpec struct {
// RunID from Console API
RunID string `json:"runId"`
}

type SentinelRunJobStatus struct {
Status `json:",inline"`

// JobRef Reference to the created Job
JobRef *v1.LocalObjectReference `json:"jobRef,omitempty"`

// JobStatus is the status of the Job.
JobStatus string `json:"jobStatus,omitempty"`
}

//+kubebuilder:object:root=true

// SentinelRunJobList contains a list of SentinelRunJob
type SentinelRunJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SentinelRunJob `json:"items"`
}

func (s *SentinelRunJob) SetCondition(condition metav1.Condition) {
meta.SetStatusCondition(&s.Status.Conditions, condition)
}

func init() {
SchemeBuilder.Register(&SentinelRunJob{}, &SentinelRunJobList{})
}
54 changes: 54 additions & 0 deletions api/v1alpha1/stackrunjob_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package v1alpha1

import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Namespaced
//+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id",description="ID of the StackRun in the Console API."
//+kubebuilder:printcolumn:name="JobStatus",type="string",JSONPath=".status.jobStatus",description="Status of the Job created by this StackRunJob."

// StackRunJob is the Schema for the stack run job
type StackRunJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec StackRunJobSpec `json:"spec,omitempty"`
Status StackRunJobStatus `json:"status,omitempty"`
}

type StackRunJobSpec struct {
// RunID from Console API
RunID string `json:"runId"`
}

type StackRunJobStatus struct {
Status `json:",inline"`

// JobRef Reference to the created Job
JobRef *v1.LocalObjectReference `json:"jobRef,omitempty"`

// JobStatus is the status of the Job.
JobStatus string `json:"jobStatus,omitempty"`
}

//+kubebuilder:object:root=true

// SentinelRunJobList contains a list of SentinelRunJob
type StackRunJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StackRunJob `json:"items"`
}

func (s *StackRunJob) SetCondition(condition metav1.Condition) {
meta.SetStatusCondition(&s.Status.Conditions, condition)
}

func init() {
SchemeBuilder.Register(&StackRunJob{}, &StackRunJobList{})
}
190 changes: 190 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading