Skip to content

Commit c9fd7a0

Browse files
authored
shared template repo to pkg
Shared template repo in pkg
2 parents 101bf2f + 1f15e57 commit c9fd7a0

File tree

31 files changed

+126
-42
lines changed

31 files changed

+126
-42
lines changed

cyclops-ctrl/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ local-redis:
162162
docker-compose up --detach
163163

164164
group-imports:
165-
goimports-reviser -recursive -file-path .
165+
goimports -w .
166166

167167
unit-test:
168168
go test -v -tags musl,dynamic ./...

cyclops-ctrl/cmd/main/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ package main
33
import (
44
"flag"
55
"fmt"
6-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/git"
76
"os"
87
"strconv"
98
"time"
109

10+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/git"
11+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/auth"
12+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template"
13+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template/cache"
14+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template/render"
15+
1116
_ "github.com/joho/godotenv/autoload"
1217
"k8s.io/apimachinery/pkg/runtime"
1318
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -20,15 +25,11 @@ import (
2025
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
2126
"sigs.k8s.io/controller-runtime/pkg/webhook"
2227

23-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/auth"
2428
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/handler"
2529
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/integrations/helm"
2630
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/modulecontroller"
2731
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/prometheus"
2832
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/telemetry"
29-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template"
30-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template/cache"
31-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template/render"
3233
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient"
3334

3435
cyclopsv1alpha1 "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1"

cyclops-ctrl/cmd/sandbox/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import (
55
"context"
66
"flag"
77
"fmt"
8-
"k8s.io/client-go/kubernetes/scheme"
98
"os"
109
"path/filepath"
1110

11+
"k8s.io/client-go/kubernetes/scheme"
12+
1213
v1 "k8s.io/api/core/v1"
1314
"k8s.io/client-go/kubernetes"
15+
1416
//"k8s.io/client-go/rest"
1517
"k8s.io/client-go/tools/clientcmd"
1618
"k8s.io/client-go/tools/remotecommand"

cyclops-ctrl/internal/controller/helm.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ package controller
22

33
import (
44
"fmt"
5+
"net/http"
6+
"sort"
7+
58
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/integrations/helm"
69
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/mapper"
710
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models"
@@ -10,8 +13,6 @@ import (
1013
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/telemetry"
1114
json "github.com/json-iterator/go"
1215
"helm.sh/helm/v3/pkg/chartutil"
13-
"net/http"
14-
"sort"
1516

1617
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient"
1718
"github.com/gin-gonic/gin"

cyclops-ctrl/internal/controller/modules.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import (
99
"strings"
1010
"time"
1111

12+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template"
13+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template/render"
14+
1215
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/git"
1316

1417
"sigs.k8s.io/yaml"
@@ -20,8 +23,6 @@ import (
2023
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto"
2124
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/prometheus"
2225
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/telemetry"
23-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template"
24-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template/render"
2526
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient"
2627
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2728
)

cyclops-ctrl/internal/controller/sse/resources.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package sse
22

33
import (
4-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto"
54
"io"
65
"net/http"
76
"time"
87

8+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto"
9+
910
"github.com/pkg/errors"
1011

1112
"github.com/gin-gonic/gin"

cyclops-ctrl/internal/controller/templates.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import (
44
"net/http"
55
"strings"
66

7+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/template"
8+
79
"github.com/gin-gonic/gin"
810
json "github.com/json-iterator/go"
911

1012
cyclopsv1alpha1 "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1"
1113
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/mapper"
1214
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto"
1315
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/telemetry"
14-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/template"
1516
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient"
1617
)
1718

cyclops-ctrl/internal/controller/tests/templates_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7+
"io"
8+
"net/http"
9+
"net/http/httptest"
10+
711
"github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1"
812
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models"
913
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto"
@@ -13,10 +17,7 @@ import (
1317
json "github.com/json-iterator/go"
1418
. "github.com/onsi/ginkgo/v2"
1519
. "github.com/onsi/gomega"
16-
"io"
1720
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
18-
"net/http"
19-
"net/http/httptest"
2021

2122
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/controller"
2223
k8smocks "github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/mocks"

cyclops-ctrl/internal/controller/ws/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package ws
22

33
import (
4+
"net/http"
5+
46
"github.com/gin-gonic/gin"
57
"github.com/gorilla/websocket"
6-
"net/http"
78

89
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient"
910
)

cyclops-ctrl/internal/git/writeclient.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7-
"github.com/go-logr/logr"
87
path2 "path"
98
"text/template"
109
"time"
1110

11+
"github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/auth"
12+
"github.com/go-logr/logr"
13+
1214
cyclopsv1alpha1 "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1"
13-
"github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/auth"
1415
"github.com/go-git/go-billy/v5"
1516
"github.com/go-git/go-billy/v5/memfs"
1617
"github.com/go-git/go-git/v5"

0 commit comments

Comments
 (0)