Skip to content

Commit

Permalink
Merge main into workflow-layout-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
septum committed Nov 6, 2024
2 parents 8693a13 + f646ee2 commit ed00a3e
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 51 deletions.
11 changes: 11 additions & 0 deletions backend/service/k8s/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,22 @@ func getPodStatus(pod *corev1.Pod) string {
reason = pod.Status.Reason
}

nativeSidecarContainer := make(map[string]bool)
for _, container := range pod.Spec.InitContainers {
// https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/
if container.RestartPolicy != nil && *container.RestartPolicy == corev1.ContainerRestartPolicyAlways {
nativeSidecarContainer[container.Name] = true
}
}

initializing := false
for i := range pod.Status.InitContainerStatuses {
container := pod.Status.InitContainerStatuses[i]
restarts += int(container.RestartCount)
switch {
case nativeSidecarContainer[container.Name] && container.Started != nil && *container.Started && container.Ready:
// https://github.com/kubernetes/kubernetes/blob/66e34012255abf1bbd0956a712817dad77c69c41/pkg/printers/internalversion/printers.go#L908
continue
case container.State.Terminated != nil && container.State.Terminated.ExitCode == 0:
continue
case container.State.Terminated != nil:
Expand Down
1 change: 1 addition & 0 deletions frontend/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"clean": "yarn run package:clean",
"publishBeta": "../../tools/publish-frontend.sh api"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"jest": "27.5.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router": "6.0.0-beta.0",
"react-router-dom": "6.0.0-beta.0",
"react-router": "6.0.0",
"react-router-dom": "6.0.0",
"recharts": "2.1.9",
"typescript": "4.2.3"
},
Expand Down
36 changes: 23 additions & 13 deletions frontend/packages/app/config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
module.exports = function override(config) {
const loaders = config.module.rules.find(rule => rule.oneOf).oneOf;
loaders.splice(2, 0, {
test: /\.(js|mjs|jsx|ts|tsx)$/,
exclude: /.*node_modules.*/,
use: [
{
loader: "esbuild-loader",
options: {
loader: "jsx",
target: "esnext",
loaders.splice(
2,
0,
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
exclude: /.*node_modules.*/,
use: [
{
loader: "esbuild-loader",
options: {
loader: "jsx",
target: "esnext",
},
},
},
],
});
return config;
],
},
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
}
);

return { ...config, ignoreWarnings: [/Failed to parse source map/] };
};
3 changes: 1 addition & 2 deletions frontend/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"material-table": "^2.0.3",
"react-hook-form": "^7.25.3",
"react-is": "^17.0.2",
"react-router": "^6.0.0-beta.0",
"react-router-dom": "^6.0.0-beta.0",
"react-router-dom": "6.0.0",
"react-test-renderer": "^17.0.2",
"react-timeago": "^7.0.0",
"recharts": "^2.1.9",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { MemoryRouter } from "react-router";
import { MemoryRouter } from "react-router-dom";
import { Grid } from "@mui/material";
import type { Meta } from "@storybook/react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { MemoryRouter } from "react-router";
import { MemoryRouter } from "react-router-dom";
import type { Meta, StoryObj } from "@storybook/react";

import { ApplicationContext, UserPreferencesProvider } from "../../Contexts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { MemoryRouter } from "react-router";
import { MemoryRouter } from "react-router-dom";
import styled from "@emotion/styled";
import { Box, Grid as MuiGrid, Theme } from "@mui/material";
import type { Meta } from "@storybook/react";
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/core/src/NPS/stories/banner.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { MemoryRouter } from "react-router";
import { MemoryRouter } from "react-router-dom";
import type { Meta } from "@storybook/react";

import { Header } from "../../AppLayout/header";
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/core/src/NPS/stories/header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { MemoryRouter } from "react-router";
import { MemoryRouter } from "react-router-dom";
import type { Meta } from "@storybook/react";

import { Header } from "../../AppLayout/header";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Location } from "history";
import type { Location } from "react-router-dom";

import type { BreadcrumbEntry } from "../Breadcrumbs";

Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/core/src/utils/pathMatching.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { matchPath } from "react-router";
import { matchPath } from "react-router-dom";

const findPathMatchList = (locationPathname: string, pathsToMatch: string[]) => {
const pathFound = pathsToMatch?.find((path: string) => matchPath({ path }, locationPathname));
Expand Down
4 changes: 2 additions & 2 deletions frontend/packages/tools/yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const enforcedPackages = {
"@types/react-dom": "^17.0.3",
"@types/react": "^17.0.5",
"react-dom": "^17.0.2",
"react-router-dom": "^6.0.0-beta.0",
"react-router": "^6.0.0-beta.0",
"react-router-dom": "6.0.0",
"react-router": "6.0.0",
esbuild: "^0.18.0",
eslint: "^8.3.0",
jest: "^27.0.0",
Expand Down
1 change: 0 additions & 1 deletion frontend/workflows/projectCatalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@mui/material": "^5.11.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "6.0.0-beta.0",
"typescript": "^4.2.3"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const CatalogLayout = ({
allowDisabled,
quickLinkSettings = true,
}: CatalogLayoutProps) => {
const { projectId } = useParams();
const { projectId = "" } = useParams();
const navigate = useNavigate();
const [projectInfo, setProjectInfo] = React.useState<IClutch.core.project.v1.IProject | null>(
null
Expand All @@ -53,12 +53,16 @@ const CatalogLayout = ({
});

React.useEffect(() => {
fetchData();
if (projectId) {
fetchData();

const interval = setInterval(fetchData, 30000);
const interval = setInterval(fetchData, 30000);

return () => (interval ? clearInterval(interval) : undefined);
}, []);
return () => (interval ? clearInterval(interval) : undefined);
}

return () => {};
}, [projectId]);

return (
<ProjectDetailsContext.Provider value={projInfo}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { useParams } from "react-router-dom";
import {
checkFeatureEnabled,
Grid,
Expand All @@ -11,6 +10,7 @@ import {
QuickLinksCard,
styled,
Typography,
useParams,
} from "@clutch-sh/core";
import SettingsIcon from "@mui/icons-material/Settings";
import { isEmpty } from "lodash";
Expand Down
36 changes: 20 additions & 16 deletions frontend/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "7.25.3",
"react-router": "6.0.0-beta.0",
"react-router-dom": "6.0.0-beta.0",
"react-router": "6.0.0",
"react-router-dom": "6.0.0",
"typescript": "4.2.3"
},
"devDependencies": {
Expand Down

0 comments on commit ed00a3e

Please sign in to comment.