Skip to content

Commit

Permalink
Fix infrastructure stack CRD a bit (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored May 26, 2024
1 parent 29e5e37 commit 3dc772b
Show file tree
Hide file tree
Showing 15 changed files with 305 additions and 23,921 deletions.
7,940 changes: 49 additions & 7,891 deletions charts/controller/crds/deployments.plural.sh_infrastructurestacks.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
gate types.
properties:
job:
description: GateJob is a spec for a job gate.
description: JobSpec is a spec for a job gate.
properties:
annotations:
additionalProperties:
Expand Down
12 changes: 9 additions & 3 deletions controller/api/v1alpha1/infrastructurestack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package v1alpha1

import (
console "github.com/pluralsh/console-client-go"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -38,15 +37,22 @@ type InfrastructureStackSpec struct {
RepositoryRef corev1.ObjectReference `json:"repositoryRef"`

// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Cluster is immutable"
ClusterRef corev1.ObjectReference `json:"clusterRef"`

// Git reference w/in the repository where the IaC lives
Git GitRef `json:"git"`

// Whether you want Plural to manage the state of this stack
// +kubebuilder:validation:Optional
ManageState *bool `json:"manageState,omitempty"`

// The working directory within the git spec you want to run commands in (useful for projects with external modules)
// +kubebuilder:validation:Optional
Workdir *string `json:"workdir,omitempty"`

// JobSpec optional k8s job configuration for the job that will apply this stack
// +kubebuilder:validation:Optional
JobSpec *batchv1.JobSpec `json:"jobSpec,omitempty"`
JobSpec *JobSpec `json:"jobSpec,omitempty"`

// Configuration version/image config for the tool you're using
Configuration StackConfiguration `json:"configuration"`
Expand Down
6 changes: 3 additions & 3 deletions controller/api/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ type PipelineGate struct {
// GateSpec is a more refined spec for parameters needed for complex gates.
type GateSpec struct {
// +kubebuilder:validation:Optional
Job *GateJob `json:"job,omitempty"`
Job *JobSpec `json:"job,omitempty"`
}

// GateJob is a spec for a job gate.
type GateJob struct {
// JobSpec is a spec for a job gate.
type JobSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:Type:=string
Namespace string `json:"namespace"`
Expand Down
115 changes: 62 additions & 53 deletions controller/api/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 3dc772b

Please sign in to comment.