|
@@ -30,6 +30,7 @@ import TitleSection from "components/TitleSection";
|
|
|
import DeploymentType from "./DeploymentType";
|
|
import DeploymentType from "./DeploymentType";
|
|
|
import { onlyInLeft } from "shared/array_utils";
|
|
import { onlyInLeft } from "shared/array_utils";
|
|
|
import IncidentsTab from "./incidents/IncidentsTab";
|
|
import IncidentsTab from "./incidents/IncidentsTab";
|
|
|
|
|
+import BuildSettingsTab from "./BuildSettingsTab";
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
namespace: string;
|
|
namespace: string;
|
|
@@ -515,6 +516,8 @@ const ExpandedChart: React.FC<Props> = (props) => {
|
|
|
disabled={!isAuthorized("application", "", ["get", "update"])}
|
|
disabled={!isAuthorized("application", "", ["get", "update"])}
|
|
|
/>
|
|
/>
|
|
|
);
|
|
);
|
|
|
|
|
+ case "build-settings":
|
|
|
|
|
+ return <BuildSettingsTab />;
|
|
|
default:
|
|
default:
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -539,6 +542,13 @@ const ExpandedChart: React.FC<Props> = (props) => {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // if (currentChart?.git_action_config?.git_repo) {
|
|
|
|
|
+ rightTabOptions.push({
|
|
|
|
|
+ label: "Build Settings",
|
|
|
|
|
+ value: "build-settings",
|
|
|
|
|
+ });
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
// Settings tab is always last
|
|
// Settings tab is always last
|
|
|
if (isAuthorized("application", "", ["get", "delete"])) {
|
|
if (isAuthorized("application", "", ["get", "delete"])) {
|
|
|
rightTabOptions.push({ label: "Settings", value: "settings" });
|
|
rightTabOptions.push({ label: "Settings", value: "settings" });
|
|
@@ -580,47 +590,47 @@ const ExpandedChart: React.FC<Props> = (props) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const chartStatus = useMemo(() => {
|
|
|
|
|
- const getAvailability = (kind: string, c: any) => {
|
|
|
|
|
- switch (kind?.toLowerCase()) {
|
|
|
|
|
- case "deployment":
|
|
|
|
|
- case "replicaset":
|
|
|
|
|
- return c.status.availableReplicas == c.status.replicas;
|
|
|
|
|
- case "statefulset":
|
|
|
|
|
- return c.status.readyReplicas == c.status.replicas;
|
|
|
|
|
- case "daemonset":
|
|
|
|
|
- return c.status.numberAvailable == c.status.desiredNumberScheduled;
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const chartStatus = currentChart.info.status;
|
|
|
|
|
-
|
|
|
|
|
- if (chartStatus === "deployed") {
|
|
|
|
|
- for (var uid in controllers) {
|
|
|
|
|
- let value = controllers[uid];
|
|
|
|
|
- let available = getAvailability(value.metadata.kind, value);
|
|
|
|
|
- let progressing = true;
|
|
|
|
|
-
|
|
|
|
|
- controllers[uid]?.status?.conditions?.forEach((condition: any) => {
|
|
|
|
|
- if (
|
|
|
|
|
- condition.type == "Progressing" &&
|
|
|
|
|
- condition.status == "False" &&
|
|
|
|
|
- condition.reason == "ProgressDeadlineExceeded"
|
|
|
|
|
- ) {
|
|
|
|
|
- progressing = false;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if (!available && progressing) {
|
|
|
|
|
- return "loading";
|
|
|
|
|
- } else if (!available && !progressing) {
|
|
|
|
|
- return "failed";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return "deployed";
|
|
|
|
|
- }
|
|
|
|
|
- return chartStatus;
|
|
|
|
|
- }, [currentChart, controllers]);
|
|
|
|
|
|
|
+ // const chartStatus = useMemo(() => {
|
|
|
|
|
+ // const getAvailability = (kind: string, c: any) => {
|
|
|
|
|
+ // switch (kind?.toLowerCase()) {
|
|
|
|
|
+ // case "deployment":
|
|
|
|
|
+ // case "replicaset":
|
|
|
|
|
+ // return c.status.availableReplicas == c.status.replicas;
|
|
|
|
|
+ // case "statefulset":
|
|
|
|
|
+ // return c.status.readyReplicas == c.status.replicas;
|
|
|
|
|
+ // case "daemonset":
|
|
|
|
|
+ // return c.status.numberAvailable == c.status.desiredNumberScheduled;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // const chartStatus = currentChart.info.status;
|
|
|
|
|
+
|
|
|
|
|
+ // if (chartStatus === "deployed") {
|
|
|
|
|
+ // for (var uid in controllers) {
|
|
|
|
|
+ // let value = controllers[uid];
|
|
|
|
|
+ // let available = getAvailability(value.metadata.kind, value);
|
|
|
|
|
+ // let progressing = true;
|
|
|
|
|
+
|
|
|
|
|
+ // controllers[uid]?.status?.conditions?.forEach((condition: any) => {
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // condition.type == "Progressing" &&
|
|
|
|
|
+ // condition.status == "False" &&
|
|
|
|
|
+ // condition.reason == "ProgressDeadlineExceeded"
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // progressing = false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ // if (!available && progressing) {
|
|
|
|
|
+ // return "loading";
|
|
|
|
|
+ // } else if (!available && !progressing) {
|
|
|
|
|
+ // return "failed";
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return "deployed";
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return chartStatus;
|
|
|
|
|
+ // }, [currentChart, controllers]);
|
|
|
|
|
|
|
|
const renderUrl = () => {
|
|
const renderUrl = () => {
|
|
|
if (url) {
|
|
if (url) {
|
|
@@ -836,7 +846,6 @@ const ExpandedChart: React.FC<Props> = (props) => {
|
|
|
setRevision={setRevision}
|
|
setRevision={setRevision}
|
|
|
forceRefreshRevisions={forceRefreshRevisions}
|
|
forceRefreshRevisions={forceRefreshRevisions}
|
|
|
refreshRevisionsOff={() => setForceRefreshRevisions(false)}
|
|
refreshRevisionsOff={() => setForceRefreshRevisions(false)}
|
|
|
- status={chartStatus}
|
|
|
|
|
shouldUpdate={
|
|
shouldUpdate={
|
|
|
currentChart.latest_version &&
|
|
currentChart.latest_version &&
|
|
|
currentChart.latest_version !==
|
|
currentChart.latest_version !==
|