-
Notifications
You must be signed in to change notification settings - Fork 462
Pod Events #807
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
Pod Events #807
Conversation
setErrorSnackMessage(err); | ||
}); | ||
}, [tenantNamespace, tenantName, podName, setErrorSnackMessage]); | ||
loadInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the content of loadInfo function inside this effect and remove the // eslint-disable-next-line react-hooks/exhaustive-deps
. I think this change shouldn't go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review this
api | ||
.invoke( | ||
"GET", | ||
`/api/v1/namespaces/${tenantNamespace}/tenants/${tenantName}/pods/${podName}` | ||
) | ||
.then((res: string) => { | ||
setLogLines(res.split("\n")); | ||
}) | ||
.catch((err) => { | ||
setErrorSnackMessage(err); | ||
}); | ||
}, [tenantNamespace, tenantName, podName, setErrorSnackMessage]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the content of loadInfo function inside this effect and remove the // eslint-disable-next-line react-hooks/exhaustive-deps
. I think this change shouldn't go
{" > "} | ||
<Link | ||
to={`/namespaces/${tenantNamespace}/tenants/${tenantName}`} | ||
to={`/namespaces/${match.params["tenantNamespace"]}/tenants/${match.params["tenantName"]}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use tenantNamespace & tenantName variables
className={classes.breadcrumLink} | ||
> | ||
{tenantName} | ||
{match.params["tenantName"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use tenantName var
{match.params["tenantName"]} | ||
</Link> | ||
{` > Pods > ${podName}`} | ||
{` > Pods > ${match.params["podName"]}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use podName var
restapi/admin_tenants.go
Outdated
retval := []*models.TenantPod{} | ||
for _, pod := range pods.Items { | ||
var restarts int64 | ||
var restarts int64 = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check gofmt checks
Can you attach a screenshot of how it looks? |
Can you sort the events in ascending order (older on top, newer at the bottom) and group them? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix all the warnings introduced on PodDetails.tsx
src/screens/Console/Tenants/TenantDetails/PodDetails.tsx
Line 19:8: 'get' is defined but never used @typescript-eslint/no-unused-vars
Line 31:3: 'Button' is defined but never used @typescript-eslint/no-unused-vars
Line 32:3: 'IconButton' is defined but never used @typescript-eslint/no-unused-vars
Line 33:3: 'Menu' is defined but never used @typescript-eslint/no-unused-vars
Line 34:3: 'MenuItem' is defined but never used @typescript-eslint/no-unused-vars
Line 48:8: 'history' is defined but never used @typescript-eslint/no-unused-vars
Line 49:10: 'LogMessage' is defined but never used @typescript-eslint/no-unused-vars
Line 50:10: 'IPolicyItem' is defined but never used @typescript-eslint/no-unused-vars
Line 51:10: 'TabPanel' is defined but never used @typescript-eslint/no-unused-vars
Line 167:10: 'selectedTab' is assigned a value but never used @typescript-eslint/no-unused-vars
Line 167:23: 'setSelectedTab' is assigned a value but never used @typescript-eslint/no-unused-vars
Line 168:19: 'setLoading' is assigned a value but never used @typescript-eslint/no-unused-vars
Line 169:10: 'log' is assigned a value but never used @typescript-eslint/no-unused-vars
While doing
The problem is also present in pod listing, where the age of pods is not aligned with theUI
|
swagger.yml
Outdated
properties: | ||
namespace: | ||
type: string | ||
lastseen: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this to last_seen
Change type to integer
of format: int64
restapi/admin_tenants.go
Outdated
for i := 0; i < len(events.Items); i++ { | ||
retval = append(retval, &models.EventListElement{ | ||
Namespace: events.Items[i].Namespace, | ||
Lastseen: fmt.Sprintf("%d", events.Items[i].LastTimestamp.Unix()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the .Unix()
already returns int64
, store the integer that way
const [selectedServiceAccount, setSelectedServiceAccount] = useState< | ||
string | null | ||
>(null); | ||
const [selectedServiceAccount, setSelectedServiceAccount] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be formatted with prettier 2.3.1
yarn.lock
Outdated
@@ -0,0 +1,4 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file
setErrorSnackMessage(err); | ||
}); | ||
}, [tenantNamespace, tenantName, podName, setErrorSnackMessage]); | ||
loadInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review this
`/api/v1/namespaces/${tenantNamespace}/tenants/${tenantName}/pods/${podName}` | ||
) | ||
.then((res: string) => { | ||
setLog(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove setLog
since log
is not used
setEvent(res); | ||
}) | ||
.catch((err) => { | ||
setErrorSnackMessage(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you remove setErrorSnackMessage
you don't display an error should there be one
consoleAdmin.json
Outdated
@@ -0,0 +1,16 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this file
setErrorSnackMessage, | ||
}: ITenantDetailsProps) => { | ||
const [loading, setLoading] = useState<boolean>(false); | ||
const [log, setLog] = useState<string>(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused lines
{ label: "Event Type", elementKey: "event_type" }, | ||
{ label: "Reason", elementKey: "reason" }, | ||
]} | ||
isLoading={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do show a loading indicator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't delete md files
Uh oh!
There was an error while loading. Please reload this page.