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

OnePasswordItem Health Check #10690

Merged
merged 1 commit into from
Sep 30, 2022
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.
Jump to
Jump to file
Failed to load files.
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 == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end
if condition.type == "Ready" and condition.status == "False" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end
end
end
end

hs.status = "Progressing"
hs.message = "Waiting for controller to report status"
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests:
- healthStatus:
status: Progressing
message: Waiting for controller to report status
inputPath: testdata/new.yaml
- healthStatus:
status: Degraded
message: Error
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
inputPath: testdata/healthy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: degraded-item
namespace: test-namespace
spec:
itemPath: vaults/Test Vault/items/Test Item
status:
conditions:
- lastTransitionTime: '2022-09-24T01:11:54Z'
message: Error
status: 'False'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: healthy-item
namespace: test-namespace
spec:
itemPath: vaults/Test Vault/items/Test Item
status:
conditions:
- lastTransitionTime: '2022-09-24T01:11:54Z'
status: 'True'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: new-item
namespace: test-namespace
spec:
itemPath: vaults/Test Vault/items/Test Item