Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Use go mod with ctr runtime v0.2.0 #4

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

skonto
Copy link

@skonto skonto commented Sep 11, 2019

Tested with:

GOPATH=path/go/new_runtime # required for the codegenerator to be picked up.
cd path/go/new_runtime/spark-on-k8s-operator # containts the checked out project no need for src/blablabla
export GO111MODULE=on
go fmt ./...
go vet ./...
go test ./...
go generate && CGO_ENABLED=0 GOOS=linux go build -o ~/operator
# build image
docker build --build-arg SPARK_IMAGE=lightbend/spark:2.1.1-OpenShift-2.4.3-2.12  -t skonto/operator:test -f Dockerfile .
# deploy
helm install ./fdp-sparkoperator \
  --name spark-operator-ns \
  --namespace spark \
  --version 0.4.0 \
  --set sparkJobNamespace=spark \
  --set imagePullPolicy=Always \
  --set operatorImageName=skonto/operator \
  --set operatorVersion=test \
  --set logLevel=4 \
  --debug
# run a spark app and verify things work as expected

Also tested go mod tidy required by kubebuilder cmd. WARN: this command will mess the deps.
Right now we have master versions k8s.io/* deps but we need to freeze to older ones eg kubernetes-1.14.1 as it is done upstream.
@yuchaoran2011 fyi the new branch is controller_runtime_0.2.0 and this PR starts with the latest commit upstream.
After I merge this I will continue with the webhook stuff and then apply the work you have done.

@skonto
Copy link
Author

skonto commented Sep 12, 2019

@yuchaoran2011 not sure if you faced this but if we move to 1.13 (eg. golang:1.13.0-alpine) we need to run:

...
WORKDIR /go/pkg/mod/k8s.io/[email protected]
RUN go mod init
...

in 1.12.x the default behavior is to succeed when you have no go.mod file but not with 1.13, it will not create one for you.
I noticed that in 1.12.5 the following and then found the related issue:

go: creating new go.mod: module k8s.io/code-generator
go: copying requirements from Godeps/Godeps.json
...

Related discussion here: golang/go#29433 and PR at the very end.

@skonto skonto merged commit aa7c262 into lightbend:controller_runtime_0.2.0 Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant