From ac934fba9e06968e3319af793fb45bb34846d5ce Mon Sep 17 00:00:00 2001 From: Elie CHARRA Date: Mon, 17 Jun 2024 14:21:35 +0200 Subject: [PATCH] fix: remove useless `settings` nesting in stack (#39) --- api/v1beta1/stack_types.go | 80 ++-- api/v1beta1/zz_generated.deepcopy.go | 92 ++--- config/crd/bases/app.spacelift.io_stacks.yaml | 355 +++++++++--------- internal/controller/stack_controller.go | 6 +- internal/controller/stack_controller_test.go | 28 +- internal/k8s/repository/stack_output_test.go | 4 +- internal/spacelift/repository/stack.go | 12 +- .../repository/structs/stack_input.go | 58 +-- tests/integration/stack_suite.go | 10 +- 9 files changed, 306 insertions(+), 339 deletions(-) diff --git a/api/v1beta1/stack_types.go b/api/v1beta1/stack_types.go index 51b7bff..8c1c96b 100644 --- a/api/v1beta1/stack_types.go +++ b/api/v1beta1/stack_types.go @@ -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"` } diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 995cd2b..b36a20c 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -770,8 +770,45 @@ func (in *Stack) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StackInput) DeepCopyInto(out *StackInput) { +func (in *StackList) DeepCopyInto(out *StackList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Stack, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackList. +func (in *StackList) DeepCopy() *StackList { + if in == nil { + return nil + } + out := new(StackList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StackList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackSpec) DeepCopyInto(out *StackSpec) { *out = *in + if in.CommitSHA != nil { + in, out := &in.CommitSHA, &out.CommitSHA + *out = new(string) + **out = **in + } if in.SpaceName != nil { in, out := &in.SpaceName, &out.SpaceName *out = new(string) @@ -996,59 +1033,6 @@ func (in *StackInput) DeepCopyInto(out *StackInput) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackInput. -func (in *StackInput) DeepCopy() *StackInput { - if in == nil { - return nil - } - out := new(StackInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StackList) DeepCopyInto(out *StackList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Stack, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackList. -func (in *StackList) DeepCopy() *StackList { - if in == nil { - return nil - } - out := new(StackList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StackList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StackSpec) DeepCopyInto(out *StackSpec) { - *out = *in - in.Settings.DeepCopyInto(&out.Settings) - if in.CommitSHA != nil { - in, out := &in.CommitSHA, &out.CommitSHA - *out = new(string) - **out = **in - } -} - // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSpec. func (in *StackSpec) DeepCopy() *StackSpec { if in == nil { diff --git a/config/crd/bases/app.spacelift.io_stacks.yaml b/config/crd/bases/app.spacelift.io_stacks.yaml index aae970f..bc9e1c6 100644 --- a/config/crd/bases/app.spacelift.io_stacks.yaml +++ b/config/crd/bases/app.spacelift.io_stacks.yaml @@ -34,204 +34,199 @@ spec: spec: description: StackSpec defines the desired state of Stack properties: + additionalProjectGlobs: + items: + type: string + type: array + administrative: + type: boolean + afterApply: + items: + type: string + type: array + afterDestroy: + items: + type: string + type: array + afterInit: + items: + type: string + type: array + afterPerform: + items: + type: string + type: array + afterPlan: + items: + type: string + type: array + afterRun: + items: + type: string + type: array + autodeploy: + type: boolean + autoretry: + type: boolean + awsIntegration: + properties: + id: + type: string + read: + type: boolean + write: + type: boolean + required: + - id + - read + - write + type: object + beforeApply: + items: + type: string + type: array + beforeDestroy: + items: + type: string + type: array + beforeInit: + items: + type: string + type: array + beforePerform: + items: + type: string + type: array + beforePlan: + items: + type: string + type: array + branch: + type: string commitSHA: minLength: 1 type: string + description: + type: string + githubActionDeploy: + type: boolean + isDisabled: + type: boolean + labels: + items: + type: string + type: array + localPreviewEnabled: + type: boolean + managesStateFile: + description: In our API managesStateFile is not part of StackInput + type: boolean name: minLength: 1 type: string - settings: + projectRoot: + type: string + protectFromDeletion: + type: boolean + provider: + type: string + repository: + type: string + repositoryURL: + type: string + runnerImage: + type: string + spaceId: + type: string + spaceName: + type: string + terraformVersion: + type: string + vcsIntegrationId: + type: string + vendorConfig: properties: - additionalProjectGlobs: - items: - type: string - type: array - administrative: - type: boolean - afterApply: - items: - type: string - type: array - afterDestroy: - items: - type: string - type: array - afterInit: - items: - type: string - type: array - afterPerform: - items: - type: string - type: array - afterPlan: - items: - type: string - type: array - afterRun: - items: - type: string - type: array - autodeploy: - type: boolean - autoretry: - type: boolean - awsIntegration: + ansible: + properties: + playbook: + type: string + required: + - playbook + type: object + cloudFormation: + properties: + entryTemplateFile: + type: string + region: + type: string + stackName: + type: string + templateBucket: + type: string + required: + - entryTemplateFile + - region + - stackName + - templateBucket + type: object + kubernetes: + properties: + kubectlVersion: + type: string + namespace: + type: string + required: + - namespace + type: object + pulumi: properties: - id: + loginURL: + type: string + stackName: type: string - read: + required: + - loginURL + - stackName + type: object + terraform: + properties: + externalStateAccessEnabled: type: boolean - write: + useSmartSanitization: type: boolean - required: - - id - - read - - write + version: + type: string + workflowTool: + type: string + workspace: + type: string type: object - beforeApply: - items: - type: string - type: array - beforeDestroy: - items: - type: string - type: array - beforeInit: - items: - type: string - type: array - beforePerform: - items: - type: string - type: array - beforePlan: - items: - type: string - type: array - branch: - type: string - description: - type: string - githubActionDeploy: - type: boolean - isDisabled: - type: boolean - labels: - items: - type: string - type: array - localPreviewEnabled: - type: boolean - managesStateFile: - description: In our API managesStateFile is not part of StackInput - type: boolean - projectRoot: - type: string - protectFromDeletion: - type: boolean - provider: - type: string - repository: - type: string - repositoryURL: - type: string - runnerImage: - type: string - spaceId: - type: string - spaceName: - type: string - terraformVersion: - type: string - vcsIntegrationId: - type: string - vendorConfig: + terragrunt: properties: - ansible: - properties: - playbook: - type: string - required: - - playbook - type: object - cloudFormation: - properties: - entryTemplateFile: - type: string - region: - type: string - stackName: - type: string - templateBucket: - type: string - required: - - entryTemplateFile - - region - - stackName - - templateBucket - type: object - kubernetes: - properties: - kubectlVersion: - type: string - namespace: - type: string - required: - - namespace - type: object - pulumi: - properties: - loginURL: - type: string - stackName: - type: string - required: - - loginURL - - stackName - type: object - terraform: - properties: - externalStateAccessEnabled: - type: boolean - useSmartSanitization: - type: boolean - version: - type: string - workflowTool: - type: string - workspace: - type: string - type: object - terragrunt: - properties: - terraformVersion: - type: string - terragruntVersion: - type: string - useRunAll: - type: boolean - useSmartSanitization: - type: boolean - required: - - terraformVersion - - terragruntVersion - - useRunAll - - useSmartSanitization - type: object + terraformVersion: + type: string + terragruntVersion: + type: string + useRunAll: + type: boolean + useSmartSanitization: + type: boolean + required: + - terraformVersion + - terragruntVersion + - useRunAll + - useSmartSanitization type: object - workerPool: - type: string - required: - - repository type: object - x-kubernetes-validations: - - message: only one of spaceName or spaceId can be set - rule: has(self.spaceName) != has(self.spaceId) + workerPool: + type: string required: - name - - settings + - repository type: object + x-kubernetes-validations: + - message: only one of spaceName or spaceId can be set + rule: has(self.spaceName) != has(self.spaceId) status: description: StackStatus defines the observed state of Stack properties: diff --git a/internal/controller/stack_controller.go b/internal/controller/stack_controller.go index e6417cb..2a26638 100644 --- a/internal/controller/stack_controller.go +++ b/internal/controller/stack_controller.go @@ -74,8 +74,8 @@ func (r *StackReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl return ctrl.Result{}, errors.Wrap(err, "unable to retrieve stack from spacelift") } - if stack.Spec.Settings.SpaceName != nil { - space, err := r.SpaceRepository.Get(ctx, types.NamespacedName{Namespace: stack.Namespace, Name: *stack.Spec.Settings.SpaceName}) + if stack.Spec.SpaceName != nil { + space, err := r.SpaceRepository.Get(ctx, types.NamespacedName{Namespace: stack.Namespace, Name: *stack.Spec.SpaceName}) if err != nil { if k8sErrors.IsNotFound(err) { logger.V(logging.Level4).Info("Unable to find space for stack") @@ -98,7 +98,7 @@ func (r *StackReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl } } - stack.Spec.Settings.SpaceId = &space.Status.Id + stack.Spec.SpaceId = &space.Status.Id } if errors.Is(err, spaceliftRepository.ErrStackNotFound) { diff --git a/internal/controller/stack_controller_test.go b/internal/controller/stack_controller_test.go index 2970a85..b918efa 100644 --- a/internal/controller/stack_controller_test.go +++ b/internal/controller/stack_controller_test.go @@ -68,14 +68,14 @@ func (s *StackControllerSuite) TestStackCreation_InvalidSpec() { ExpectedErr string }{ { - Spec: v1beta1.StackSpec{Settings: v1beta1.StackInput{SpaceName: utils.AddressOf("space-name")}}, + Spec: v1beta1.StackSpec{SpaceName: utils.AddressOf("space-name")}, Name: "missing name", ExpectedErr: `Stack.app.spacelift.io "invalid-stack" is invalid: spec.name: Invalid value: "": spec.name in body should be at least 1 chars long`, }, { - Spec: v1beta1.StackSpec{Name: "name", Settings: v1beta1.StackInput{}}, - Name: "missing name", - ExpectedErr: `Stack.app.spacelift.io "invalid-stack" is invalid: spec.settings: Invalid value: "object": only one of spaceName or spaceId can be set`, + Spec: v1beta1.StackSpec{Name: "name"}, + Name: "missing space", + ExpectedErr: `Stack.app.spacelift.io "invalid-stack" is invalid: spec: Invalid value: "object": only one of spaceName or spaceId can be set`, }, } @@ -174,12 +174,10 @@ func (s *StackControllerSuite) TestStackCreation_OK_SpaceNotReady() { Namespace: "default", }, Spec: v1beta1.StackSpec{ - Name: "test-stack", - Settings: v1beta1.StackInput{ - Branch: utils.AddressOf("fake-branch"), - Repository: "fake-repository", - SpaceName: utils.AddressOf(spaceName), - }, + Name: "test-stack", + Branch: utils.AddressOf("fake-branch"), + Repository: "fake-repository", + SpaceName: utils.AddressOf(spaceName), }, } @@ -273,12 +271,10 @@ func (s *StackControllerSuite) TestStackCreationWithSpaceName_OK() { Namespace: "default", }, Spec: v1beta1.StackSpec{ - Name: "test-stack", - Settings: v1beta1.StackInput{ - Branch: utils.AddressOf("fake-branch"), - Repository: "fake-repository", - SpaceName: utils.AddressOf(space.Name), - }, + Name: "test-stack", + Branch: utils.AddressOf("fake-branch"), + Repository: "fake-repository", + SpaceName: utils.AddressOf(space.Name), }, } diff --git a/internal/k8s/repository/stack_output_test.go b/internal/k8s/repository/stack_output_test.go index fd71bc8..d84ed4e 100644 --- a/internal/k8s/repository/stack_output_test.go +++ b/internal/k8s/repository/stack_output_test.go @@ -47,8 +47,8 @@ func (s *StackOutputRepositorySuite) TestUpdateOrCreateStackOutputSecret_OK_With Name: "foobar", }, Spec: v1beta1.StackSpec{ - Name: "foobar", - Settings: v1beta1.StackInput{SpaceId: utils.AddressOf("fake-space")}, + Name: "foobar", + SpaceId: utils.AddressOf("fake-space"), }, } diff --git a/internal/spacelift/repository/stack.go b/internal/spacelift/repository/stack.go index e539939..f488f32 100644 --- a/internal/spacelift/repository/stack.go +++ b/internal/spacelift/repository/stack.go @@ -54,8 +54,8 @@ func (r *stackRepository) Create(ctx context.Context, stack *v1beta1.Stack) (*mo "manageState": graphql.Boolean(true), } - if stack.Spec.Settings.ManagesStateFile != nil { - stackCreateMutationVars["manageState"] = graphql.Boolean(*stack.Spec.Settings.ManagesStateFile) + if stack.Spec.ManagesStateFile != nil { + stackCreateMutationVars["manageState"] = graphql.Boolean(*stack.Spec.ManagesStateFile) } if err := c.Mutate(ctx, &stackCreateMutation, stackCreateMutationVars); err != nil { @@ -64,7 +64,7 @@ func (r *stackRepository) Create(ctx context.Context, stack *v1beta1.Stack) (*mo url := c.URL("/stack/%s", stackCreateMutation.StackCreate.ID) stack.Status.Id = stackCreateMutation.StackCreate.ID - if stack.Spec.Settings.AWSIntegration != nil { + if stack.Spec.AWSIntegration != nil { if err := r.attachAWSIntegration(ctx, stack); err != nil { return nil, errors.Wrap(err, "unable to attach AWS integration to stack") } @@ -93,10 +93,10 @@ func (r *stackRepository) attachAWSIntegration(ctx context.Context, stack *v1bet } `graphql:"awsIntegrationAttach(id: $id, stack: $stack, read: $read, write: $write)"` } awsIntegrationAttachVars := map[string]any{ - "id": stack.Spec.Settings.AWSIntegration.Id, + "id": stack.Spec.AWSIntegration.Id, "stack": stack.Status.Id, - "read": graphql.Boolean(stack.Spec.Settings.AWSIntegration.Read), - "write": graphql.Boolean(stack.Spec.Settings.AWSIntegration.Write), + "read": graphql.Boolean(stack.Spec.AWSIntegration.Read), + "write": graphql.Boolean(stack.Spec.AWSIntegration.Write), } if err := c.Mutate(ctx, &awsIntegrationAttachMutation, awsIntegrationAttachVars); err != nil { return err diff --git a/internal/spacelift/repository/structs/stack_input.go b/internal/spacelift/repository/structs/stack_input.go index e99a91e..1b771ec 100644 --- a/internal/spacelift/repository/structs/stack_input.go +++ b/internal/spacelift/repository/structs/stack_input.go @@ -95,18 +95,18 @@ type TerraformInput struct { } func FromStackSpec(stackSpec v1beta1.StackSpec) StackInput { - administrative := getGraphQLBoolean(stackSpec.Settings.Administrative) + administrative := getGraphQLBoolean(stackSpec.Administrative) if administrative == nil { administrative = graphql.NewBoolean(false) } branch := graphql.String("main") - if stackSpec.Settings.Branch != nil { - branch = graphql.String(*stackSpec.Settings.Branch) + if stackSpec.Branch != nil { + branch = graphql.String(*stackSpec.Branch) } var namespace *string - var repo = stackSpec.Settings.Repository + var repo = stackSpec.Repository if pos := strings.LastIndexByte(repo, '/'); pos != -1 { ns := repo[:pos] repo = repo[pos+1:] @@ -115,37 +115,37 @@ func FromStackSpec(stackSpec v1beta1.StackSpec) StackInput { ret := StackInput{ Administrative: *administrative, - Autodeploy: getGraphQLBoolean(stackSpec.Settings.Autodeploy), - Autoretry: getGraphQLBoolean(stackSpec.Settings.Autoretry), + Autodeploy: getGraphQLBoolean(stackSpec.Autodeploy), + Autoretry: getGraphQLBoolean(stackSpec.Autoretry), Branch: branch, - GitHubActionDeploy: getGraphQLBoolean(stackSpec.Settings.GitHubActionDeploy), - LocalPreviewEnabled: getGraphQLBoolean(stackSpec.Settings.LocalPreviewEnabled), + GitHubActionDeploy: getGraphQLBoolean(stackSpec.GitHubActionDeploy), + LocalPreviewEnabled: getGraphQLBoolean(stackSpec.LocalPreviewEnabled), Name: graphql.String(stackSpec.Name), - ProtectFromDeletion: getGraphQLBoolean(stackSpec.Settings.ProtectFromDeletion), + ProtectFromDeletion: getGraphQLBoolean(stackSpec.ProtectFromDeletion), Namespace: getGraphQLString(namespace), Repository: graphql.String(repo), } - ret.AddditionalProjectGlobs = GetGraphQLStrings(stackSpec.Settings.AdditionalProjectGlobs) - ret.AfterApply = GetGraphQLStrings(stackSpec.Settings.AfterApply) - ret.AfterDestroy = GetGraphQLStrings(stackSpec.Settings.AfterDestroy) - ret.AfterInit = GetGraphQLStrings(stackSpec.Settings.AfterInit) - ret.AfterPerform = GetGraphQLStrings(stackSpec.Settings.AfterPerform) - ret.AfterPlan = GetGraphQLStrings(stackSpec.Settings.AfterPlan) - ret.AfterRun = GetGraphQLStrings(stackSpec.Settings.AfterRun) - ret.BeforeApply = GetGraphQLStrings(stackSpec.Settings.BeforeApply) - ret.BeforeDestroy = GetGraphQLStrings(stackSpec.Settings.BeforeDestroy) - ret.BeforeInit = GetGraphQLStrings(stackSpec.Settings.BeforeInit) - ret.BeforePerform = GetGraphQLStrings(stackSpec.Settings.BeforePerform) - ret.BeforePlan = GetGraphQLStrings(stackSpec.Settings.BeforePlan) - ret.Description = getGraphQLString(stackSpec.Settings.Description) - ret.Provider = getGraphQLString(stackSpec.Settings.Provider) - ret.Labels = GetGraphQLStrings(stackSpec.Settings.Labels) - ret.Space = getGraphQLString(stackSpec.Settings.SpaceId) - ret.ProjectRoot = getGraphQLString(stackSpec.Settings.ProjectRoot) - ret.RunnerImage = getGraphQLString(stackSpec.Settings.RunnerImage) - ret.VendorConfig = getVendorConfig(stackSpec.Settings.VendorConfig) - ret.WorkerPool = getGraphQLID(stackSpec.Settings.WorkerPool) + ret.AddditionalProjectGlobs = GetGraphQLStrings(stackSpec.AdditionalProjectGlobs) + ret.AfterApply = GetGraphQLStrings(stackSpec.AfterApply) + ret.AfterDestroy = GetGraphQLStrings(stackSpec.AfterDestroy) + ret.AfterInit = GetGraphQLStrings(stackSpec.AfterInit) + ret.AfterPerform = GetGraphQLStrings(stackSpec.AfterPerform) + ret.AfterPlan = GetGraphQLStrings(stackSpec.AfterPlan) + ret.AfterRun = GetGraphQLStrings(stackSpec.AfterRun) + ret.BeforeApply = GetGraphQLStrings(stackSpec.BeforeApply) + ret.BeforeDestroy = GetGraphQLStrings(stackSpec.BeforeDestroy) + ret.BeforeInit = GetGraphQLStrings(stackSpec.BeforeInit) + ret.BeforePerform = GetGraphQLStrings(stackSpec.BeforePerform) + ret.BeforePlan = GetGraphQLStrings(stackSpec.BeforePlan) + ret.Description = getGraphQLString(stackSpec.Description) + ret.Provider = getGraphQLString(stackSpec.Provider) + ret.Labels = GetGraphQLStrings(stackSpec.Labels) + ret.Space = getGraphQLString(stackSpec.SpaceId) + ret.ProjectRoot = getGraphQLString(stackSpec.ProjectRoot) + ret.RunnerImage = getGraphQLString(stackSpec.RunnerImage) + ret.VendorConfig = getVendorConfig(stackSpec.VendorConfig) + ret.WorkerPool = getGraphQLID(stackSpec.WorkerPool) return ret } diff --git a/tests/integration/stack_suite.go b/tests/integration/stack_suite.go index 7d98ce5..33f8080 100644 --- a/tests/integration/stack_suite.go +++ b/tests/integration/stack_suite.go @@ -24,12 +24,10 @@ var DefaultValidStack = v1beta1.Stack{ Namespace: "default", }, Spec: v1beta1.StackSpec{ - Name: "test-stack", - Settings: v1beta1.StackInput{ - Branch: utils.AddressOf("fake-branch"), - Repository: "fake-repository", - SpaceId: utils.AddressOf("fake-space"), - }, + Name: "test-stack", + Branch: utils.AddressOf("fake-branch"), + Repository: "fake-repository", + SpaceId: utils.AddressOf("fake-space"), }, } var DefaultValidStackStatus = v1beta1.StackStatus{