Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoodwin committed May 7, 2024
1 parent a9b059d commit d5f8bc9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ COPY cmd ./cmd
COPY go.mod go.mod
COPY go.sum go.sum

COPY custom/ custom/

# Download all dependencies.
RUN go mod download

Expand All @@ -25,6 +27,7 @@ COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/


# Build
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /src/${PROJECT_NAME} \
-ldflags "-X ${REPO_PATH}/pkg/version.Version=${VERSION} -X ${REPO_PATH}/pkg/version.GitSHA=${GIT_SHA}" main.go
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ else
GOBIN=$(shell go env GOBIN)
endif

#
# SLEEVELESS
#
SLEEVELESS_REPO=docker.io/tlg2132/$(PROJECT_NAME)

# Install CRDs into a cluster
install: manifests kustomize
$(KUSTOMIZE) build config/crd | kubectl apply -f -
Expand Down Expand Up @@ -98,6 +103,11 @@ $(CONTROLLER_GEN): $(LOCALBIN)

all: generate check build

sleeveless: build-image
docker tag $(REPO):$(VERSION) $(SLEEVELESS_REPO):sleeveless
docker push $(SLEEVELESS_REPO):sleeveless


generate:
$(CONTROLLER_GEN) object paths="./..."
make manifests
Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/pravega/zookeeper-operator

go 1.21
go 1.21.0

toolchain go1.21.6

require (
github.com/ghodss/yaml v1.0.0
Expand All @@ -11,6 +13,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/sirupsen/logrus v1.9.0
github.com/tgoodwin/sleeveless/client v0.0.1
golang.org/x/net v0.17.0
k8s.io/api v0.27.5
k8s.io/apimachinery v0.27.5
Expand Down Expand Up @@ -75,3 +78,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/tgoodwin/sleeveless/client => ./custom/sleeveless-client
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (

api "github.com/pravega/zookeeper-operator/api/v1beta1"
"github.com/pravega/zookeeper-operator/controllers"
sleeve "github.com/tgoodwin/sleeveless/client"

Check failure on line 39 in main.go

View workflow job for this annotation

GitHub Actions / build

github.com/tgoodwin/sleeveless/client@v0.0.1: replacement directory ./custom/sleeveless-client does not exist

Check failure on line 39 in main.go

View workflow job for this annotation

GitHub Actions / build

github.com/tgoodwin/sleeveless/client@v0.0.1: replacement directory ./custom/sleeveless-client does not exist
// +kubebuilder:scaffold:imports
)

Expand Down Expand Up @@ -127,7 +128,7 @@ func main() {
}

if err = (&controllers.ZookeeperClusterReconciler{
Client: mgr.GetClient(),
Client: sleeve.Wrap(mgr.GetClient()),
Log: ctrl.Log.WithName("controllers").WithName("ZookeeperCluster"),
Scheme: mgr.GetScheme(),
ZkClient: new(zkClient.DefaultZookeeperClient),
Expand Down

0 comments on commit d5f8bc9

Please sign in to comment.