Skip to content

Commit

Permalink
fix: remove useless settings nesting in stack (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliecharra authored Jun 17, 2024
1 parent 90c3e28 commit ac934fb
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 339 deletions.
80 changes: 37 additions & 43 deletions api/v1beta1/stack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,47 @@ import (
)

// StackSpec defines the desired state of Stack
// +kubebuilder:validation:XValidation:rule="has(self.spaceName) != has(self.spaceId)",message="only one of spaceName or spaceId can be set"
type StackSpec struct {
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
Settings StackInput `json:"settings"`
// +kubebuilder:validation:MinLength=1
CommitSHA *string `json:"commitSHA,omitempty"`
}

// +kubebuilder:validation:XValidation:rule="has(self.spaceName) != has(self.spaceId)",message="only one of spaceName or spaceId can be set"
type StackInput struct {
SpaceName *string `json:"spaceName,omitempty"`
SpaceId *string `json:"spaceId,omitempty"`

AdditionalProjectGlobs *[]string `json:"additionalProjectGlobs,omitempty"`
Administrative *bool `json:"administrative,omitempty"`
AfterApply *[]string `json:"afterApply,omitempty"`
AfterDestroy *[]string `json:"afterDestroy,omitempty"`
AfterInit *[]string `json:"afterInit,omitempty"`
AfterPerform *[]string `json:"afterPerform,omitempty"`
AfterPlan *[]string `json:"afterPlan,omitempty"`
AfterRun *[]string `json:"afterRun,omitempty"`
Autodeploy *bool `json:"autodeploy,omitempty"`
Autoretry *bool `json:"autoretry,omitempty"`
BeforeApply *[]string `json:"beforeApply,omitempty"`
BeforeDestroy *[]string `json:"beforeDestroy,omitempty"`
BeforeInit *[]string `json:"beforeInit,omitempty"`
BeforePerform *[]string `json:"beforePerform,omitempty"`
BeforePlan *[]string `json:"beforePlan,omitempty"`
Branch *string `json:"branch,omitempty"`
Description *string `json:"description,omitempty"`
GitHubActionDeploy *bool `json:"githubActionDeploy,omitempty"`
IsDisabled *bool `json:"isDisabled,omitempty"`
Labels *[]string `json:"labels,omitempty"`
LocalPreviewEnabled *bool `json:"localPreviewEnabled,omitempty"`
ProjectRoot *string `json:"projectRoot,omitempty"`
ProtectFromDeletion *bool `json:"protectFromDeletion,omitempty"`
Provider *string `json:"provider,omitempty"`
Repository string `json:"repository"`
RepositoryURL *string `json:"repositoryURL,omitempty"`
RunnerImage *string `json:"runnerImage,omitempty"`
TerraformVersion *string `json:"terraformVersion,omitempty"`
VCSInteragrionID *string `json:"vcsIntegrationId,omitempty"`
VendorConfig *VendorConfig `json:"vendorConfig,omitempty"`
WorkerPool *string `json:"workerPool,omitempty"`

AWSIntegration *AWSIntegration `json:"awsIntegration,omitempty"`

// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
SpaceName *string `json:"spaceName,omitempty"`
SpaceId *string `json:"spaceId,omitempty"`
AdditionalProjectGlobs *[]string `json:"additionalProjectGlobs,omitempty"`
Administrative *bool `json:"administrative,omitempty"`
AfterApply *[]string `json:"afterApply,omitempty"`
AfterDestroy *[]string `json:"afterDestroy,omitempty"`
AfterInit *[]string `json:"afterInit,omitempty"`
AfterPerform *[]string `json:"afterPerform,omitempty"`
AfterPlan *[]string `json:"afterPlan,omitempty"`
AfterRun *[]string `json:"afterRun,omitempty"`
Autodeploy *bool `json:"autodeploy,omitempty"`
Autoretry *bool `json:"autoretry,omitempty"`
BeforeApply *[]string `json:"beforeApply,omitempty"`
BeforeDestroy *[]string `json:"beforeDestroy,omitempty"`
BeforeInit *[]string `json:"beforeInit,omitempty"`
BeforePerform *[]string `json:"beforePerform,omitempty"`
BeforePlan *[]string `json:"beforePlan,omitempty"`
Branch *string `json:"branch,omitempty"`
Description *string `json:"description,omitempty"`
GitHubActionDeploy *bool `json:"githubActionDeploy,omitempty"`
IsDisabled *bool `json:"isDisabled,omitempty"`
Labels *[]string `json:"labels,omitempty"`
LocalPreviewEnabled *bool `json:"localPreviewEnabled,omitempty"`
ProjectRoot *string `json:"projectRoot,omitempty"`
ProtectFromDeletion *bool `json:"protectFromDeletion,omitempty"`
Provider *string `json:"provider,omitempty"`
Repository string `json:"repository"`
RepositoryURL *string `json:"repositoryURL,omitempty"`
RunnerImage *string `json:"runnerImage,omitempty"`
TerraformVersion *string `json:"terraformVersion,omitempty"`
VCSInteragrionID *string `json:"vcsIntegrationId,omitempty"`
VendorConfig *VendorConfig `json:"vendorConfig,omitempty"`
WorkerPool *string `json:"workerPool,omitempty"`
AWSIntegration *AWSIntegration `json:"awsIntegration,omitempty"`
// In our API managesStateFile is not part of StackInput
ManagesStateFile *bool `json:"managesStateFile,omitempty"`
}
Expand Down
92 changes: 38 additions & 54 deletions api/v1beta1/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 ac934fb

Please sign in to comment.