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

Moved from v1alpha1 to v1 #265

Merged
merged 6 commits into from
Mar 6, 2019

Conversation

jpkrohling
Copy link
Contributor

Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
@jpkrohling
Copy link
Contributor Author

This change is Reviewable

@jpkrohling
Copy link
Contributor Author

This PR is still missing the warning in case people try to use the old v1alpha1. This will be done in a subsequent commit to this PR, but it would be nice to get a first feedback on the changes so far.

@codecov
Copy link

codecov bot commented Mar 5, 2019

Codecov Report

Merging #265 into master will decrease coverage by 0.14%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
- Coverage   89.05%   88.91%   -0.15%     
==========================================
  Files          63       68       +5     
  Lines        2823     2886      +63     
==========================================
+ Hits         2514     2566      +52     
- Misses        201      211      +10     
- Partials      108      109       +1
Impacted Files Coverage Δ
pkg/apis/jaegertracing/v1/logger.go 0% <0%> (ø)
pkg/apis/jaegertracing/v1/builder.go 0% <0%> (ø)
pkg/controller/jaeger/role.go 63.63% <100%> (ø) ⬆️
pkg/strategy/streaming.go 100% <100%> (ø) ⬆️
pkg/route/query.go 100% <100%> (ø) ⬆️
pkg/strategy/production.go 75.4% <100%> (ø) ⬆️
pkg/deployment/collector.go 100% <100%> (ø) ⬆️
pkg/deployment/ingester.go 100% <100%> (ø) ⬆️
pkg/ingress/query.go 100% <100%> (ø) ⬆️
pkg/account/oauth-proxy.go 100% <100%> (ø) ⬆️
... and 43 more

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 7088dcf...9d48000. Read the comment docs.

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
@jpkrohling
Copy link
Contributor Author

When a CR with the old apiVersion is deployed, this is what's shown in the operator's logs:

WARN[0000] Attention: you are using a legacy CR for Jaeger. Use the apiVersion 'jaegertracing.io/v1' instead of 'io.jaegertracing/v1alpha1'  instance=simplest namespace=default

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

Only some minor comments. Just want to clarify - so the current PR will print a warning and not deploy anything, but before we release v1 it will handle deploying based on the old alpha1 version aswell?

@@ -90,7 +90,7 @@ Similar instructions also work for OpenShift, but the target `run-openshift` can

==== Model changes

The Operator SDK generates the `pkg/apis/io/v1alpha1/zz_generated.deepcopy.go` file via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/io/v1alpha1/types.go`)
The Operator SDK generates the `pkg/apis/jaegertracing/v1beta1/zz_generated.deepcopy.go` file via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/jaegertracing/v1beta1/jaeger_types.go`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be /v1 rather than /v1beta1?

@@ -161,6 +161,7 @@ func sidecarTest(t *testing.T, f *framework.Framework, ctx *framework.TestCtx) e
resp := &resp{}
err = json.Unmarshal(body, &resp)
if err != nil {
fmt.Println(body)
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to have this Println?

@jpkrohling
Copy link
Contributor Author

Just want to clarify - so the current PR will print a warning and not deploy anything, but before we release v1 it will handle deploying based on the old alpha1 version aswell?

We could do some type transformation. My preference would be to not have it for v1alpha1 -> v1, only for v1 -> v1.next and on.

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Copy link
Member

@pavolloffay pavolloffay left a comment

Choose a reason for hiding this comment

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

Do we need to keep apis.go for v1aplha1 if we don't do model transhormation?

It seems that some files reference io.jaegertracing. Like the OLM catalog

.travis/release.sh:22:sed "s~containerImage: docker.io/jaegertracing/jaeger-operator.*~containerImage: docker.io/${BUILD_IMAGE}~gi" -i deploy/olm-catalog/jaeger-operator.csv.yaml
CONTRIBUTING.adoc:116:jaeger.io.jaegertracing/simplest created
deploy/crds/io_v1alpha1_jaeger_cr.yaml:2:apiVersion: io.jaegertracing/v1alpha1
deploy/crds/io_v1alpha1_jaeger_crd.yaml:4:  name: jaegers.io.jaegertracing
deploy/crds/io_v1alpha1_jaeger_crd.yaml:6:  group: io.jaegertracing
deploy/olm-catalog/_generated.concat_crd.yaml:4:  name: jaegers.io.jaegertracing
deploy/olm-catalog/_generated.concat_crd.yaml:6:  group: io.jaegertracing
deploy/olm-catalog/jaeger-operator.csv.yaml:57:    containerImage: docker.io/jaegertracing/jaeger-operator:1.10.0
deploy/olm-catalog/jaeger-operator.csv.yaml:70:      name: jaegers.io.jaegertracing
deploy/olm-catalog/jaeger-operator.csv.yaml:109:          - io.jaegertracing
deploy/olm-catalog/jaeger-operator.csv.yaml:199:          - io.jaegertracing
deploy/role.yaml:38:  - io.jaegertracing
pkg/apis/io/v1alpha1/doc.go:3:// +groupName=io.jaegertracing
pkg/apis/io/v1alpha1/register.go:5:// +groupName=io.jaegertracing
pkg/apis/io/v1alpha1/register.go:15:    SchemeGroupVersion = schema.GroupVersion{Group: "io.jaegertracing", Version: "v1alpha1"}
pkg/controller/legacy/legacy_controller.go:80:  }).Warn("Attention: you are using a legacy CR for Jaeger. Use the apiVersion 'jaegertracing.io/v1' instead of 'io.jaegertracing/v1alpha1'")
test/role.yaml:37:  - io.jaegertracing

CONTRIBUTING.adoc Show resolved Hide resolved
deploy/crds/jaegertracing_v1_jaeger_cr.yaml Show resolved Hide resolved
deploy/crds/jaegertracing_v1_jaeger_crd.yaml Show resolved Hide resolved
deploy/crds/jaegertracing_v1_jaeger_crd.yaml Outdated Show resolved Hide resolved
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
@jpkrohling
Copy link
Contributor Author

Do we need to keep apis.go for v1aplha1 if we don't do model transhormation?

Yes, otherwise users will get the following error when trying to create a Jaeger instance with the old apiGroup:

error: unable to recognize "/tmp/simplest.yaml": no matches for kind "Jaeger" in version "io.jaegertracing/v1"

It seems that some files reference io.jaegertracing. Like the OLM catalog

I fixed the OLM catalog, which will still include the old apiGroup for the time being. I fixed the one in the contribution guide as well. All other entries look fine to me. Could you please re-check?

@pavolloffay
Copy link
Member

I fixed the OLM catalog, which will still include the old apiGroup for the time being.

We should maybe create an issue to migrate it to the new one?

Copy link
Member

@pavolloffay pavolloffay left a comment

Choose a reason for hiding this comment

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

LGTM, I would move freeform.go and options.go to a different package so it can be shared for both impls - to avoid doplicating two impls

@jpkrohling
Copy link
Contributor Author

We should maybe create an issue to migrate it to the new one?

I meant, it has both apiGroups now.

@jpkrohling jpkrohling merged commit fcb26f4 into jaegertracing:master Mar 6, 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.

3 participants