Skip to content
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Unit Tests

on:
push:
Expand All @@ -8,6 +8,9 @@ jobs:
test:
name: Run on Ubuntu
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Clone the code
uses: actions/checkout@v4
Expand Down
25 changes: 23 additions & 2 deletions api/v1/operation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,50 @@ limitations under the License.
package v1

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

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

type ApplicationSpec struct {
Name string `json:"name"`
Provision batchv1.JobSpec `json:"provision"`
Teardown batchv1.JobSpec `json:"teardown"`
// +kubebuilder:validation:Optional
Dependencies []string `json:"dependencies,omitempty"`
}

// OperationSpec defines the desired state of Operation.
type OperationSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of Operation. Edit operation_types.go to remove/update
Foo string `json:"foo,omitempty"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinItems=1
Applications []ApplicationSpec `json:"applications"`
// +kubebuilder:validation:optional
// +kubebuilder:validation:Pattern:=`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$`
ExpireAt string `json:"expireAt,omitempty"`
}

// OperationStatus defines the observed state of Operation.
type OperationStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Conditions is a list of conditions to describe the status of the deploy
Conditions []metav1.Condition `json:"conditions"`
Phase string `json:"phase"`
CacheKey string `json:"cacheKey"`
OperationID string `json:"operationId"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Key",type="string",JSONPath=`.status.cacheKey`

// Operation is the Schema for the operations API.
type Operation struct {
Expand Down
40 changes: 38 additions & 2 deletions api/v1/zz_generated.deepcopy.go

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

Loading