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

Preparing release v1.22.0 #1412

Merged
merged 5 commits into from
Mar 22, 2021
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
Changes by Version
==================

1.22.0 (2021-03-16)
-------------------
* Add ability to indicate PriorityClass for collector and query ([#1413](https://github.com/jaegertracing/jaeger-operator/pull/1413), [@majidazimi](https://github.com/majidazimi))
* simplest example file should be as simplest ([#1404](https://github.com/jaegertracing/jaeger-operator/pull/1404), [@jkandasa](https://github.com/jkandasa))
* Add ability to indicate PriorityClass for agent ([#1392](https://github.com/jaegertracing/jaeger-operator/pull/1392), [@elkh510](https://github.com/elkh510))
* Migrate jaeger.tags in existing CRs ([#1380](https://github.com/jaegertracing/jaeger-operator/pull/1380), [@jpkrohling](https://github.com/jpkrohling))

1.21.3 (2021-02-09)
-------------------

* Migrate jaeger.tags in existing CRs ([#1380](https://github.com/jaegertracing/jaeger-operator/pull/1380), [@jpkrohling](https://github.com/jpkrohling))
* Remove support for the experimental OpenTelemetry-based Jaeger ([#1379](https://github.com/jaegertracing/jaeger-operator/pull/1379), [@jpkrohling](https://github.com/jpkrohling))
* Fix way we force es secret reconcile ([#1374](https://github.com/jaegertracing/jaeger-operator/pull/1374), [@kevinearls](https://github.com/kevinearls))
* added the codeql.yml ([#1313](https://github.com/jaegertracing/jaeger-operator/pull/1313), [@KrishnaSindhur](https://github.com/KrishnaSindhur))
Expand Down
6 changes: 3 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
1. Commit version change and changelog and create a pull request:

```
git commit -sm "Preparing relase v1.21.3"
git commit -sm "Preparing relase v1.22.0"
```

1. Tag and push

```
git checkout master ## it's only possible to release from master for now!
git tag release/v1.21.3
git push [email protected]:jaegertracing/jaeger-operator.git release/v1.21.3
git tag release/v1.22.0
git push [email protected]:jaegertracing/jaeger-operator.git release/v1.22.0
```

1. Wait until release CI job finishes and then pull the changes:
Expand Down
20 changes: 20 additions & 0 deletions pkg/upgrade/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package upgrade

import (
"strconv"
)

func flagBoolValue(v interface{}) bool {
strValue, isString := v.(string)
if isString {
value, err := strconv.ParseBool(strValue)
if err != nil {
// a default value if I can't parse it
return false
}
return value
}

boolValue := v.(bool)
return boolValue
}
35 changes: 34 additions & 1 deletion pkg/upgrade/v1_22_0.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,43 @@ func upgrade1_22_0(ctx context.Context, client client.Client, jaeger v1.Jaeger)
to: "agent.tags",
}}

flagMapQuery := []deprecationFlagMap{
{
from: "downsampling.hashsalt",
to: "",
},
{
from: "downsampling.ratio",
to: "",
},
}

j := &jaeger
j.Spec.AllInOne.Options = migrateDeprecatedOptions(j, j.Spec.AllInOne.Options, flagMapCollector)
j.Spec.Collector.Options = migrateDeprecatedOptions(j, j.Spec.Collector.Options, flagMapCollector)
j.Spec.Agent.Options = migrateDeprecatedOptions(j, j.Spec.Agent.Options, flagMapAgent)
j.Spec.Query.Options = migrateDeprecatedOptions(j, j.Spec.Query.Options, flagMapQuery)

return migrateCassandraVerifyFlagv1_22_0(jaeger), nil
}

func migrateCassandraVerifyFlagv1_22_0(j v1.Jaeger) v1.Jaeger {
j.Spec.Collector.Options = updateCassandraVerifyHostFlagv1_22_0(j.Spec.Collector.Options)
j.Spec.Storage.Options = updateCassandraVerifyHostFlagv1_22_0(j.Spec.Collector.Options)
j.Spec.Ingress.Options = updateCassandraVerifyHostFlagv1_22_0(j.Spec.Collector.Options)
return j
}

func updateCassandraVerifyHostFlagv1_22_0(options v1.Options) v1.Options {
oldFlag := "cassandra.tls.verify-host"
newFlag := "cassandra.tls.skip-host-verify"

return jaeger, nil
in := options.GenericMap()
if oldFlagValue, exist := in[oldFlag]; exist {
delete(in, oldFlag)
if !flagBoolValue(oldFlagValue) {
in[newFlag] = "true"
}
}
return v1.NewOptions(in)
}
92 changes: 87 additions & 5 deletions pkg/upgrade/v1_22_0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ import (
func TestUpgradeJaegerTagssv1_22_0(t *testing.T) {
latestVersion := "1.22.0"

// this is here because 1.22 isn't in the version map yet
// remove this code once it's been added there
upgrades[latestVersion] = upgrade1_22_0
parseSemVer()

opts := v1.NewOptions(map[string]interface{}{
"jaeger.tags": "somekey=somevalue",
})
Expand Down Expand Up @@ -61,3 +56,90 @@ func TestUpgradeJaegerTagssv1_22_0(t *testing.T) {
assert.Equal(t, "somekey=somevalue", colOpts["collector.tags"])
assert.NotContains(t, colOpts, "jaeger.tags")
}

func TestDeleteQueryRemovedFlags(t *testing.T) {
latestVersion := "1.22.0"
opts := v1.NewOptions(map[string]interface{}{
"downsampling.hashsalt": "somevalue",
"downsampling.ratio": "0.25",
})

nsn := types.NamespacedName{Name: "my-instance"}
existing := v1.NewJaeger(nsn)
existing.Status.Version = "1.21.0"
existing.Spec.Query.Options = opts

objs := []runtime.Object{existing}

s := scheme.Scheme
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.Jaeger{})
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.JaegerList{})
cl := fake.NewFakeClient(objs...)
assert.NoError(t, ManagedInstances(context.Background(), cl, cl, latestVersion))

persisted := &v1.Jaeger{}
assert.NoError(t, cl.Get(context.Background(), nsn, persisted))
assert.Equal(t, latestVersion, persisted.Status.Version)
assert.Len(t, persisted.Spec.Query.Options.Map(), 0)
assert.NotContains(t, persisted.Spec.Query.Options.Map(), "downsampling.hashsalt")
assert.NotContains(t, persisted.Spec.Query.Options.Map(), "downsampling.ratio")
}

func TestCassandraVerifyHostFlags(t *testing.T) {

oldFlag := "cassandra.tls.verify-host"
newFlag := "cassandra.tls.skip-host-verify"

tests := []struct {
testName string
opts v1.Options
flagPresent bool
flagValue string
}{
{
testName: "verify-host=true",
opts: v1.NewOptions(map[string]interface{}{
oldFlag: "true",
}),
flagPresent: false,
},
{
testName: "verify-host=false",
opts: v1.NewOptions(map[string]interface{}{
oldFlag: "false",
}),
flagPresent: true,
flagValue: "true",
},
}
latestVersion := "1.22.0"
for _, tt := range tests {
t.Run(tt.testName, func(t *testing.T) {
nsn := types.NamespacedName{Name: "my-instance"}
existing := v1.NewJaeger(nsn)
existing.Status.Version = "1.21.0"
existing.Spec.Collector.Options = tt.opts

objs := []runtime.Object{existing}
s := scheme.Scheme
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.Jaeger{})
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.JaegerList{})
cl := fake.NewFakeClient(objs...)
assert.NoError(t, ManagedInstances(context.Background(), cl, cl, latestVersion))

persisted := &v1.Jaeger{}
assert.NoError(t, cl.Get(context.Background(), nsn, persisted))
assert.Equal(t, latestVersion, persisted.Status.Version)
if tt.flagPresent {
assert.Len(t, persisted.Spec.Collector.Options.Map(), 1)
assert.NotContains(t, persisted.Spec.Collector.Options.Map(), oldFlag)
assert.Contains(t, persisted.Spec.Collector.Options.Map(), newFlag)
assert.Equal(t, tt.flagValue, persisted.Spec.Collector.Options.Map()[newFlag])
} else {
assert.Len(t, persisted.Spec.Collector.Options.Map(), 0)
assert.NotContains(t, persisted.Spec.Collector.Options.Map(), oldFlag)
}

})
}
}
2 changes: 1 addition & 1 deletion pkg/upgrade/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ var (
"1.17.0": upgrade1_17_0,
"1.18.0": upgrade1_18_0,
"1.20.0": upgrade1_20_0,
// "1.22.0": upgrade1_22_0, // enable once 1.22 is to be released
"1.22.0": upgrade1_22_0,
}
)
2 changes: 1 addition & 1 deletion versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ jaeger=1.21.0

# DO NOT EDIT the next value, it is updated automatically during the release.
# Represents the current (latest) release of the Jaeger Operator.
operator=1.21.3
operator=1.22.0