Skip to content

Commit

Permalink
920: Jaeger client generation
Browse files Browse the repository at this point in the history
Signed-off-by: Ramesh Reddy <[email protected]>
  • Loading branch information
rareddy committed Feb 25, 2020
1 parent de6fff1 commit b42ec5b
Show file tree
Hide file tree
Showing 16 changed files with 350 additions and 61 deletions.
22 changes: 22 additions & 0 deletions .ci/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ if [ $? != 0 ]; then
fi
fi

CLIENTGEN=client-gen
command -v ${CLIENTGEN} > /dev/null
if [ $? != 0 ]; then
if [ -n ${GOPATH} ]; then
CLIENTGEN="${GOPATH}/bin/client-gen"
fi
fi

# generate the CRD(s)
operator-sdk generate crds
RT=$?
Expand Down Expand Up @@ -38,3 +46,17 @@ if [ ${RT} != 0 ]; then
echo "Failed to generate the Kubernetes stubs."
exit ${RT}
fi

# generate the clients
${CLIENTGEN} \
--input "jaegertracing/v1" \
--input-base github.com/jaegertracing/jaeger-operator/pkg/apis \
--go-header-file /dev/null \
--output-package github.com/jaegertracing/jaeger-operator/pkg/client \
--clientset-name versioned \
--output-base ../../../
RT=$?
if [ ${RT} != 0 ]; then
echo "Failed to generate the Jaeger Tracing clients."
exit ${RT}
fi
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SDK_VERSION=v0.15.1
GOPATH ?= "$(HOME)/go"

LD_FLAGS ?= "-X $(VERSION_PKG).version=$(OPERATOR_VERSION) -X $(VERSION_PKG).buildDate=$(VERSION_DATE) -X $(VERSION_PKG).defaultJaeger=$(JAEGER_VERSION)"
UNIT_TEST_PACKAGES := $(shell go list ./cmd/... ./pkg/... | grep -v elasticsearch/v1 | grep -v kafka/v1beta1)
UNIT_TEST_PACKAGES := $(shell go list ./cmd/... ./pkg/... | grep -v elasticsearch/v1 | grep -v kafka/v1beta1 | grep -v client/versioned)
TEST_OPTIONS = $(VERBOSE) -kubeconfig $(KUBERNETES_CONFIG) -namespacedMan ../../deploy/test/namespace-manifests.yaml -globalMan ../../deploy/test/global-manifests.yaml -root .

.DEFAULT_GOAL := build
Expand All @@ -37,8 +37,10 @@ check:
@[ ! -s "$(FMT_LOG)" ] || (echo "Go fmt, license check, or import ordering failures, run 'make format'" | cat - $(FMT_LOG) && false)

.PHONY: ensure-generate-is-noop
ensure-generate-is-noop: generate
ensure-generate-is-noop: generate format
@git diff -s --exit-code pkg/apis/jaegertracing/v1/zz_generated.*.go || (echo "Build failed: a model has been changed but the generated resources aren't up to date. Run 'make generate' and update your PR." && exit 1)
@git diff -s --exit-code pkg/client/versioned || (echo "Build failed: the versioned clients aren't up to date. Run 'make generate'." && exit 1)


.PHONY: format
format:
Expand Down Expand Up @@ -260,8 +262,11 @@ ingress:
@kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.18.0/deploy/mandatory.yaml
@minikube addons enable ingress

.PHONY: generate
generate:
.PHONY: generate
generate: internal-generate format

.PHONY: internal-generate
internal-generate:
@GOPATH=${GOPATH} ./.ci/generate.sh

.PHONY: test
Expand All @@ -288,6 +293,7 @@ install-tools:
golang.org/x/lint/golint \
github.com/securego/gosec/cmd/gosec \
golang.org/x/tools/cmd/goimports \
k8s.io/code-generator/cmd/client-gen \
k8s.io/kube-openapi/cmd/openapi-gen

.PHONY: install
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ k8s.io/client-go v0.0.0-20191016111102-bec269661e48 h1:C2XVy2z0dV94q9hSSoCuTPp1K
k8s.io/client-go v0.0.0-20191016111102-bec269661e48/go.mod h1:hrwktSwYGI4JK+TJA3dMaFyyvHVi/aLarVHpbs8bgCU=
k8s.io/cloud-provider v0.0.0-20191016115326-20453efc2458/go.mod h1:O5SO5xcgxrjJV9EC9R/47RuBpbk5YX9URDBlg++FA5o=
k8s.io/cluster-bootstrap v0.0.0-20191016115129-c07a134afb42/go.mod h1:MzCL6kLExQuHruGaqibd8cugC8nw8QRxm3+lzR5l8SI=
k8s.io/code-generator v0.0.0-20191004115455-8e001e5d1894 h1:NMYlxaF7rYQJk2E2IyrUhaX81zX24+dmoZdkPw0gJqI=
k8s.io/code-generator v0.0.0-20191004115455-8e001e5d1894/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY=
k8s.io/component-base v0.0.0-20191016111319-039242c015a9/go.mod h1:SuWowIgd/dtU/m/iv8OD9eOxp3QZBBhTIiWMsBQvKjI=
k8s.io/cri-api v0.0.0-20190828162817-608eb1dad4ac/go.mod h1:BvtUaNBr0fEpzb11OfrQiJLsLPtqbmulpo1fPwcpP6Q=
Expand Down
114 changes: 57 additions & 57 deletions pkg/apis/jaegertracing/v1/zz_generated.openapi.go

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions pkg/client/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/client/versioned/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions pkg/client/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/client/versioned/fake/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions pkg/client/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/client/versioned/scheme/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions pkg/client/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/client/versioned/typed/jaegertracing/v1/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/client/versioned/typed/jaegertracing/v1/fake/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b42ec5b

Please sign in to comment.