-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-18495
- Loading branch information
Showing
143 changed files
with
2,594 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
resource_customizations/gateway.solo.io/Gateway/health.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
hs = { | ||
status = "Progressing", | ||
message = "Update in progress" | ||
} | ||
|
||
function getStatus(status) | ||
-- Accepted | ||
if status.state == "Accepted" or status.state == 1 then | ||
hs.status = "Healthy" | ||
hs.message = "The resource has been validated" | ||
return hs | ||
end | ||
|
||
-- Warning | ||
if status.state == "Warning" or status.state == 3 then | ||
hs.status = "Degraded" | ||
hs.message = status.reason | ||
return hs | ||
end | ||
|
||
-- Pending | ||
if status.state == "Pending" or status.state == 0 then | ||
hs.status = "Suspended" | ||
hs.message = "The resource has not yet been validated" | ||
return hs | ||
end | ||
|
||
-- Rejected | ||
if status.state == "Rejected" or status.state == 2 then | ||
hs.status = "Degraded" | ||
hs.message = status.reason | ||
return hs | ||
end | ||
|
||
return hs | ||
end | ||
|
||
if obj.status ~= nil then | ||
-- Namespaced version of status | ||
if obj.status.statuses ~= nil then | ||
for i, namespace in pairs(obj.status.statuses) do | ||
hs = getStatus(namespace) | ||
if hs.status ~= "Progressing" then | ||
return hs | ||
end | ||
end | ||
end | ||
|
||
-- Older non-namespaced version of status | ||
if obj.status.state ~= nil then | ||
hs = getStatus(obj.status) | ||
end | ||
end | ||
return hs |
37 changes: 37 additions & 0 deletions
37
resource_customizations/gateway.solo.io/Gateway/health_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
tests: | ||
- healthStatus: | ||
status: Degraded | ||
message: "message that will describe all the reasons for warning" | ||
inputPath: testdata/gloo-warning.yaml | ||
- healthStatus: | ||
status: Suspended | ||
message: "The resource has not yet been validated" | ||
inputPath: testdata/gloo-pending.yaml | ||
- healthStatus: | ||
status: Healthy | ||
message: "The resource has been validated" | ||
inputPath: testdata/gloo-accepted.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "message that will describe all the reasons for rejection" | ||
inputPath: testdata/gloo-rejected.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "message that will describe all the reasons for warning" | ||
inputPath: testdata/non-namespaced-gloo-warning.yaml | ||
- healthStatus: | ||
status: Suspended | ||
message: "The resource has not yet been validated" | ||
inputPath: testdata/non-namespaced-gloo-pending.yaml | ||
- healthStatus: | ||
status: Healthy | ||
message: "The resource has been validated" | ||
inputPath: testdata/non-namespaced-gloo-accepted.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "message that will describe all the reasons for rejection" | ||
inputPath: testdata/non-namespaced-gloo-rejected.yaml | ||
- healthStatus: | ||
status: Progressing | ||
message: "Update in progress" | ||
inputPath: testdata/gloo-no-status.yaml |
14 changes: 14 additions & 0 deletions
14
resource_customizations/gateway.solo.io/Gateway/testdata/gloo-accepted.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
statuses: | ||
gloo-system: | ||
reportedBy: gateway | ||
state: Accepted | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Accepted | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Accepted |
2 changes: 2 additions & 0 deletions
2
resource_customizations/gateway.solo.io/Gateway/testdata/gloo-no-status.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway |
14 changes: 14 additions & 0 deletions
14
resource_customizations/gateway.solo.io/Gateway/testdata/gloo-pending.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
statuses: | ||
gloo-system: | ||
reportedBy: gateway | ||
state: Pending | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Accepted | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Pending |
15 changes: 15 additions & 0 deletions
15
resource_customizations/gateway.solo.io/Gateway/testdata/gloo-rejected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
statuses: | ||
gloo-system: | ||
reason: "message that will describe all the reasons for rejection" | ||
reportedBy: gateway | ||
state: Rejected | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Accepted | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Rejected |
15 changes: 15 additions & 0 deletions
15
resource_customizations/gateway.solo.io/Gateway/testdata/gloo-warning.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
statuses: | ||
gloo-system: | ||
reason: "message that will describe all the reasons for warning" | ||
reportedBy: gateway | ||
state: Warning | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Accepted | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: Warning |
12 changes: 12 additions & 0 deletions
12
resource_customizations/gateway.solo.io/Gateway/testdata/non-namespaced-gloo-accepted.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
reportedBy: gateway | ||
state: 1 | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 1 | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 1 |
14 changes: 14 additions & 0 deletions
14
resource_customizations/gateway.solo.io/Gateway/testdata/non-namespaced-gloo-pending.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
statuses: | ||
gloo-system: | ||
reportedBy: gateway | ||
state: 0 | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 1 | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 0 |
13 changes: 13 additions & 0 deletions
13
resource_customizations/gateway.solo.io/Gateway/testdata/non-namespaced-gloo-rejected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
reason: "message that will describe all the reasons for rejection" | ||
reportedBy: gateway | ||
state: 2 | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 1 | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 2 |
13 changes: 13 additions & 0 deletions
13
resource_customizations/gateway.solo.io/Gateway/testdata/non-namespaced-gloo-warning.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: gateway.solo.io/v1 | ||
kind: Gateway | ||
status: | ||
reason: "message that will describe all the reasons for warning" | ||
reportedBy: gateway | ||
state: 3 | ||
subresourceStatuses: | ||
'*v1.Proxy.gateway-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 1 | ||
'*v1.Proxy.internal-proxy_gloo-system': | ||
reportedBy: gloo | ||
state: 3 |
Oops, something went wrong.