Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
fix e2e issue for providerServiceAccount Name
Browse files Browse the repository at this point in the history
  • Loading branch information
liu4480 committed Dec 1, 2022
1 parent 48d68fd commit d7c47aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addons/controllers/antreaconfig_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var _ = Describe("AntreaConfig Reconciler and Webhooks", func() {
antreaTemplateConfigManifestsTestFile1 = "testdata/antrea-test-template-config-1.yaml"
antreaTestCluster1 = "test-cluster-4"
antreaTestCluster2 = "test-cluster-5"
vsphereCluster1 = "test-cluster-5-6gvvc"
)

JustBeforeEach(func() {
Expand Down Expand Up @@ -331,12 +332,12 @@ var _ = Describe("AntreaConfig Reconciler and Webhooks", func() {
Eventually(func() bool {
serviceAccountKey := client.ObjectKey{
Namespace: defaultString,
Name: fmt.Sprintf("%s-antrea", clusterName),
Name: fmt.Sprintf("%s-antrea", vsphereCluster1),
}
if err := k8sClient.Get(ctx, serviceAccountKey, serviceAccount); err != nil {
return false
}
Expect(serviceAccount.Spec.Ref.Name).To(Equal(clusterName))
Expect(serviceAccount.Spec.Ref.Name).To(Equal(vsphereCluster1))
Expect(serviceAccount.Spec.Ref.Namespace).To(Equal(serviceAccountKey.Namespace))
Expect(serviceAccount.Spec.Rules).To(HaveLen(2))
Expect(serviceAccount.Spec.TargetNamespace).To(Equal("vmware-system-antrea"))
Expand Down
13 changes: 13 additions & 0 deletions addons/controllers/testdata/antrea-test-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ spec:
class: test-clusterclass-tcbt
version: v1.22.2
---
apiVersion: vmware.infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereCluster
metadata:
labels:
cluster.x-k8s.io/cluster-name: test-cluster-5
topology.cluster.x-k8s.io/owned: ""
name: test-cluster-5-6gvvc
namespace: default
spec:
controlPlaneEndpoint:
host: 192.168.123.3
port: 6443
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerCluster
metadata:
Expand Down

0 comments on commit d7c47aa

Please sign in to comment.