-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/amazon/titus): do not allow create/clone in managed clusters (
#7754) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
19ff2aa
commit 4302a0f
Showing
8 changed files
with
189 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
app/scripts/modules/core/src/managed/DeployingIntoManagedClusterWarning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import { IServerGroupCommand } from 'core/serverGroup'; | ||
import { FormikProps } from 'formik'; | ||
import { Application } from 'core/application'; | ||
import { toggleResourcePause } from './toggleResourceManagement'; | ||
|
||
export interface IDeployingIntoManagedClusterWarningProps { | ||
app: Application; | ||
formik: FormikProps<IServerGroupCommand>; | ||
} | ||
|
||
export const DeployingIntoManagedClusterWarning = ({ app, formik }: IDeployingIntoManagedClusterWarningProps) => { | ||
const [userPaused, setUserPaused] = React.useState(false); | ||
|
||
const command = formik.values; | ||
const pauseResource = React.useCallback(() => { | ||
const { resourceSummary, backingData } = formik.values; | ||
toggleResourcePause(resourceSummary, app).then(() => { | ||
backingData.managedResources = app.getDataSource('managedResources')?.data?.resources; | ||
setUserPaused(true); | ||
formik.setFieldValue('resourceSummary', null); | ||
}); | ||
}, [app, formik]); | ||
|
||
if (!command.resourceSummary && !userPaused) { | ||
return null; | ||
} | ||
|
||
if (userPaused) { | ||
return ( | ||
<div className="alert alert-info"> | ||
<div className="horizontal top"> | ||
<div> | ||
<i className="fa fa-check-circle" /> | ||
</div> | ||
<div className="sp-margin-m-left">Resource management has been paused.</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="alert alert-danger"> | ||
<p> | ||
<b>🌈 Spinnaker is continuously managing this resource.</b> | ||
</p> | ||
<p>Any changes you make to this cluster will be stomped in favor of the declarative configuration.</p> | ||
<p>If you need to manually deploy a new version of this server group, you should pause management.</p> | ||
<div className="sp-margin-m-top"> | ||
<button className="passive" onClick={pauseResource}> | ||
<i className="fa fa-pause" /> Pause management | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters