mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
Merge 08f294eeec into e0e827dab0
This commit is contained in:
commit
e59d6052bd
7 changed files with 133 additions and 0 deletions
28
resource_customizations/_.services.k8s.aws/_/health.lua
Normal file
28
resource_customizations/_.services.k8s.aws/_/health.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
local hs = {}
|
||||
|
||||
if obj.status ~= nil and obj.status.conditions ~= nil then
|
||||
for i, condition in ipairs(obj.status.conditions) do
|
||||
|
||||
if condition.type == "ACK.Terminal" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message
|
||||
return hs
|
||||
end
|
||||
|
||||
if condition.type == "Ready" then
|
||||
if condition.status == "False" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = condition.message
|
||||
return hs
|
||||
elseif condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = ""
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for resource to be ready"
|
||||
return hs
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: ""
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: bucket in CREATING state
|
||||
inputPath: testdata/progressing.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: Waiting for resource to be ready
|
||||
inputPath: testdata/progressing_no_conditions.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: Resource already exists
|
||||
inputPath: testdata/degraded.yaml
|
||||
28
resource_customizations/_.services.k8s.aws/_/testdata/degraded.yaml
vendored
Normal file
28
resource_customizations/_.services.k8s.aws/_/testdata/degraded.yaml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
apiVersion: s3.services.k8s.aws/v1alpha1
|
||||
kind: Bucket
|
||||
metadata:
|
||||
name: test-s3-bucket
|
||||
namespace: default
|
||||
spec:
|
||||
name: test-s3-bucket
|
||||
status:
|
||||
ackResourceMetadata:
|
||||
arn: arn:aws:s3:::test-s3-bucket
|
||||
ownerAccountID: "111111111111"
|
||||
region: us-west-2
|
||||
conditions:
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: Resource already exists
|
||||
reason: This resource already exists but is not managed by ACK.
|
||||
status: "True"
|
||||
type: ACK.Terminal
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: Resource not synced
|
||||
reason: resource is in terminal condition
|
||||
status: "False"
|
||||
type: ACK.ResourceSynced
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: Resource already exists
|
||||
reason: ACK.Terminal
|
||||
status: "False"
|
||||
type: Ready
|
||||
24
resource_customizations/_.services.k8s.aws/_/testdata/healthy.yaml
vendored
Normal file
24
resource_customizations/_.services.k8s.aws/_/testdata/healthy.yaml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: s3.services.k8s.aws/v1alpha1
|
||||
kind: Bucket
|
||||
metadata:
|
||||
name: test-s3-bucket
|
||||
namespace: default
|
||||
spec:
|
||||
name: test-s3-bucket
|
||||
status:
|
||||
ackResourceMetadata:
|
||||
arn: arn:aws:s3:::test-s3-bucket
|
||||
ownerAccountID: "111111111111"
|
||||
region: us-west-2
|
||||
conditions:
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: Resource synced successfully
|
||||
reason: ""
|
||||
status: "True"
|
||||
type: ACK.ResourceSynced
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: Resource synced successfully
|
||||
reason: ""
|
||||
status: "True"
|
||||
type: Ready
|
||||
location: http://test-s3-bucket.s3.amazonaws.com/
|
||||
23
resource_customizations/_.services.k8s.aws/_/testdata/progressing.yaml
vendored
Normal file
23
resource_customizations/_.services.k8s.aws/_/testdata/progressing.yaml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: s3.services.k8s.aws/v1alpha1
|
||||
kind: Bucket
|
||||
metadata:
|
||||
name: test-s3-bucket
|
||||
namespace: default
|
||||
spec:
|
||||
name: test-s3-bucket
|
||||
status:
|
||||
ackResourceMetadata:
|
||||
arn: arn:aws:s3:::test-s3-bucket
|
||||
ownerAccountID: "111111111111"
|
||||
region: us-west-2
|
||||
conditions:
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: bucket in CREATING state
|
||||
reason: bucket in CREATING state
|
||||
status: "False"
|
||||
type: ACK.ResourceSynced
|
||||
- lastTransitionTime: "2026-04-15T18:20:17Z"
|
||||
message: bucket in CREATING state
|
||||
reason: bucket in CREATING state
|
||||
status: "False"
|
||||
type: Ready
|
||||
12
resource_customizations/_.services.k8s.aws/_/testdata/progressing_no_conditions.yaml
vendored
Normal file
12
resource_customizations/_.services.k8s.aws/_/testdata/progressing_no_conditions.yaml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: s3.services.k8s.aws/v1alpha1
|
||||
kind: Bucket
|
||||
metadata:
|
||||
name: test-s3-bucket
|
||||
namespace: default
|
||||
spec:
|
||||
name: test-s3-bucket
|
||||
status:
|
||||
ackResourceMetadata:
|
||||
arn: arn:aws:s3:::test-s3-bucket
|
||||
ownerAccountID: "111111111111"
|
||||
region: us-west-2
|
||||
|
|
@ -1078,6 +1078,7 @@ func Test_getHealthScriptPaths(t *testing.T) {
|
|||
assert.Equal(t, []string{
|
||||
"_.cnrm.cloud.google.com/_",
|
||||
"_.crossplane.io/_",
|
||||
"_.services.k8s.aws/_",
|
||||
"_.upbound.io/_",
|
||||
"grafana-org-operator.kubitus-project.gitlab.io/_",
|
||||
}, paths)
|
||||
|
|
|
|||
Loading…
Reference in a new issue