Skip to content

Commit e3f6a40

Browse files
committed
[go/v4] Move main.go inside cmd directory
1 parent 852df5e commit e3f6a40

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ COPY go.sum go.sum
1111
RUN go mod download
1212

1313
# Copy the go source
14-
COPY main.go main.go
15-
COPY apis/ apis/
16-
COPY controllers/ controllers/
14+
COPY cmd/main.go cmd/main.go
15+
COPY api/ api/
16+
COPY internal/controller/ internal/controller/
1717

1818
COPY pkg/ pkg/
1919
COPY version/ version/
2020

2121
# Build
22-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=`go env GOARCH` go build -a -o manager main.go
22+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=`go env GOARCH` go build -a -o manager cmd/main.go
2323

2424
# Use distroless as minimal base image to package the manager binary
2525
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ test-e2e: generate fmt vet manifests
106106
# Build manager binary
107107
.PHONY: manager
108108
manager: manifests generate fmt vet
109-
$(GO) build -o bin/manager main.go
109+
$(GO) build -o bin/manager cmd/main.go
110110

111111
# Run against the configured Kubernetes cluster in ~/.kube/config
112112
.PHONY: run
@@ -115,7 +115,7 @@ run: export THREESCALE_DEBUG=1
115115
run: export PREFLIGHT_CHECKS_BYPASS=true
116116
run: generate fmt vet manifests
117117
@-oc process THREESCALE_VERSION=$(THREESCALE_VERSION) -f config/requirements/operator-requirements.yaml | oc apply -f - -n $(WATCH_NAMESPACE)
118-
$(GO) run ./main.go --zap-devel
118+
$(GO) run ./cmd/main.go --zap-devel
119119

120120
##@ Build Dependencies
121121

@@ -429,7 +429,7 @@ bundle-update-test:
429429
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./bundle)" ]
430430

431431
$(PROMETHEUS_RULES_TARGETS): $(PROMETHEUS_RULES_DEPS)
432-
go run $(PROJECT_PATH)/pkg/3scale/amp/main.go prometheusrules --namespace $(PROMETHEUS_RULES_NAMESPACE) $(notdir $(basename $@)) >$@
432+
go run $(PROJECT_PATH)/pkg/3scale/amp/cmd/main.go prometheusrules --namespace $(PROMETHEUS_RULES_NAMESPACE) $(notdir $(basename $@)) >$@
433433

434434
.PHONY: prometheus-rules
435435
prometheus-rules: prometheus-rules-clean $(PROMETHEUS_RULES_TARGETS)
File renamed without changes.

internal/controller/apps/apimanager_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var _ = BeforeSuite(func() {
6868

6969
By("bootstrapping test environment")
7070
testEnv = &envtest.Environment{
71-
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
71+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
7272
}
7373

7474
var err error

0 commit comments

Comments
 (0)