Skip to content

Commit

Permalink
Fixes the multicluster e2e test (istio#13246)
Browse files Browse the repository at this point in the history
The secret was being created after the apps where
deployed on the remote.  This was causes the test
to never think the apps successfully deployed since
the envoy sidecar was continually restarting.
  • Loading branch information
john-a-joyce authored and istio-testing committed Apr 12, 2019
1 parent 2c197ec commit c42f380
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
16 changes: 15 additions & 1 deletion tests/e2e/framework/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,16 @@ func (k *KubeInfo) Teardown() error {
}

if *clusterWide {
istioYaml := getClusterWideInstallFile()
var istioYaml string
if *multiClusterDir != "" {
if *authEnable {
istioYaml = mcAuthInstallFileNamespace
} else {
istioYaml = mcNonAuthInstallFileNamespace
}
} else {
istioYaml = getClusterWideInstallFile()
}

testIstioYaml := filepath.Join(k.TmpDir, "yaml", istioYaml)

Expand Down Expand Up @@ -725,6 +734,11 @@ func (k *KubeInfo) deployIstio() error {
log.Errorf("Remote Istio %s deployment failed", testIstioYaml)
return err
}
if err := util.CreateMultiClusterSecret(k.Namespace, k.RemoteKubeConfig, k.KubeConfig); err != nil {
log.Errorf("Unable to create remote cluster secret on local cluster %s", err.Error())
return err
}
time.Sleep(10 * time.Second)
}

if *useAutomaticInjection {
Expand Down
19 changes: 4 additions & 15 deletions tests/e2e/tests/pilot/mesh_config_verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,8 @@ func createAndVerifyMCMeshConfig() error {
return err
}

// Verify that the mesh contains endpoints from the primary cluster only
log.Infof("Before adding remote cluster secret, verify that the mesh only contains endpoints from the primary cluster only")
if err = verifyMCMeshConfig(primaryPodNames, remotePodNames, primaryAppEPs); err != nil {
return err
}

// Add the remote cluster by creating a secret and configmap in the primary cluster
if err = addRemoteCluster(); err != nil {
return err
}

// Verify that the mesh contains endpoints from both the primary and the remote clusters
log.Infof("After adding remote cluster secret, verify that the mesh contains endpoints from both the primary and the remote clusters")
log.Infof("Verify that the mesh contains endpoints from both the primary and the remote clusters")
aggregatedAppEPs := aggregateAppEPs(primaryAppEPs, remoteAppEPs)

if err = verifyMCMeshConfig(primaryPodNames, remotePodNames, aggregatedAppEPs); err != nil {
Expand All @@ -143,13 +132,13 @@ func createAndVerifyMCMeshConfig() error {
return err
}

log.Infof("After deleting remote cluster secret, verify again that the mesh contains endpoints from the primary cluster only")
// Verify that the mesh contains the primary endpoints only
// Verify that the mesh contains endpoints from the primary cluster only
log.Infof("After deleting remote cluster secret, verify that the mesh only contains endpoints from the primary cluster only")
if err = verifyMCMeshConfig(primaryPodNames, remotePodNames, primaryAppEPs); err != nil {
return err
}

// Again, add the remote cluster by creating a secret and configmap in the primary cluster
// Add back the remote cluster by creating a secret and configmap in the primary cluster
if err = addRemoteCluster(); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion tests/util/kube_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ func CreateMultiClusterSecret(namespace string, remoteKubeConfig string, localKu
return err
}

log.Infof("Secret %s labelled with %s=%s\n", secretName, secretLabel, labelValue)
log.Infof("Secret %s labeled with %s=%s\n", secretName, secretLabel, labelValue)
return nil
}

Expand Down

0 comments on commit c42f380

Please sign in to comment.