Skip to content

Commit

Permalink
rename cmd/manager to cmd/forklift-controller
Browse files Browse the repository at this point in the history
Signed-off-by: Arik Hadas <[email protected]>
  • Loading branch information
ahadas committed Jan 1, 2023
1 parent b822a2f commit c2b391f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ gazelle(name = "gazelle")
genrule(
name = "build-controller",
srcs = [
"//cmd/manager",
"//cmd/forklift-controller",
],
outs = ["manager"],
outs = ["forklift-controller"],
cmd = "echo '#!/bin/sh\n\ncp -f $(SRCS) $$1' > \"$@\"",
executable = 1,
)
Expand All @@ -52,7 +52,7 @@ load(
container_push(
name = "push-forklift-controller",
format = "Docker",
image = "//cmd/manager:forklift-controller-image",
image = "//cmd/forklift-controller:forklift-controller-image",
registry = "$${REGISTRY:-quay.io}",
repository = "$${REGISTRY_ACCOUNT:-}$${REGISTRY_ACCOUNT:+/}forklift-controller",
tag = "$${REGISTRY_TAG:-devel}",
Expand Down
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $ make run
go generate ./pkg/... ./cmd/...
go fmt ./pkg/... ./cmd/...
go vet ./pkg/... ./cmd/...
go run ./cmd/manager/main.go
go run ./cmd/forklift-controller/main.go
{"level":"info","ts":1555619492,"logger":"entrypoint","msg":"setting up client for manager"}
{"level":"info","ts":1555619492,"logger":"entrypoint","msg":"setting up manager"}
{"level":"info","ts":1555619493,"logger":"entrypoint","msg":"Registering Components."}
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

ci: all

all: test manager
all: test forklift-controller

# Run tests
test: generate fmt vet manifests
Expand All @@ -22,18 +22,18 @@ test: generate fmt vet manifests
e2e-sanity:
go test tests/base_test.go

# Build manager binary
manager: generate fmt vet
go build -o bin/manager github.com/konveyor/forklift-controller/cmd/manager
# Build forklift-controller binary
forklift-controller: generate fmt vet
go build -o bin/forklift-controller github.com/konveyor/forklift-controller/cmd/forklift-controller

# Build manager binary with compiler optimizations disabled
debug: generate fmt vet
go build -o bin/manager -gcflags=all="-N -l" github.com/konveyor/forklift-controller/cmd/manager
go build -o bin/forklift-controller -gcflags=all="-N -l" github.com/konveyor/forklift-controller/cmd/forklift-controller

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet
export METRICS_PORT=8888;\
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1 go run ./cmd/manager/main.go
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1 go run ./cmd/forklift-controller/main.go

# Install CRDs into a cluster
install: manifests
Expand Down Expand Up @@ -62,11 +62,11 @@ generate: controller-gen

# Build the docker image
build-controller:
bazel run cmd/manager:forklift-controller-image
bazel run cmd/forklift-controller:forklift-controller-image

# Push the docker image
push-contoller: build-controller
$(CONTAINER_CMD) tag cmd/manager:forklift-controller-image ${IMG}
$(CONTAINER_CMD) tag cmd/forklift-controller:forklift-controller-image ${IMG}
$(CONTAINER_CMD) push ${IMG}

# Build the docker image
Expand Down
58 changes: 29 additions & 29 deletions cmd/manager/BUILD.bazel → cmd/forklift-controller/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "manager_lib",
srcs = ["main.go"],
importpath = "github.com/konveyor/forklift-controller/cmd/manager",
visibility = ["//visibility:private"],
deps = [
"//pkg/apis",
"//pkg/controller",
"//pkg/settings",
"//pkg/webhook",
"//vendor/github.com/go-logr/logr",
"//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io",
"//vendor/github.com/openshift/api/template/v1:template",
"//vendor/github.com/pkg/profile",
"//vendor/github.com/prometheus/client_golang/prometheus/promhttp",
"//vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp",
"//vendor/kubevirt.io/client-go/api/v1:api",
"//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1",
"//vendor/sigs.k8s.io/controller-runtime/pkg/client/config",
"//vendor/sigs.k8s.io/controller-runtime/pkg/manager",
"//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/log",
"//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/signals",
],
)

go_binary(
name = "manager",
embed = [":manager_lib"],
name = "forklift-controller",
embed = [":forklift-controller_lib"],
static = "on",
#gotags = ["netgo"],
visibility = ["//visibility:public"],
Expand All @@ -47,10 +22,35 @@ container_image(
#base = "@centos-stream8//image",
base = "@ubi8-minimal//image",
directory = "/usr/local/bin/",
entrypoint = ["/usr/local/bin/manager"],
entrypoint = ["/usr/local/bin/forklift-controller"],
# workaround for github.com/bazelbuild/rules_go/issues/1706
env = {"GODEBUG": "netdns=go"},
files = [":manager"],
files = [":forklift-controller"],
#user = "1001",
visibility = ["//visibility:public"],
)

go_library(
name = "forklift-controller_lib",
srcs = ["main.go"],
importpath = "github.com/konveyor/forklift-controller/cmd/forklift-controller",
visibility = ["//visibility:private"],
deps = [
"//pkg/apis",
"//pkg/controller",
"//pkg/settings",
"//pkg/webhook",
"//vendor/github.com/go-logr/logr",
"//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io",
"//vendor/github.com/openshift/api/template/v1:template",
"//vendor/github.com/pkg/profile",
"//vendor/github.com/prometheus/client_golang/prometheus/promhttp",
"//vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp",
"//vendor/kubevirt.io/client-go/api/v1:api",
"//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1",
"//vendor/sigs.k8s.io/controller-runtime/pkg/client/config",
"//vendor/sigs.k8s.io/controller-runtime/pkg/manager",
"//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/log",
"//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/signals",
],
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
containers:
- name: main
command:
- /usr/local/bin/manager
- /usr/local/bin/forklift-controller
env:
- name: POD_NAMESPACE
valueFrom:
Expand Down Expand Up @@ -109,7 +109,7 @@ spec:
name: profiler
- name: inventory
command:
- /usr/local/bin/manager
- /usr/local/bin/forklift-controller
env:
- name: POD_NAMESPACE
valueFrom:
Expand Down

0 comments on commit c2b391f

Please sign in to comment.