1
- //go:build ignore
2
-
3
1
package assertions
4
2
5
3
import (
@@ -10,8 +8,9 @@ import (
10
8
"github.com/onsi/ginkgo/v2"
11
9
"github.com/onsi/gomega"
12
10
"github.com/onsi/gomega/gstruct"
13
- errors "github.com/rotisserie/eris"
14
- "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
11
+
12
+ // errors "github.com/rotisserie/eris"
13
+ // "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
15
14
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16
15
"k8s.io/apimachinery/pkg/types"
17
16
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
@@ -21,92 +20,92 @@ import (
21
20
"github.com/kgateway-dev/kgateway/v2/test/helpers"
22
21
)
23
22
24
- // Checks GetNamespacedStatuses status for gloo installation namespace
25
- func (p * Provider ) EventuallyResourceStatusMatchesWarningReasons (getter helpers.InputResourceGetter , desiredStatusReasons []string , desiredReporter string , timeout ... time.Duration ) {
26
- ginkgo .GinkgoHelper ()
23
+ // // Checks GetNamespacedStatuses status for gloo installation namespace
24
+ // func (p *Provider) EventuallyResourceStatusMatchesWarningReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
25
+ // ginkgo.GinkgoHelper()
27
26
28
- currentTimeout , pollingInterval := helpers .GetTimeouts (timeout ... )
29
- gomega .Eventually (func (g gomega.Gomega ) {
30
- statusWarningsMatcher := matchers .MatchStatusInNamespace (
31
- p .installContext .InstallNamespace ,
32
- gomega .And (matchers .HaveWarningStateWithReasonSubstrings (desiredStatusReasons ... ), matchers .HaveReportedBy (desiredReporter )),
33
- )
27
+ // currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
28
+ // gomega.Eventually(func(g gomega.Gomega) {
29
+ // statusWarningsMatcher := matchers.MatchStatusInNamespace(
30
+ // p.installContext.InstallNamespace,
31
+ // gomega.And(matchers.HaveWarningStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
32
+ // )
34
33
35
- status , err := getResourceNamespacedStatus (getter )
36
- g .Expect (err ).NotTo (gomega .HaveOccurred (), "failed to get resource namespaced status" )
37
- g .Expect (status ).ToNot (gomega .BeNil ())
38
- g .Expect (status ).To (gomega .HaveValue (statusWarningsMatcher ))
39
- }, currentTimeout , pollingInterval ).Should (gomega .Succeed ())
40
- }
34
+ // status, err := getResourceNamespacedStatus(getter)
35
+ // g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
36
+ // g.Expect(status).ToNot(gomega.BeNil())
37
+ // g.Expect(status).To(gomega.HaveValue(statusWarningsMatcher))
38
+ // }, currentTimeout, pollingInterval).Should(gomega.Succeed())
39
+ // }
41
40
42
- func (p * Provider ) EventuallyResourceStatusMatchesRejectedReasons (getter helpers.InputResourceGetter , desiredStatusReasons []string , desiredReporter string , timeout ... time.Duration ) {
43
- ginkgo .GinkgoHelper ()
41
+ // func (p *Provider) EventuallyResourceStatusMatchesRejectedReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
42
+ // ginkgo.GinkgoHelper()
44
43
45
- currentTimeout , pollingInterval := helpers .GetTimeouts (timeout ... )
46
- gomega .Eventually (func (g gomega.Gomega ) {
47
- statusRejectionsMatcher := matchers .MatchStatusInNamespace (
48
- p .installContext .InstallNamespace ,
49
- gomega .And (matchers .HaveRejectedStateWithReasonSubstrings (desiredStatusReasons ... ), matchers .HaveReportedBy (desiredReporter )),
50
- )
44
+ // currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
45
+ // gomega.Eventually(func(g gomega.Gomega) {
46
+ // statusRejectionsMatcher := matchers.MatchStatusInNamespace(
47
+ // p.installContext.InstallNamespace,
48
+ // gomega.And(matchers.HaveRejectedStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
49
+ // )
51
50
52
- status , err := getResourceNamespacedStatus (getter )
53
- g .Expect (err ).NotTo (gomega .HaveOccurred (), "failed to get resource namespaced status" )
54
- g .Expect (status ).ToNot (gomega .BeNil ())
55
- g .Expect (status ).To (gomega .HaveValue (statusRejectionsMatcher ))
56
- }, currentTimeout , pollingInterval ).Should (gomega .Succeed ())
57
- }
51
+ // status, err := getResourceNamespacedStatus(getter)
52
+ // g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
53
+ // g.Expect(status).ToNot(gomega.BeNil())
54
+ // g.Expect(status).To(gomega.HaveValue(statusRejectionsMatcher))
55
+ // }, currentTimeout, pollingInterval).Should(gomega.Succeed())
56
+ // }
58
57
59
- func (p * Provider ) EventuallyResourceStatusMatchesState (
60
- getter helpers.InputResourceGetter ,
61
- desiredState core.Status_State ,
62
- desiredReporter string ,
63
- timeout ... time.Duration ,
64
- ) {
65
- currentTimeout , pollingInterval := helpers .GetTimeouts (timeout ... )
66
- p .Gomega .Eventually (func (g gomega.Gomega ) {
67
- statusStateMatcher := matchers .MatchStatusInNamespace (
68
- p .installContext .InstallNamespace ,
69
- gomega .And (matchers .HaveState (desiredState ), matchers .HaveReportedBy (desiredReporter )),
70
- )
71
- status , err := getResourceNamespacedStatus (getter )
72
- g .Expect (err ).NotTo (gomega .HaveOccurred (), "failed to get resource namespaced status" )
73
- g .Expect (status ).ToNot (gomega .BeNil ())
74
- g .Expect (status ).To (gomega .HaveValue (statusStateMatcher ))
75
- }, currentTimeout , pollingInterval ).Should (gomega .Succeed ())
76
- }
58
+ // func (p *Provider) EventuallyResourceStatusMatchesState(
59
+ // getter helpers.InputResourceGetter,
60
+ // desiredState core.Status_State,
61
+ // desiredReporter string,
62
+ // timeout ...time.Duration,
63
+ // ) {
64
+ // currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
65
+ // p.Gomega.Eventually(func(g gomega.Gomega) {
66
+ // statusStateMatcher := matchers.MatchStatusInNamespace(
67
+ // p.installContext.InstallNamespace,
68
+ // gomega.And(matchers.HaveState(desiredState), matchers.HaveReportedBy(desiredReporter)),
69
+ // )
70
+ // status, err := getResourceNamespacedStatus(getter)
71
+ // g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
72
+ // g.Expect(status).ToNot(gomega.BeNil())
73
+ // g.Expect(status).To(gomega.HaveValue(statusStateMatcher))
74
+ // }, currentTimeout, pollingInterval).Should(gomega.Succeed())
75
+ // }
77
76
78
- func (p * Provider ) EventuallyResourceStatusMatchesSubResource (
79
- getter helpers.InputResourceGetter ,
80
- desiredSubresourceName string ,
81
- desiredSubresource matchers.SoloKitSubresourceStatus ,
82
- timeout ... time.Duration ,
83
- ) {
84
- currentTimeout , pollingInterval := helpers .GetTimeouts (timeout ... )
85
- p .Gomega .Eventually (func (g gomega.Gomega ) {
86
- subResourceStatusMatcher := matchers .HaveSubResourceStatusState (desiredSubresourceName , desiredSubresource )
87
- status , err := getResourceNamespacedStatus (getter )
88
- g .Expect (err ).NotTo (gomega .HaveOccurred (), "failed to get resource namespaced status" )
89
- g .Expect (status ).ToNot (gomega .BeNil ())
90
- g .Expect (status ).To (gomega .HaveValue (subResourceStatusMatcher ))
91
- }, currentTimeout , pollingInterval ).Should (gomega .Succeed ())
92
- }
77
+ // func (p *Provider) EventuallyResourceStatusMatchesSubResource(
78
+ // getter helpers.InputResourceGetter,
79
+ // desiredSubresourceName string,
80
+ // desiredSubresource matchers.SoloKitSubresourceStatus,
81
+ // timeout ...time.Duration,
82
+ // ) {
83
+ // currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
84
+ // p.Gomega.Eventually(func(g gomega.Gomega) {
85
+ // subResourceStatusMatcher := matchers.HaveSubResourceStatusState(desiredSubresourceName, desiredSubresource)
86
+ // status, err := getResourceNamespacedStatus(getter)
87
+ // g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
88
+ // g.Expect(status).ToNot(gomega.BeNil())
89
+ // g.Expect(status).To(gomega.HaveValue(subResourceStatusMatcher))
90
+ // }, currentTimeout, pollingInterval).Should(gomega.Succeed())
91
+ // }
93
92
94
- func getResourceNamespacedStatus (getter helpers.InputResourceGetter ) (* core.NamespacedStatuses , error ) {
95
- resource , err := getter ()
96
- if err != nil {
97
- return & core.NamespacedStatuses {}, errors .Wrapf (err , "failed to get resource" )
98
- }
93
+ // func getResourceNamespacedStatus(getter helpers.InputResourceGetter) (*core.NamespacedStatuses, error) {
94
+ // resource, err := getter()
95
+ // if err != nil {
96
+ // return &core.NamespacedStatuses{}, errors.Wrapf(err, "failed to get resource")
97
+ // }
99
98
100
- namespacedStatuses := resource .GetNamespacedStatuses ()
99
+ // namespacedStatuses := resource.GetNamespacedStatuses()
101
100
102
- // In newer versions of Gloo Edge we provide a default "empty" status, which allows us to patch it to perform updates
103
- // As a result, a nil check isn't enough to determine that that status hasn't been reported
104
- if namespacedStatuses == nil || namespacedStatuses .GetStatuses () == nil {
105
- return & core.NamespacedStatuses {}, errors .Wrapf (err , "waiting for %v status to be non-empty" , resource .GetMetadata ().GetName ())
106
- }
101
+ // // In newer versions of Gloo Edge we provide a default "empty" status, which allows us to patch it to perform updates
102
+ // // As a result, a nil check isn't enough to determine that that status hasn't been reported
103
+ // if namespacedStatuses == nil || namespacedStatuses.GetStatuses() == nil {
104
+ // return &core.NamespacedStatuses{}, errors.Wrapf(err, "waiting for %v status to be non-empty", resource.GetMetadata().GetName())
105
+ // }
107
106
108
- return namespacedStatuses , nil
109
- }
107
+ // return namespacedStatuses, nil
108
+ // }
110
109
111
110
// EventuallyHTTPRouteStatusContainsMessage asserts that eventually at least one of the HTTPRoute's route parent statuses contains
112
111
// the given message substring.
@@ -142,7 +141,8 @@ func (p *Provider) EventuallyHTTPRouteStatusContainsReason(
142
141
routeName string ,
143
142
routeNamespace string ,
144
143
reason string ,
145
- timeout ... time.Duration ) {
144
+ timeout ... time.Duration ,
145
+ ) {
146
146
currentTimeout , pollingInterval := helpers .GetTimeouts (timeout ... )
147
147
p .Gomega .Eventually (func (g gomega.Gomega ) {
148
148
matcher := matchers .HaveKubeGatewayRouteStatus (& matchers.KubeGatewayRouteStatus {
0 commit comments