forked from jaegertracing/jaeger-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing relase 1.20.0 (jaegertracing#1223)
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
- Loading branch information
1 parent
f5efe2a
commit 7d7d6ab
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package upgrade | ||
|
||
import ( | ||
"context" | ||
|
||
v1 "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
func upgrade1_20_0(ctx context.Context, client client.Client, jaeger v1.Jaeger) (v1.Jaeger, error) { | ||
d := []deprecationFlagMap{{ | ||
from: "es.max-num-spans", | ||
to: "es.max-doc-count", | ||
}, { | ||
from: "es-archive.max-num-spans", | ||
to: "es-archive.max-doc-count", | ||
}} | ||
|
||
return migrateAllDeprecatedOptions(jaeger, d), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package upgrade | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
v1 "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1" | ||
"github.com/stretchr/testify/assert" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/client-go/kubernetes/scheme" | ||
"sigs.k8s.io/controller-runtime/pkg/client/fake" | ||
) | ||
|
||
func TestUpgradeDeprecatedOptionsv1_20_0NonConflicting(t *testing.T) { | ||
latestVersion := "1.20.0" | ||
nsn := types.NamespacedName{Name: "my-instance"} | ||
existing := v1.NewJaeger(nsn) | ||
existing.Status.Version = "1.19.0" | ||
existing.Spec.Collector.Options = v1.NewOptions(map[string]interface{}{ | ||
"es.max-num-spans": "100", | ||
"es-archive.max-num-spans": "101", | ||
}) | ||
objs := []runtime.Object{existing} | ||
|
||
s := scheme.Scheme | ||
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.Jaeger{}) | ||
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.JaegerList{}) | ||
cl := fake.NewFakeClient(objs...) | ||
|
||
// test | ||
assert.NoError(t, ManagedInstances(context.Background(), cl, cl, latestVersion)) | ||
|
||
// verify | ||
persisted := &v1.Jaeger{} | ||
assert.NoError(t, cl.Get(context.Background(), nsn, persisted)) | ||
assert.Equal(t, latestVersion, persisted.Status.Version) | ||
|
||
opts := persisted.Spec.Collector.Options.Map() | ||
assert.Contains(t, opts, "es.max-doc-count") | ||
assert.Equal(t, "100", opts["es.max-doc-count"]) | ||
assert.NotContains(t, opts, "es.max-num-spans") | ||
|
||
assert.Contains(t, opts, "es-archive.max-doc-count") | ||
assert.Equal(t, "101", opts["es-archive.max-doc-count"]) | ||
assert.NotContains(t, opts, "es-archive.max-num-spans") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ var ( | |
"1.15.0": upgrade1_15_0, | ||
"1.17.0": upgrade1_17_0, | ||
"1.18.0": upgrade1_18_0, | ||
"1.20.0": upgrade1_20_0, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters