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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ignore:
- "pkg/apis/io/v1alpha1/zz_generated.deepcopy.go"
- "pkg/apis/jaegertracing/v1/zz_generated.deepcopy.go"
4 changes: 2 additions & 2 deletions .travis/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ sed "s/currentCSV: jaeger-operator.*/currentCSV: jaeger-operator.v${OPERATOR_VER
sed "s~containerImage: docker.io/jaegertracing/jaeger-operator.*~containerImage: docker.io/${BUILD_IMAGE}~gi" -i deploy/olm-catalog/jaeger-operator.csv.yaml
sed "s/name: jaeger-operator\.v.*/name: jaeger-operator.v${OPERATOR_VERSION}/gi" -i deploy/olm-catalog/jaeger-operator.csv.yaml
sed "s~image: jaegertracing/jaeger-operator.*~image: ${BUILD_IMAGE}~gi" -i deploy/olm-catalog/jaeger-operator.csv.yaml
## there's a "version: v1alpha1" there somewhere...
sed -E "s/version: ([0-9\.]+).*/version: ${OPERATOR_VERSION}/gi" deploy/olm-catalog/jaeger-operator.csv.yaml
## there's a "version: v1" there somewhere that we want to avoid
sed -E "s/version: ([0-9\.]+).*/version: ${OPERATOR_VERSION}/gi" -i deploy/olm-catalog/jaeger-operator.csv.yaml

# changes to test/operator.yaml
sed "s~image: jaegertracing/jaeger-operator.*~image: ${BUILD_IMAGE}~gi" -i test/operator.yaml
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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/v1/zz_generated.deepcopy.go` file via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/jaegertracing/v1/jaeger_types.go`)
jpkrohling marked this conversation as resolved.
Show resolved Hide resolved

==== Ingress configuration

Expand All @@ -113,7 +113,7 @@ To verify that it's working, deploy the `simplest.yaml` and check the ingress ro
[source,bash]
----
$ kubectl apply -f deploy/examples/simplest.yaml
jaeger.io.jaegertracing/simplest created
jaeger.jaegertracing.io/simplest created
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
simplest-query * 192.168.122.69 80 12s
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ check:

.PHONY: ensure-generate-is-noop
ensure-generate-is-noop: generate
@git diff -s --exit-code pkg/apis/io/v1alpha1/zz_generated.deepcopy.go || (echo "Build failed: a model has been changed but the deep copy functions aren't up to date. Run 'make generate' and update your PR." && exit 1)
@git diff -s --exit-code pkg/apis/jaegertracing/v1/zz_generated.deepcopy.go || (echo "Build failed: a model has been changed but the deep copy functions aren't up to date. Run 'make generate' and update your PR." && exit 1)

.PHONY: format
format:
Expand Down Expand Up @@ -76,7 +76,7 @@ e2e-tests: cassandra es crd build docker push
@echo "---" >> deploy/test/namespace-manifests.yaml

@cat test/operator.yaml | sed "s~image: jaegertracing\/jaeger-operator\:.*~image: $(BUILD_IMAGE)~gi" >> deploy/test/namespace-manifests.yaml
@go test ./test/e2e/... -kubeconfig $(KUBERNETES_CONFIG) -namespacedMan ../../deploy/test/namespace-manifests.yaml -globalMan ../../deploy/crds/io_v1alpha1_jaeger_crd.yaml -root .
@go test ./test/e2e/... -kubeconfig $(KUBERNETES_CONFIG) -namespacedMan ../../deploy/test/namespace-manifests.yaml -globalMan ../../deploy/crds/jaegertracing_v1_jaeger_crd.yaml -root .

.PHONY: run
run: crd
Expand All @@ -98,7 +98,7 @@ clean:

.PHONY: crd
crd:
@kubectl create -f deploy/crds/io_v1alpha1_jaeger_crd.yaml 2>&1 | grep -v "already exists" || true
@kubectl create -f deploy/crds/jaegertracing_v1_jaeger_crd.yaml 2>&1 | grep -v "already exists" || true

.PHONY: ingress
ingress:
Expand Down
22 changes: 11 additions & 11 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To install the operator, run:
[source,bash]
----
kubectl create namespace observability # <1>
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/io_v1alpha1_jaeger_crd.yaml
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/jaegertracing_v1_jaeger_crd.yaml
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/service_account.yaml
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role.yaml
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role_binding.yaml
Expand Down Expand Up @@ -51,7 +51,7 @@ The instructions from the previous section also work on OpenShift. Make sure to
oc login -u system:admin

