Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: cosolidate source #87

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY src/api/ src/api/
COPY src/controllers/ src/controllers/

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include tests/e2e/Makefile
#include test/e2e/Makefile

VERSION ?= 1.5.6

Expand Down Expand Up @@ -110,7 +110,7 @@ vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
test: manifests generate fmt vet envtest ## Run test.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

##@ Build
Expand Down
2 changes: 1 addition & 1 deletion kuttl-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kuttl.dev/v1beta1
kind: TestSuite
testDirs:
- ./tests/e2e/
- ./test/e2e/
startKIND: false
timeout: 120
skipDelete: false
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ package main

import (
"flag"
etcd "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/uffizzicluster"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/uffizzicluster"
"k8s.io/utils/pointer"
"os"
ctrlcfg "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1"
Expand All @@ -35,7 +36,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
fluxsourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
//+kubebuilder:scaffold:imports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1alpha1

import (
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v1alpha1
import (
"context"
"encoding/json"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"

"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand All @@ -9,7 +9,7 @@
suite: olm
test: olm-bundle-validation-test
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand All @@ -19,7 +19,7 @@
suite: olm
test: olm-crds-have-validation-test
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand All @@ -29,7 +29,7 @@
suite: olm
test: olm-crds-have-resources-test
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand All @@ -39,7 +39,7 @@
suite: olm
test: olm-spec-descriptors-test
- op: add
path: /stages/0/tests/-
path: /stages/0/test/-
value:
entrypoint:
- scorecard-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package etcd

import (
"context"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
8 changes: 4 additions & 4 deletions controllers/etcd/helm.go → src/controllers/etcd/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package etcd

import (
"context"
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/etcd"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
fluxsourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package etcd

import (
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
helmtypes "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types"
etcdhelmtypes "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
helmtypes "github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types"
etcdhelmtypes "github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types/etcd"
v1 "k8s.io/api/core/v1"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package vcluster

import (
"fmt"
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types/vcluster"
v1 "k8s.io/api/core/v1"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package vcluster

import (
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package etcd

import "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types"
import (
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types"
)

type Etcd struct {
Global Global `json:"global,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package vcluster

import (
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/types"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/types"
)

type Common struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uffizzicluster

import (
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package uffizzicluster
import (
"context"
"errors"
v1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package uffizzicluster
import (
"context"
"encoding/json"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
constants "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
fluxsourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package uffizzicluster

import (
"fmt"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package uffizzicluster
import (
"context"
"errors"
"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
uffizzicluster "github.com/UffizziCloud/uffizzi-cluster-operator/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
uffizzicluster "github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/etcd"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package uffizzicluster

import (
uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"path/filepath"
"testing"

Expand All @@ -29,12 +30,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

uclusteruffizzicomv1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
//+kubebuilder:scaffold:imports
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// These test use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.

var cfg *rest.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package uffizzicluster
import (
"context"
"encoding/json"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
"github.com/fluxcd/pkg/apis/meta"
"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -34,7 +35,6 @@ import (
controllerruntimesource "sigs.k8s.io/controller-runtime/pkg/source"
"time"

v1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
fluxhelmv2beta1 "github.com/fluxcd/helm-controller/api/v2beta1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
package uffizzicluster

import (
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
"testing"

"github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package uffizzicluster

import (
context "context"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/controllers/helm/build/vcluster"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/api/v1alpha1"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/constants"
"github.com/UffizziCloud/uffizzi-cluster-operator/src/controllers/helm/build/vcluster"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

v1alpha1 "github.com/UffizziCloud/uffizzi-cluster-operator/api/v1alpha1"
)

func (r *UffizziClusterReconciler) getUffizziClusterWorkload(ctx context.Context, uCluster *v1alpha1.UffizziCluster) (runtime.Object, error) {
Expand Down
Loading