Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define new types, controller ans type spec #404

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ resources:
- group: orkestra
kind: ApplicationGroup
version: v1alpha1
- group: orkestra
kind: Pipeline
version: v1alpha1
- group: orkestra
kind: ApplicationGroupTemplate
version: v1alpha1
version: "2"
40 changes: 40 additions & 0 deletions api/v1alpha1/applicationgrouptemplate_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

package v1alpha1

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

// ApplicationGroupTemplateSpec defines the desired state of ApplicationGroupTemplate
type ApplicationGroupTemplateSpec struct {
// ApplicationGroupTemplateSpec defines the desired state of ApplicationGroupTemplate
// +required
Template ApplicationGroupSpec `json:"template,omitempty"`
}

//+kubebuilder:object:root=true

// ApplicationGroupTemplate is the Schema for the applicationgrouptemplates API
type ApplicationGroupTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ApplicationGroupTemplateSpec `json:"spec,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=applicationgrouptemplates,scope=Cluster,shortName={"agt","appgrouptpl"}
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

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

func init() {
SchemeBuilder.Register(&ApplicationGroupTemplate{}, &ApplicationGroupTemplateList{})
}
65 changes: 65 additions & 0 deletions api/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

package v1alpha1

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

// PipelineSpec defines the desired state of Pipeline
type PipelineSpec struct {
// Preflight is a list of preflight checks to run before the pipeline runs.
// +optional
PreFlight []PipelineTask `json:"preFlight,omitempty"`

// ApplicationGroup is the name of the application group to run the pipeline in.
// +required
ApplicationGroup corev1.ObjectReference `json:"applicationGroup,omitempty"`

// Postflight is a list of postflight checks to run after the pipeline runs.
// +optional
PostFlight []PipelineTask `json:"postFlight,omitempty"`
}

type PipelineTask struct {
// DAG contains the dependency information
// +required
DAG `json:",inline"`

// Container is the container to run the task in.
// +required
Container corev1.Container `json:"container,omitempty"`
}

// PipelineStatus defines the observed state of Pipeline
type PipelineStatus struct {
}

//+kubebuilder:object:root=true
// +kubebuilder:resource:path=pipelines,scope=Cluster
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// Pipeline is the Schema for the pipelines API
type Pipeline struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec PipelineSpec `json:"spec,omitempty"`
Status PipelineStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

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

func init() {
SchemeBuilder.Register(&Pipeline{}, &PipelineList{})
}
195 changes: 195 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