oc new-project observability # <1>
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/io_v1alpha1_jaeger_crd.yaml
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/jaegertracing_v1_jaeger_crd.yaml
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/service_account.yaml
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role.yaml
oc create -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role_binding.yaml
Expand Down Expand Up @@ -83,7 +83,7 @@ The simplest possible way to install is by creating a YAML file like the followi
.simplest.yaml
[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simplest
Expand Down Expand Up @@ -136,7 +136,7 @@ For reference, here's how a more complex all-in-one instance can be created:
.all-in-one.yaml
[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: my-jaeger
Expand Down Expand Up @@ -218,7 +218,7 @@ The only additional information required is to provide the details for accessing

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-streaming
Expand Down Expand Up @@ -291,7 +291,7 @@ By default, the Jaeger UI is protected with OpenShift's OAuth service and any va

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: disable-oauth-proxy
Expand Down Expand Up @@ -337,7 +337,7 @@ By default, the Operator expects the agents to be deployed as sidecars to the ta

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: my-jaeger
Expand Down Expand Up @@ -399,7 +399,7 @@ to use a remote sampler:

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: with-sampling
Expand All @@ -425,7 +425,7 @@ When the storage type is set to Cassandra, the operator will automatically creat

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: cassandra-without-create-schema
Expand All @@ -442,7 +442,7 @@ Further aspects of the batch job can be configured as well. An example with all

[source,yaml]
----
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: cassandra-with-create-schema
Expand Down Expand Up @@ -490,5 +490,5 @@ kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operato
kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role_binding.yaml
kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role.yaml
kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/service_account.yaml
kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/io_v1alpha1_jaeger_crd.yaml
kubectl delete -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/jaegertracing_v1_jaeger_crd.yaml
----
5 changes: 5 additions & 0 deletions deploy/crds/jaegertracing_v1_jaeger_cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# see /examples
apiVersion: jaegertracing.io/v1
jpkrohling marked this conversation as resolved.
Show resolved Hide resolved
kind: Jaeger
metadata:
name: example-jaeger
13 changes: 13 additions & 0 deletions deploy/crds/jaegertracing_v1_jaeger_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apiextensions.k8s.io/v1beta1
jpkrohling marked this conversation as resolved.
Show resolved Hide resolved
kind: CustomResourceDefinition
metadata:
name: jaegers.jaegertracing.io
spec:
group: jaegertracing.io
names:
kind: Jaeger
listKind: JaegerList
plural: jaegers
singular: jaeger
scope: Namespaced
version: v1
2 changes: 1 addition & 1 deletion deploy/examples/agent-as-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: agent-as-daemonset
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/all-in-one-with-options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: "io.jaegertracing/v1alpha1"
apiVersion: jaegertracing.io/v1
kind: "Jaeger"
metadata:
name: "my-jaeger"
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/disable-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: disable-ingress
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/openshift/disable-oauth-proxy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: disable-oauth-proxy
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/simple-prod-deploy-es.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This CR deploys Jaeger and Elasticsearch
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-prod
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/simple-prod-with-volumes.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# setup an elasticsearch with `make es`
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-prod
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/simple-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# setup an elasticsearch with `make es`
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-prod
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/simple-streaming.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# setup an elasticsearch with `make es`
# setup a kafka platform using https://strimzi.io with quickstart instructions
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-streaming
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/simplest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simplest
2 changes: 1 addition & 1 deletion deploy/examples/with-cassandra.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: with-cassandra
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/with-sampling.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: io.jaegertracing/v1alpha1
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: with-sampling
Expand Down
16 changes: 16 additions & 0 deletions deploy/olm-catalog/_generated.concat_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,19 @@ spec:
singular: jaeger
scope: Namespaced
version: v1alpha1

---

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: jaegers.jaegertracing.io
spec:
group: jaegertracing.io
names:
kind: Jaeger
listKind: JaegerList
plural: jaegers
singular: jaeger
scope: Namespaced
version: v1
30 changes: 29 additions & 1 deletion deploy/olm-catalog/jaeger-operator.csv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
alm-examples: |-
[
{
"apiVersion": "io.jaegertracing/v1alpha1",
"apiVersion": "jaegertracing.io/v1",
"kind": "Jaeger",
"metadata": {
"name": "my-jaeger"
Expand Down Expand Up @@ -69,6 +69,9 @@ spec:
kind: Jaeger
name: jaegers.io.jaegertracing
version: v1alpha1
- kind: Jaeger
name: jaegers.jaegertracing.io
version: v1
description: Provides monitoring and troubleshooting microservices-based distributed
systems
displayName: jaeger-operator
Expand Down Expand Up @@ -130,6 +133,31 @@ spec:
- routes
verbs:
- '*'
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- '*'
- apiGroups:
- elasticsearch.jaegertracing.io
resources:
- jaeger
verbs:
- get
- apiGroups:
- logging.openshift.io
resources:
- elasticsearches
verbs:
- '*'
- apiGroups:
- jaegertracing.io
resources:
- '*'
verbs:
- '*'
serviceAccountName: jaeger-operator
deployments:
- name: jaeger-operator
Expand Down
6 changes: 6 additions & 0 deletions deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ rules:
- elasticsearches
verbs:
- '*'
- apiGroups:
- jaegertracing.io
resources:
- '*'
verbs:
- '*'
16 changes: 8 additions & 8 deletions pkg/account/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ package account
import (
"fmt"

"k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/jaegertracing/jaeger-operator/pkg/apis/io/v1alpha1"
"github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1"
)

// Get returns all the service accounts to be created for this Jaeger instance
func Get(jaeger *v1alpha1.Jaeger) []*v1.ServiceAccount {
accounts := []*v1.ServiceAccount{}
if jaeger.Spec.Ingress.Security == v1alpha1.IngressSecurityOAuthProxy {
func Get(jaeger *v1.Jaeger) []*corev1.ServiceAccount {
accounts := []*corev1.ServiceAccount{}
if jaeger.Spec.Ingress.Security == v1.IngressSecurityOAuthProxy {
accounts = append(accounts, OAuthProxy(jaeger))
}
return append(accounts, getMain(jaeger))
}

func getMain(jaeger *v1alpha1.Jaeger) *v1.ServiceAccount {
func getMain(jaeger *v1.Jaeger) *corev1.ServiceAccount {
trueVar := true
return &v1.ServiceAccount{
return &corev1.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: JaegerServiceAccountFor(jaeger),
Namespace: jaeger.Namespace,
Expand All @@ -45,6 +45,6 @@ func getMain(jaeger *v1alpha1.Jaeger) *v1.ServiceAccount {
}
}

func JaegerServiceAccountFor(jaeger *v1alpha1.Jaeger) string {
func JaegerServiceAccountFor(jaeger *v1.Jaeger) string {
return fmt.Sprintf("%s", jaeger.Name)
}
Loading