Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Operator SDK to 0.8.1 #449

Merged
merged 2 commits into from
Jun 4, 2019

Conversation

jpkrohling
Copy link
Contributor

This PR is divided in two commits: the first is to move from dep to go modules, as that's the new default for the Operator SDK. Note that it requires Go 1.11 with GO111MODULE=on or Go 1.12, where modules is activated by default. For my local development environment, I opted for using Go 1.12.

The second commit is to implement changes that I see when a new operator is generator, including the new tools.go at the root of the project and a new Dockerfile with a couple of scripts.

@jpkrohling
Copy link
Contributor Author

Tests are passing. I got some failures with the streaming tests at first, but manually removing the Kafka my-cluster after the first failed run, made the subsequent runs to complete successfully.

$ make test
Running unit tests...
?   	github.com/jaegertracing/jaeger-operator/cmd	[no test files]
?   	github.com/jaegertracing/jaeger-operator/cmd/manager	[no test files]
ok  	github.com/jaegertracing/jaeger-operator/pkg/account	0.034s	coverage: 100.0% of statements
?   	github.com/jaegertracing/jaeger-operator/pkg/apis	[no test files]
ok  	github.com/jaegertracing/jaeger-operator/pkg/apis/io/v1alpha1	0.063s	coverage: 15.7% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1	0.079s	coverage: 15.9% of statements
?   	github.com/jaegertracing/jaeger-operator/pkg/cmd/start	[no test files]
?   	github.com/jaegertracing/jaeger-operator/pkg/cmd/version	[no test files]
ok  	github.com/jaegertracing/jaeger-operator/pkg/config/sampling	0.085s	coverage: 94.1% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/config/ui	0.029s	coverage: 94.1% of statements
?   	github.com/jaegertracing/jaeger-operator/pkg/controller	[no test files]
?   	github.com/jaegertracing/jaeger-operator/pkg/controller/deployment	[no test files]
ok  	github.com/jaegertracing/jaeger-operator/pkg/controller/jaeger	2.159s	coverage: 69.2% of statements
?   	github.com/jaegertracing/jaeger-operator/pkg/controller/legacy	[no test files]
ok  	github.com/jaegertracing/jaeger-operator/pkg/cronjob	0.079s	coverage: 97.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/deployment	0.044s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/ingress	0.054s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/inject	0.041s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/inventory	0.057s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/route	0.044s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/service	0.026s	coverage: 100.0% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/storage	0.932s	coverage: 93.6% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/strategy	0.108s	coverage: 92.8% of statements
ok  	github.com/jaegertracing/jaeger-operator/pkg/util	0.008s	coverage: 100.0% of statements
?   	github.com/jaegertracing/jaeger-operator/pkg/version	[no test files]
Formatting code...
Building...
Sending build context to Docker daemon  185.6MB
Step 1/9 : FROM centos
 ---> 1e1148e4cc2c
Step 2/9 : ENV OPERATOR=/usr/local/bin/jaeger-operator     USER_UID=1001     USER_NAME=jaeger-operator
 ---> Using cache
 ---> a395a96ebf1b
Step 3/9 : RUN INSTALL_PKGS="       openssl       " &&     yum install -y $INSTALL_PKGS &&     rpm -V $INSTALL_PKGS &&     yum clean all &&     mkdir /tmp/_working_dir &&     chmod og+w /tmp/_working_dir
 ---> Using cache
 ---> 218935571c9a
Step 4/9 : COPY scripts/* /scripts/
 ---> Using cache
 ---> 29a672333030
Step 5/9 : COPY build/_output/bin/jaeger-operator ${OPERATOR}
 ---> 059237215f54
Step 6/9 : COPY build/bin /usr/local/bin
 ---> c08e4261e5d9
Step 7/9 : RUN  /usr/local/bin/user_setup
 ---> Running in 34861effd84e
+ mkdir -p /root
+ chown 1001:0 /root
+ chmod ug+rwx /root
+ chmod g+rw /etc/passwd
+ rm /usr/local/bin/user_setup
Removing intermediate container 34861effd84e
 ---> 97fee10f78c9
Step 8/9 : ENTRYPOINT ["/usr/local/bin/entrypoint"]
 ---> Running in 00c4bef69cc1
Removing intermediate container 00c4bef69cc1
 ---> 4bfaa4358fdf
Step 9/9 : USER ${USER_UID}
 ---> Running in 5e55df7d4f87
Removing intermediate container 5e55df7d4f87
 ---> c1c3ed3be812
Successfully built c1c3ed3be812
Successfully tagged jpkroehling/jaeger-operator:latest
Pushing image jpkroehling/jaeger-operator:latest...
Running Smoke end-to-end tests...
ok  	github.com/jaegertracing/jaeger-operator/test/e2e	182.174s
Creating namespace default
Running Cassandra end-to-end tests...
ok  	github.com/jaegertracing/jaeger-operator/test/e2e	105.714s
Running Elasticsearch end-to-end tests...
ok  	github.com/jaegertracing/jaeger-operator/test/e2e	156.104s
customresourcedefinition.apiextensions.k8s.io/prometheusrules.monitoring.coreos.com configured
customresourcedefinition.apiextensions.k8s.io/servicemonitors.monitoring.coreos.com configured
serviceaccount/elasticsearch-operator unchanged
clusterrole.rbac.authorization.k8s.io/elasticsearch-operator configured
clusterrolebinding.rbac.authorization.k8s.io/elasticsearch-operator-rolebinding configured
customresourcedefinition.apiextensions.k8s.io/elasticsearches.logging.openshift.io configured
deployment.apps/elasticsearch-operator configured
Running Self provisioned Elasticsearch end-to-end tests...
ok  	github.com/jaegertracing/jaeger-operator/test/e2e	0.147s
Creating namespace kafka
customresourcedefinition.apiextensions.k8s.io/kafkas.kafka.strimzi.io configured
rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-entity-operator-delegation unchanged
clusterrolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator configured
rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-topic-operator-delegation unchanged
customresourcedefinition.apiextensions.k8s.io/kafkausers.kafka.strimzi.io configured
clusterrole.rbac.authorization.k8s.io/strimzi-entity-operator configured
clusterrole.rbac.authorization.k8s.io/strimzi-cluster-operator-global configured
clusterrolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-kafka-broker-delegation configured
rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator unchanged
clusterrole.rbac.authorization.k8s.io/strimzi-cluster-operator-namespaced configured
clusterrole.rbac.authorization.k8s.io/strimzi-topic-operator configured
serviceaccount/strimzi-cluster-operator unchanged
clusterrole.rbac.authorization.k8s.io/strimzi-kafka-broker configured
customresourcedefinition.apiextensions.k8s.io/kafkatopics.kafka.strimzi.io configured
deployment.extensions/strimzi-cluster-operator configured
customresourcedefinition.apiextensions.k8s.io/kafkaconnects2is.kafka.strimzi.io configured
customresourcedefinition.apiextensions.k8s.io/kafkaconnects.kafka.strimzi.io configured
customresourcedefinition.apiextensions.k8s.io/kafkamirrormakers.kafka.strimzi.io configured
kafka.kafka.strimzi.io/my-cluster created
Running Streaming end-to-end tests...
ok  	github.com/jaegertracing/jaeger-operator/test/e2e	66.036s

@jpkrohling jpkrohling force-pushed the 448-Update-SDK-version branch 5 times, most recently from 0a920c6 to 359e0a8 Compare June 3, 2019 07:57
@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #449 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #449   +/-   ##
======================================
  Coverage    91.6%   91.6%           
======================================
  Files          64      64           
  Lines        3144    3144           
======================================
  Hits         2880    2880           
  Misses        184     184           
  Partials       80      80

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 682e23c...359e0a8. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #449 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #449   +/-   ##
=======================================
  Coverage   91.59%   91.59%           
=======================================
  Files          64       64           
  Lines        3142     3142           
=======================================
  Hits         2878     2878           
  Misses        184      184           
  Partials       80       80

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1af775c...2f67fd4. Read the comment docs.

@jpkrohling jpkrohling requested a review from objectiser June 3, 2019 12:51
deploy/olm-catalog/jaeger.clusterserviceversion.yaml Outdated Show resolved Hide resolved
deploy/olm-catalog/jaeger.clusterserviceversion.yaml Outdated Show resolved Hide resolved
@@ -2,6 +2,8 @@
build/_output
build/_test
deploy/test
vendor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no longer persist the vendor folder?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following discussion, agree better to align with recommended approach for modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that Go Modules supports vendor for backwards compatibility but is quite opinionated in this area. Modules do not reside under vendor: rather, a go.mod and go.sum record the dependencies and their checksums, so that reproducible builds should be possible even without a vendor directory.

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
@jpkrohling jpkrohling force-pushed the 448-Update-SDK-version branch from 95bf31d to 2f67fd4 Compare June 4, 2019 07:39
@jpkrohling jpkrohling merged commit 2f67fd4 into jaegertracing:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants