Skip to content

Commit

Permalink
Fix reverting ingress security to oauth-proxy on openshift if set to …
Browse files Browse the repository at this point in the history
…none (#301)

* Fix reverting ingress security to oauth-proxy on openshift if set to none

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* remove junk

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix tests

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay authored Mar 12, 2019
1 parent f128fa3 commit c55de17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/strategy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func normalize(jaeger *v1.Jaeger) {
// cases:
// - omitted on Kubernetes
// - 'none' on any platform
jaeger.Spec.Ingress.Security = v1.IngressSecurityNone
jaeger.Spec.Ingress.Security = v1.IngressSecurityNoneExplicit
}

normalizeSparkDependencies(&jaeger.Spec.Storage.SparkDependencies, jaeger.Spec.Storage.Type)
Expand Down
8 changes: 4 additions & 4 deletions pkg/strategy/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ func TestStorageMemoryOnlyUsedWithAllInOneStrategy(t *testing.T) {
func TestSetSecurityToNoneByDefault(t *testing.T) {
jaeger := v1.NewJaeger("TestSetSecurityToNoneByDefault")
normalize(jaeger)
assert.Equal(t, v1.IngressSecurityNone, jaeger.Spec.Ingress.Security)
assert.Equal(t, v1.IngressSecurityNoneExplicit, jaeger.Spec.Ingress.Security)
}

func TestSetSecurityToNoneWhenExplicitSettingToNone(t *testing.T) {
jaeger := v1.NewJaeger("TestSetSecurityToNoneWhenExplicitSettingToNone")
jaeger.Spec.Ingress.Security = v1.IngressSecurityNoneExplicit
normalize(jaeger)
assert.Equal(t, v1.IngressSecurityNone, jaeger.Spec.Ingress.Security)
assert.Equal(t, v1.IngressSecurityNoneExplicit, jaeger.Spec.Ingress.Security)
}

func TestSetSecurityToOAuthProxyByDefaultOnOpenShift(t *testing.T) {
Expand All @@ -148,7 +148,7 @@ func TestSetSecurityToNoneOnNonOpenShift(t *testing.T) {

normalize(jaeger)

assert.Equal(t, v1.IngressSecurityNone, jaeger.Spec.Ingress.Security)
assert.Equal(t, v1.IngressSecurityNoneExplicit, jaeger.Spec.Ingress.Security)
}

func TestAcceptExplicitValueFromSecurityWhenOnOpenShift(t *testing.T) {
Expand All @@ -160,7 +160,7 @@ func TestAcceptExplicitValueFromSecurityWhenOnOpenShift(t *testing.T) {

normalize(jaeger)

assert.Equal(t, v1.IngressSecurityNone, jaeger.Spec.Ingress.Security)
assert.Equal(t, v1.IngressSecurityNoneExplicit, jaeger.Spec.Ingress.Security)
}

func TestNormalizeIndexCleaner(t *testing.T) {
Expand Down

0 comments on commit c55de17

Please sign in to comment.