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

fix: install application module #1621

Merged
merged 9 commits into from
Oct 9, 2021
Merged
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