-
Notifications
You must be signed in to change notification settings - Fork 87
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
add pending_cluster_management status for embedded clusters #4461
add pending_cluster_management status for embedded clusters #4461
Conversation
} | ||
pendingVersion := downstreamVersions.PendingVersions[0] | ||
|
||
if pendingVersion.Status == storetypes.VersionPendingClusterManagement { |
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.
what do you think if we return an error if the version status is something different?
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.
added 400 response as this endpoint should not be called if the version is not pending_cluster_management
return | ||
} | ||
|
||
downstreamVersionStatus := storetypes.VersionPending |
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.
is there any possibility to make this a shared function/logic instead of duplicating this code?
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.
we may be able to pull out this snippet into a function to getDownstreamStatus
or something: https://github.com/replicatedhq/kots/blob/cbo/sc-99681/dont-auto-deploy-in-embedded-cluster/pkg/store/kotsstore/version_store.go#L621-L639
the logic is more complex for the non-embedded scenario since you can also skip preflights. i'll see what it would look like
@@ -337,15 +337,15 @@ function AppDetailPage(props: Props) { | |||
const firstVersion = downstream.pendingVersions.find( | |||
(version: Version) => version?.sequence === 0 | |||
); | |||
if (firstVersion?.status === "unknown" && props.isEmbeddedCluster) { | |||
if ( |
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.
would this ever be unknown now?
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.
i think we could remove that. probably left over from an early implementation?
@@ -360,6 +362,50 @@ const EmbeddedClusterManagement = ({ | |||
}, [nodesData?.nodes?.toString()]); | |||
// #endregion | |||
|
|||
const onContinueClick = async () => { | |||
const res = await fetch( | |||
`${process.env.API_ENDPOINT}/embedded-cluster/confirm`, |
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 route name seems ambiguous or generic. not sure what's a better name though...
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.
/embedded-cluster/management
?
What this PR does / why we need it:
This PR adds a new version status
pending_cluster_management
for embedded clusters to represent the state during an initial install when the user must confirm their cluster management settings. All embedded cluster installs will have the initial version set to this state prior to completing the cluster management step. Once that step is completed, the version status will either be set topending_config
,pending_preflight
, orpending
, depending on whether or not there is any app configuration or preflights defined.This fixes an issue where an application without required configuration would automatically deploy in embedded clusters, which was not the desired behavior.
Which issue(s) this PR fixes:
https://app.shortcut.com/replicated/story/99681/disable-autodeploy
Special notes for your reviewer:
Steps to reproduce
Does this PR introduce a user-facing change?
Does this PR require documentation?