Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support health check on ClusterIssuer #12000

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
hs = {}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do
if condition.type == "Ready" and condition.status == "False" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
if condition.type == "Ready" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end
end
end
end

hs.status = "Progressing"
hs.message = "Initializing ClusterIssuer"
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tests:
- healthStatus:
status: Progressing
message: Initializing ClusterIssuer
inputPath: testdata/progressing_noStatus.yaml
- healthStatus:
status: Healthy
message: The ACME account was registered with the ACME server
inputPath: testdata/healthy_registered.yaml
- healthStatus:
status: Degraded
message: "Failed to verify ACME account: acme: : 404 page not found\n"
inputPath: testdata/degraded_acmeFailed.yaml

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
creationTimestamp: "2019-02-15T19:23:48Z"
generation: 1
name: test-issuer
resourceVersion: "68352438"
uid: 37f408e3-3157-11e9-be3f-42010a800011
spec:
acme:
email: myemail@test.com
http01: {}
privateKeySecretRef:
key: ""
name: letsencrypt
server: https://acme-v02.api.letsencrypt.org/directory124
status:
acme:
uri: ""
conditions:
- lastTransitionTime: "2019-02-15T19:23:53Z"
message: |
Failed to verify ACME account: acme: : 404 page not found
reason: ErrRegisterACMEAccount
status: "False"
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
creationTimestamp: "2018-11-06T23:14:18Z"
generation: 1
name: test-issuer
resourceVersion: "48889060"
uid: b0045219-e219-11e8-9f93-42010a80021d
spec:
acme:
email: myemail@test.com
http01: {}
privateKeySecretRef:
key: ""
name: letsencrypt
server: https://acme-v02.api.letsencrypt.org/directory
status:
acme:
uri: https://acme-v02.api.letsencrypt.org/acme/acct/45250083
conditions:
- lastTransitionTime: "2018-12-06T06:42:59Z"
message: The ACME account was registered with the ACME server
reason: ACMEAccountRegistered
status: "True"
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
creationTimestamp: "2018-11-06T23:14:18Z"
generation: 1
name: test-issuer
resourceVersion: "48889060"
uid: b0045219-e219-11e8-9f93-42010a80021d
spec:
acme:
email: myemail@test.com
http01: {}
privateKeySecretRef:
key: ""
name: letsencrypt
server: https://acme-v02.api.letsencrypt.org/directory