Skip to content

Commit

Permalink
Fix error in Cluster Management page when clicking continue (#4795)
Browse files Browse the repository at this point in the history
  • Loading branch information
miaawong authored Aug 2, 2024
1 parent 53c875b commit 8f1f251
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
6 changes: 0 additions & 6 deletions pkg/handlers/embedded_cluster_confirm_cluster_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ func (h *Handler) ConfirmEmbeddedClusterManagement(w http.ResponseWriter, r *htt
}
pendingVersion := downstreamVersions.PendingVersions[0]

if pendingVersion.Status != storetypes.VersionPendingClusterManagement {
logger.Error(fmt.Errorf("pending version is not in pending_cluster_management status"))
w.WriteHeader(http.StatusBadRequest)
return
}

archiveDir, err := os.MkdirTemp("", "kotsadm")
if err != nil {
logger.Error(fmt.Errorf("failed to create temp dir: %w", err))
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/PreflightResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function PreflightResultPage(props: Props) {
return (
<div className="flex-column flex1 container">
<KotsPageTitle pageName="Preflight Checks" showAppSlug />
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
{location.pathname.includes("version-history") && (
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
<Icon
Expand Down Expand Up @@ -136,7 +136,9 @@ function PreflightResultPage(props: Props) {
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/upgrade_service/ConfirmAndDeploy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const ConfirmAndDeploy = ({
return (
<div className="flex-column flex1 container">
<KotsPageTitle pageName="Confirm and Deploy" showAppSlug />
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex u-overflow--auto">
<div className="PreflightChecks--wrapper flex-column u-paddingTop--30 flex1 flex tw-max-h-[60%]">
{location.pathname.includes("version-history") && (
<div className="u-fontWeight--bold link" onClick={() => navigate(-1)}>
<Icon
Expand Down Expand Up @@ -219,7 +219,9 @@ const ConfirmAndDeploy = ({
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/upgrade_service/PreflightChecks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const PreflightCheck = ({
preflightCheck?.pendingPreflightCheckName || ""
}
percentage={
preflightCheck?.pendingPreflightChecksPercentage || 0
Math.round(
preflightCheck?.pendingPreflightChecksPercentage
) || 0
}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/AppConfig/components/AppConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ class AppConfig extends Component<Props, State> {
const hasPreflight = app?.hasPreflight;

if (hasPreflight) {
navigate(`/${slug}/preflight`, { replace: true });
navigate(`/${slug}/preflight`);
} else {
await this.props.refetchApps();
navigate(`/app/${slug}`, { replace: true });
navigate(`/app/${slug}`);
}
} else {
this.setState({
Expand Down
4 changes: 3 additions & 1 deletion web/src/features/PreflightChecks/api/getPreflightResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ function useGetPrelightResults({
setRefetchCount(0);
},
refetchInterval: (preflightCheck: PreflightCheck | undefined) => {
if (!preflightCheck) return false;
if (!preflightCheck) return null;

if (preflightCheck?.preflightResults.length > 0) return null;

const refetchInterval = makeRefetchInterval(preflightCheck);

Expand Down

0 comments on commit 8f1f251

Please sign in to comment.