diff --git a/.golangci.yml b/.golangci.yml index 69d5ad2..e96801f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -54,4 +54,5 @@ service: run: skip-files: - - "zz_.*\\.go$" \ No newline at end of file + - "zz_.*\\.go$" + - "_test*.go" \ No newline at end of file diff --git a/controllers/space/reconciler.go b/controllers/space/reconciler.go index 23bb3d6..f505875 100644 --- a/controllers/space/reconciler.go +++ b/controllers/space/reconciler.go @@ -135,12 +135,12 @@ func (r *Reconciler) reconcileSpaceFromTemplate(ctx context.Context, space *naut } // Merge and override space.ResourceQuota and spacetemplate.ResourceQuota - rs, err := r.MergeResourceQuotas(space, spacetpl) + rs, err := MergeResourceQuotas(space, spacetpl) if err == nil { space.Spec.ResourceQuota = *rs } // Merge and override space.AdditionalRoleBindings and spacetemplate.AdditionalRoleBindings - rb, err := r.MergeRoleBindings(space, spacetpl) + rb, err := MergeRoleBindings(space, spacetpl) if err == nil { space.Spec.AdditionalRoleBindings = rb } diff --git a/controllers/space/utlis.go b/controllers/space/utlis.go index 7eff08b..ca4f5e5 100644 --- a/controllers/space/utlis.go +++ b/controllers/space/utlis.go @@ -32,7 +32,7 @@ func (r *Reconciler) FetchSpaceTemplate(ctx context.Context, name string) (*naut return spaceTemplate, nil } -func (r *Reconciler) MergeResourceQuotas(space *nauticusiov1alpha1.Space, spacetpl *nauticusiov1alpha1.SpaceTemplate) (*corev1.ResourceQuotaSpec, error) { +func MergeResourceQuotas(space *nauticusiov1alpha1.Space, spacetpl *nauticusiov1alpha1.SpaceTemplate) (*corev1.ResourceQuotaSpec, error) { resourceQuotas := &corev1.ResourceQuotaSpec{} resourceQuotas.Hard = make(corev1.ResourceList) // Check if resourceQuota is provided in the Space and spaceTemplate @@ -53,7 +53,7 @@ func (r *Reconciler) MergeResourceQuotas(space *nauticusiov1alpha1.Space, spacet return resourceQuotas, nil } -func (r *Reconciler) MergeRoleBindings(space *nauticusiov1alpha1.Space, spaceTemplate *nauticusiov1alpha1.SpaceTemplate) ([]nauticusiov1alpha1.AdditionalRoleBinding, error) { +func MergeRoleBindings(space *nauticusiov1alpha1.Space, spaceTemplate *nauticusiov1alpha1.SpaceTemplate) ([]nauticusiov1alpha1.AdditionalRoleBinding, error) { mergedRoleBindings := append([]nauticusiov1alpha1.AdditionalRoleBinding{}, space.Spec.AdditionalRoleBindings...) for _, roleBinding := range spaceTemplate.Spec.AdditionalRoleBindings {