Skip to content

Commit 8f1f251

Browse files
authored
Fix error in Cluster Management page when clicking continue (#4795)
1 parent 53c875b commit 8f1f251

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

pkg/handlers/embedded_cluster_confirm_cluster_management.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ func (h *Handler) ConfirmEmbeddedClusterManagement(w http.ResponseWriter, r *htt
5353
}
5454
pendingVersion := downstreamVersions.PendingVersions[0]
5555

56-
if pendingVersion.Status != storetypes.VersionPendingClusterManagement {
57-
logger.Error(fmt.Errorf("pending version is not in pending_cluster_management status"))
58-
w.WriteHeader(http.StatusBadRequest)
59-
return
60-
}
61-
6256
archiveDir, err := os.MkdirTemp("", "kotsadm")
6357
if err != nil {
6458
logger.Error(fmt.Errorf("failed to create temp dir: %w", err))

web/src/components/PreflightResultPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function PreflightResultPage(props: Props) {
7575
return (
7676
<div className="flex-column flex1 container">
7777
<KotsPageTitle pageName="Preflight Checks" showAppSlug />
78-
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
78+
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
7979
{location.pathname.includes("version-history") && (
8080
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
8181
<Icon
@@ -136,7 +136,9 @@ function PreflightResultPage(props: Props) {
136136
preflightCheck?.pendingPreflightCheckName || ""
137137
}
138138
percentage={
139-
preflightCheck?.pendingPreflightChecksPercentage || 0
139+
Math.round(
140+
preflightCheck?.pendingPreflightChecksPercentage
141+
) || 0
140142
}
141143
/>
142144
</div>

web/src/components/upgrade_service/ConfirmAndDeploy.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const ConfirmAndDeploy = ({
181181
return (
182182
<div className="flex-column flex1 container">
183183
<KotsPageTitle pageName="Confirm and Deploy" showAppSlug />
184-
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
184+
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
185185
{location.pathname.includes("version-history") && (
186186
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
187187
<Icon
@@ -219,7 +219,9 @@ const ConfirmAndDeploy = ({
219219
preflightCheck?.pendingPreflightCheckName || ""
220220
}
221221
percentage={
222-
preflightCheck?.pendingPreflightChecksPercentage || 0
222+
Math.round(
223+
preflightCheck?.pendingPreflightChecksPercentage
224+
) || 0
223225
}
224226
/>
225227
</div>

web/src/components/upgrade_service/PreflightChecks.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ const PreflightCheck = ({
108108
preflightCheck?.pendingPreflightCheckName || ""
109109
}
110110
percentage={
111-
preflightCheck?.pendingPreflightChecksPercentage || 0
111+
Math.round(
112+
preflightCheck?.pendingPreflightChecksPercentage
113+
) || 0
112114
}
113115
/>
114116
</div>

web/src/features/AppConfig/components/AppConfig.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ class AppConfig extends Component<Props, State> {
404404
const hasPreflight = app?.hasPreflight;
405405

406406
if (hasPreflight) {
407-
navigate(`/${slug}/preflight`, { replace: true });
407+
navigate(`/${slug}/preflight`);
408408
} else {
409409
await this.props.refetchApps();
410-
navigate(`/app/${slug}`, { replace: true });
410+
navigate(`/app/${slug}`);
411411
}
412412
} else {
413413
this.setState({

web/src/features/PreflightChecks/api/getPreflightResult.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ function useGetPrelightResults({
189189
setRefetchCount(0);
190190
},
191191
refetchInterval: (preflightCheck: PreflightCheck | undefined) => {
192-
if (!preflightCheck) return false;
192+
if (!preflightCheck) return null;
193+
194+
if (preflightCheck?.preflightResults.length > 0) return null;
193195

194196
const refetchInterval = makeRefetchInterval(preflightCheck);
195197

0 commit comments

Comments
 (0)