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

Adjust application-operator for mtls #3666

Merged
merged 3 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ spec:
- name: MOCK_SERVICE_PORT
value: "8080"
restartPolicy: Never
---
apiVersion: "networking.istio.io/v1alpha3"
kind: "DestinationRule"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest moving it to separate file.

metadata:
name: {{.Release.Name }}-mtls-disable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that this is a proper name as the DestinationRule is set for mock service, not for the {{.Release.Name }} itself.

spec:
host: {{.Release.Name }}-gateway-test-mock-service.{{ .Release.Namespace }}.svc.cluster.local
trafficPolicy:
tls:
mode: DISABLE
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ metadata:
name: test-{{.Release.Name }}-event-service-acceptance
annotations:
helm.sh/hook: test-success
sidecar.istio.io/inject: "false"
sidecar.istio.io/inject: "true"
labels:
helm-chart-test: "true"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
shareProcessNamespace: true
containers:
- name: test-{{.Release.Name }}-event-service-acceptance
image: {{ .Values.global.eventServiceTestsImage }}
command: ["/bin/sh"]
args: ["-c", "sleep 10; ./entrypoint.sh; exit_code=$?; pkill -INT pilot-agent; sleep 4; exit $exit_code;"]
imagePullPolicy: {{ .Values.acceptanceTest.image.pullPolicy }}
env:
- name: EVENT_SERVICE_URL
Expand Down
13 changes: 11 additions & 2 deletions tests/application-operator-tests/test/application/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"k8s.io/apimachinery/pkg/labels"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"

"github.com/kyma-project/kyma/tests/application-operator-tests/test/testkit"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -147,7 +147,16 @@ func (ts *TestSuite) getLogsAndCleanup(t *testing.T) {
}

func (ts *TestSuite) getPodLogs(t *testing.T, pod v1.Pod) {
req := ts.k8sClient.GetLogs(pod.Name, &v1.PodLogOptions{})

var testContainer string
for _, c := range pod.Spec.Containers {
if strings.HasPrefix(c.Name, "test-operator-app-test") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one of the tests pods has such prefix, and it is not really clear. I would suggest changing container name in event-service test pod and use Application name as a prefix.

testContainer = c.Name
}
}
req := ts.k8sClient.GetLogs(pod.Name, &v1.PodLogOptions{
Container: testContainer,
})

reader, err := req.Stream()
require.NoError(t, err)
Expand Down