Skip to content

Commit

Permalink
fix: install application module (#1621)
Browse files Browse the repository at this point in the history
* feat: add case and ut workflow

* feat: add case and ut workflow

* feat: add case and ut workflow

* feat: add case and ut workflow

* fix: install application module

* fix: install application module

Co-authored-by: jiayongfei <yongfeijia@tencent.com>
  • Loading branch information
JiaYongfei and jiayongfei committed Oct 9, 2021
1 parent 22040a7 commit dff53c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
30 changes: 26 additions & 4 deletions test/e2e_installer/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ package cluster_test

import (
"context"
"fmt"
"k8s.io/klog"
"os"
"time"
v1 "tkestack.io/tke/api/application/v1"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -208,9 +211,28 @@ var _ = Describe("cluster", func() {
Expect(err).To(BeNil(), "Create cluster failed")

By("验证bootstrap app已创建")
_, err = testTKE.TkeClient.ApplicationV1().Apps("kube-system").Get(context.Background(), "bootstrapapp-kube-system-demo1", metav1.GetOptions{})
Ω(err).Should(BeNil())
_, err = testTKE.TkeClient.ApplicationV1().Apps("kube-public").Get(context.Background(), "bootstrapapp-kube-public-demo2", metav1.GetOptions{})
Ω(err).Should(BeNil())
verifyApp := func(namespace, appName string) error {
apps, err := testTKE.TkeClient.ApplicationV1().Apps(namespace).List(context.Background(), metav1.ListOptions{})
if err != nil {
return fmt.Errorf("list apps in namespace %v failed", namespace)
}
klog.Infof("Apps in %v: %v", namespace, len(apps.Items))
for _, app := range apps.Items {
klog.Info(app.Name)
}
appFullName := fmt.Sprintf("bootstrapapp-%v-%v", namespace, appName)
_, err = testTKE.TkeClient.ApplicationV1().Apps(namespace).Get(context.Background(), appFullName, metav1.GetOptions{})
if err != nil {
err = fmt.Errorf("get app %v failed", appFullName)
}
return err
}
Eventually(func() error {
err = verifyApp("kube-system", "demo1")
if err != nil {
return err
}
return verifyApp("kube-public", "demo2")
}, time.Minute, time.Second).Should(BeNil())
})
})
3 changes: 3 additions & 0 deletions test/tke/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func (installer *Installer) CreateClusterParaTemplate(nodes []cloudprovider.Inst
SelfSignedCert: &types.SelfSignedCert{},
},
},
Application: &types.Application{
RegistryDomain: "registry.tke.com",
},
}
return para
}
Expand Down

0 comments on commit dff53c7

Please sign in to comment.