Skip to content

Commit 5101024

Browse files
authored
fix: cleanup (#401)
1 parent 22225a4 commit 5101024

File tree

5 files changed

+8
-23
lines changed

5 files changed

+8
-23
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ spec:
108108

109109
The following types are supported:
110110
* `Async` - The default, does not await reponses from upstream and immeadiately acknowledges incoming requests with a `HTTP 202 Accepted`.
111-
* `AwaitAllPreferSuccessful` - Await all upstream responses and send back the first successful repsonse (>= 200 && < 400). If all of them are not successful it will send back the first error response.
112-
* `AwaitAllPreferFailed` - Await all upstream responses and send back the first failed repsonse (< 200 && >= 400). If all of them are successful it will send back the first sucessful response.
111+
* `AwaitAllPreferSuccessful` - Await all upstream responses and send back the first successful repsonse (>= 200 && < 400). If all of them are not successful it will send back the last failed response.
112+
* `AwaitAllPreferFailed` - Await all upstream responses and send back the first failed repsonse (< 200 && >= 400). If all of them are successful it will send back the last sucessful response.
113113
* `AwaitAllReport` - Await all upstream responses and send back a json object containing all target responses including status code, body and headers. The status code of this type will always be `HTTP 200 OK`.
114114

115115
### Path rewrite

api/v1beta1/receiver_types.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ type ResourceReference struct {
104104
}
105105

106106
const (
107-
ReadyCondition = "Ready"
108-
ServicePortNotFoundReason = "ServicePortNotFound"
109-
ServiceNotFoundReason = "ServiceNotFound"
107+
ConditionReady = "Ready"
110108
ServiceBackendReadyReason = "ServiceBackendReady"
111109
)
112110

@@ -132,13 +130,13 @@ func setResourceCondition(resource conditionalResource, condition string, status
132130

133131
// ReceiverNotReady
134132
func ReceiverNotReady(clone Receiver, reason, message string) Receiver {
135-
setResourceCondition(&clone, ReadyCondition, metav1.ConditionFalse, reason, message)
133+
setResourceCondition(&clone, ConditionReady, metav1.ConditionFalse, reason, message)
136134
return clone
137135
}
138136

139137
// ReceiverReady
140138
func ReceiverReady(clone Receiver, reason, message string) Receiver {
141-
setResourceCondition(&clone, ReadyCondition, metav1.ConditionTrue, reason, message)
139+
setResourceCondition(&clone, ConditionReady, metav1.ConditionTrue, reason, message)
142140
return clone
143141
}
144142

config/base/rbac/cluster_admin_rolebinding.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

config/base/rbac/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ resources:
55
- role_binding.yaml
66
- leader_election_role.yaml
77
- leader_election_role_binding.yaml
8-
- cluster_admin_rolebinding.yaml

internal/controllers/receiver_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var _ = Describe("Receiver controller", func() {
8686
ObservedGeneration: 1,
8787
Conditions: []metav1.Condition{
8888
{
89-
Type: v1beta1.ReadyCondition,
89+
Type: v1beta1.ConditionReady,
9090
Status: metav1.ConditionFalse,
9191
Reason: "ServiceBackendReady",
9292
Message: "no targets found",
@@ -142,7 +142,7 @@ var _ = Describe("Receiver controller", func() {
142142
ObservedGeneration: 1,
143143
Conditions: []metav1.Condition{
144144
{
145-
Type: v1beta1.ReadyCondition,
145+
Type: v1beta1.ConditionReady,
146146
Status: metav1.ConditionFalse,
147147
Reason: "ServiceBackendReady",
148148
Message: "no targets found",
@@ -181,7 +181,7 @@ var _ = Describe("Receiver controller", func() {
181181
ObservedGeneration: 1,
182182
Conditions: []metav1.Condition{
183183
{
184-
Type: v1beta1.ReadyCondition,
184+
Type: v1beta1.ConditionReady,
185185
Status: metav1.ConditionTrue,
186186
Reason: "ServiceBackendReady",
187187
Message: "receiver successfully registered",

0 commit comments

Comments
 (0)