mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-20 16:14:23 +00:00
Add goci lint. (#243)
* Add goci lint. Signed-off-by: xuezhaojun <zxue@redhat.com> * handle errs and remove unused. Signed-off-by: xuezhaojun <zxue@redhat.com> * fix fail and remove unused code. Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
@@ -38,7 +38,6 @@ const (
|
||||
eventuallyTimeout = 30 // seconds
|
||||
eventuallyInterval = 1 // seconds
|
||||
hubNamespace = "open-cluster-management-hub"
|
||||
spokeNamespace = "open-cluster-management-agent"
|
||||
clusterManagerName = "hub"
|
||||
hubNamespaceHosted = "hub"
|
||||
)
|
||||
|
||||
@@ -98,7 +98,7 @@ var _ = ginkgo.Describe("Klusterlet Hosted mode", func() {
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})
|
||||
gomega.Expect(operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})).To(gomega.BeNil())
|
||||
})
|
||||
|
||||
ginkgo.It("should have expected resource created successfully", func() {
|
||||
|
||||
@@ -112,7 +112,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})
|
||||
gomega.Expect(operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})).To(gomega.BeNil())
|
||||
})
|
||||
|
||||
ginkgo.It("should have expected resource created successfully", func() {
|
||||
@@ -584,7 +584,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
|
||||
workDeploymentName = fmt.Sprintf("%s-work-agent", klusterlet.Name)
|
||||
})
|
||||
ginkgo.AfterEach(func() {
|
||||
operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})
|
||||
gomega.Expect(operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})).To(gomega.BeNil())
|
||||
})
|
||||
ginkgo.It("should have correct degraded conditions", func() {
|
||||
_, err := operatorClient.OperatorV1().Klusterlets().Create(context.Background(), klusterlet, metav1.CreateOptions{})
|
||||
@@ -701,7 +701,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
|
||||
workDeploymentName = fmt.Sprintf("%s-work-agent", klusterlet.Name)
|
||||
})
|
||||
ginkgo.AfterEach(func() {
|
||||
operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})
|
||||
gomega.Expect(operatorClient.OperatorV1().Klusterlets().Delete(context.Background(), klusterlet.Name, metav1.DeleteOptions{})).To(gomega.BeNil())
|
||||
})
|
||||
|
||||
ginkgo.It("should reload the klusterlet after the bootstrap secret is changed", func() {
|
||||
|
||||
@@ -65,12 +65,10 @@ func (r *IntegrationTestEventRecorder) Warningf(reason, messageFmt string, args
|
||||
func (r *IntegrationTestEventRecorder) Shutdown() {}
|
||||
|
||||
func HasCondition(conditions []metav1.Condition, expectedType, expectedReason string, expectedStatus metav1.ConditionStatus) bool {
|
||||
found := false
|
||||
for _, condition := range conditions {
|
||||
if condition.Type != expectedType {
|
||||
continue
|
||||
}
|
||||
found = true
|
||||
|
||||
if condition.Status != expectedStatus {
|
||||
return false
|
||||
@@ -83,7 +81,7 @@ func HasCondition(conditions []metav1.Condition, expectedType, expectedReason st
|
||||
return true
|
||||
}
|
||||
|
||||
return found
|
||||
return false
|
||||
}
|
||||
|
||||
func NewKubeConfig(config *rest.Config) []byte {
|
||||
|
||||
Reference in New Issue
Block a user