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: add health checks for storage.cnrm.cloud.google.com/StorageBucketAccessControl #10727

Merged
Show file tree
Hide file tree
Changes from 2 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,39 @@
hs = {
status = "Progressing",
message = "Update in progress"
}
if obj.status ~= nil then
if obj.status.conditions ~= nil then
for i, condition in ipairs(obj.status.conditions) do

-- Up To Date
if condition.reason == "UpToDate" and condition.status == "True" then
hs.status = "Healthy"
hs.message = condition.message
return hs
end

-- Update Failed
if condition.reason == "UpdateFailed" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end

-- Dependency Not Found
if condition.reason == "DependencyNotFound" then
hs.status = "Degraded"
hs.message = condition.message
return hs
end

-- Dependency Not Ready
if condition.reason == "DependencyNotReady" then
hs.status = "Suspended"
hs.message = condition.message
return hs
end
end
end
end
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
tests:
- healthStatus:
status: Degraded
message: "Dependency not found"
inputPath: testdata/dependency_not_found.yaml
- healthStatus:
status: Suspended
message: "Dependency not ready"
inputPath: testdata/dependency_not_ready.yaml
- healthStatus:
status: Healthy
message: "The resource is up to date"
inputPath: testdata/up_to_date.yaml
- healthStatus:
status: Degraded
message: "Update failed"
inputPath: testdata/update_failed.yaml
- healthStatus:
status: Progressing
message: "Update in progress"
inputPath: testdata/update_in_progress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucketAccessControl
status:
conditions:
- lastTransitionTime: '2022-07-01T12:56:21Z'
message: Dependency not found
reason: DependencyNotFound
status: 'False'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucketAccessControl
status:
conditions:
- lastTransitionTime: '2022-07-01T12:56:21Z'
message: Dependency not ready
reason: DependencyNotReady
status: 'False'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucketAccessControl
status:
conditions:
- lastTransitionTime: '2022-05-09T08:49:18Z'
message: The resource is up to date
reason: UpToDate
status: 'True'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucketAccessControl
status:
conditions:
- lastTransitionTime: '2022-07-01T12:56:21Z'
message: Update failed
reason: UpdateFailed
status: 'False'
type: Ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucketAccessControl
status:
conditions:
- lastTransitionTime: '2022-07-01T12:56:21Z'
message: Update in progress
reason: Updating
status: 'False'
type: Ready
14 changes: 11 additions & 3 deletions ui/src/app/settings/components/repos-list/repos-list.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AutocompleteField, DropDownMenu, FormField, FormSelect, HelpIcon, NotificationType, SlidingPanel} from 'argo-ui';
import {AutocompleteField, DropDownMenu, FormField, FormSelect, HelpIcon, NotificationType, SlidingPanel, Tooltip} from 'argo-ui';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import {Form, FormValues, FormApi, Text, TextArea, FormErrors} from 'react-form';
Expand Down Expand Up @@ -266,9 +266,17 @@ export class ReposList extends React.Component<
<i className={'icon argo-icon-' + (repo.type || 'git')} />
</div>
<div className='columns small-1'>{repo.type || 'git'}</div>
<div className='columns small-2'>{repo.name}</div>
<div className='columns small-2'>
<Tooltip content={repo.name}>
<span>{repo.name}</span>
</Tooltip>
</div>
vgelot marked this conversation as resolved.
Show resolved Hide resolved
<div className='columns small-5'>
<Repo url={repo.repo} />
<Tooltip content={repo.repo}>
<span>
<Repo url={repo.repo} />
</span>
</Tooltip>
</div>
<div className='columns small-3'>
<ConnectionStateIcon state={repo.connectionState} /> {repo.connectionState.status}
Expand Down