-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test tries to decode the Ingress as a networking.k8s.io/v1 Ingress object, and panics if the apiVersion is wrong.
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package builtin | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/projectsyn/component-keycloak/common" | ||
) | ||
|
||
|
||
func Test_IngressApiVersion(t *testing.T) { | ||
common.IngressApiVersionTest(t, testPath) | ||
} |
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,19 @@ | ||
package common | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
networkingv1 "k8s.io/api/networking/v1" | ||
) | ||
|
||
var ( | ||
ingressPath = "/01_keycloak_helmchart/keycloak/templates/ingress.yaml" | ||
) | ||
|
||
func IngressApiVersionTest(t *testing.T, basepath string) { | ||
subject := &networkingv1.Ingress{} | ||
scheme := NewSchemeWithDefault(t) | ||
ingress := DecodeWithSchema(t, basepath+ingressPath, subject,scheme).(*networkingv1.Ingress) | ||
assert.Equal(t, "keycloak", ingress.Name) | ||
} |
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,12 @@ | ||
package external | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/projectsyn/component-keycloak/common" | ||
) | ||
|
||
|
||
func Test_IngressApiVersion(t *testing.T) { | ||
common.IngressApiVersionTest(t, testPath) | ||
} |