-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,50 @@ | ||
package v1alpha1 | ||
|
||
import( | ||
"github.com/knative/pkg/apis" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// Add validation for TaskConditions? | ||
type TaskCondition struct { | ||
Name string `json:"name"` | ||
// TODO: ref should probably be its own type with kind + version | ||
ConditionRef string `json:"conditionRef"` | ||
// +optional | ||
Params []Param `json:"params,omitempty"` | ||
} | ||
|
||
// Check that Task may be validated and defaulted. | ||
var _ apis.Validatable = (*Task)(nil) | ||
var _ apis.Defaultable = (*Task)(nil) | ||
|
||
|
||
// Task represents a collection of sequential steps that are run as part of a | ||
// Pipeline using a set of inputs and producing a set of outputs. Tasks execute | ||
// when TaskRuns are created that provide the input parameters and resources and | ||
// output resources the Task requires. | ||
// | ||
// +k8s:openapi-gen=true | ||
type Condition struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
// Spec holds the desired state of the Condition from the client | ||
// +optional | ||
Spec ConditionSpec `json:"spec"` | ||
// +optional | ||
Status TaskRunStatus `json:"status,omitempty"` | ||
} | ||
|
||
type ConditionSpec struct { | ||
// +optional | ||
Params []Param `json:"params,omitempty"` | ||
// Check is a container whose exit code determines where a condition is true or false | ||
Check *corev1.Container `json:"check,omitempty"` | ||
} | ||
|
||
type ConditionState struct { | ||
corev1.ContainerState | ||
Name string `json:"name,omitempty"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters