Skip to content

Commit cd8e893

Browse files
Merge pull request #12968 from avivtur/depracate-alert-deployment-config
OCPBUGS-18348: Add deprecation alert for DeploymentConfig
2 parents b5aa690 + b284167 commit cd8e893

7 files changed

Lines changed: 66 additions & 8 deletions

File tree

frontend/packages/dev-console/src/components/deployments/DeploymentForm.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import { FormikProps, FormikValues } from 'formik';
33
import * as _ from 'lodash';
44
import { useTranslation } from 'react-i18next';
5+
import { DeploymentConfigDeprecationAlert } from '@console/internal/components/deployment-config';
56
import { DeploymentConfigModel, DeploymentModel } from '@console/internal/models';
67
import { K8sResourceKind } from '@console/internal/module/k8s';
78
import {
@@ -51,12 +52,16 @@ const EditDeploymentForm: React.FC<
5152
const formEditor = <DeploymentFormEditor resourceType={resourceType} resourceObj={resource} />;
5253

5354
const yamlEditor = (
54-
<CodeEditorField
55-
name="yamlData"
56-
model={resourceType === Resources.OpenShift ? DeploymentConfigModel : DeploymentModel}
57-
showSamples={isNew}
58-
onSave={handleSubmit}
59-
/>
55+
<>
56+
<DeploymentConfigDeprecationAlert />
57+
<br />
58+
<CodeEditorField
59+
name="yamlData"
60+
model={resourceType === Resources.OpenShift ? DeploymentConfigModel : DeploymentModel}
61+
showSamples={isNew}
62+
onSave={handleSubmit}
63+
/>
64+
</>
6065
);
6166

6267
const sanitizeToForm = (yamlDeployment: K8sResourceKind) => {

frontend/packages/dev-console/src/components/deployments/DeploymentFormEditor.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import { DeploymentConfigDeprecationAlert } from '@console/internal/components/deployment-config';
23
import { K8sResourceKind } from '@console/internal/module/k8s';
34
import SwitchToYAMLAlert from '@console/shared/src/components/alerts/SwitchToYAMLAlert';
45
import NameSection from '../buildconfig/sections/NameSection';
@@ -20,6 +21,7 @@ const EditDeploymentFormEditor: React.FC<EditDeploymentFormEditorProps> = ({
2021
const [showYAMLAlert, setShowYAMLAlert] = React.useState<boolean>(true);
2122
return (
2223
<>
24+
<DeploymentConfigDeprecationAlert />
2325
{showYAMLAlert && <SwitchToYAMLAlert onClose={() => setShowYAMLAlert(false)} />}
2426
<NameSection />
2527
<DeploymentStrategySection resourceType={resourceType} resourceObj={resourceObj} />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.odc-topology-sidebar-alert {
1+
.odc-topology-sidebar-alert, .dc-deprecation-sidebar-alert {
22
margin: 0 20px var(--pf-global--spacer--md);
33
}

frontend/packages/topology/src/components/side-bar/components/SideBarHeading.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as React from 'react';
22
import { GraphElement } from '@patternfly/react-topology';
3+
import { DeploymentConfigDeprecationAlert } from '@console/internal/components/deployment-config';
4+
import { DeploymentConfigModel } from '@console/internal/models';
35
import TopologyActions from '../../../actions/TopologyActions';
46
import { useDetailsResourceLink } from '../providers/useDetailsResourceLink';
57
import SideBarAlerts from './SideBarAlerts';
@@ -8,6 +10,7 @@ import './SideBarHeading.scss';
810
const SideBarHeading: React.FC<{ element: GraphElement }> = ({ element }) => {
911
const resourceLabel = element.getLabel();
1012
const resourceLink = useDetailsResourceLink(element);
13+
const resourceKind = element.getData()?.resource?.kind;
1114
return (
1215
<div className="overview__sidebar-pane-head resource-overview__heading">
1316
<h1 className="co-m-pane__heading">
@@ -16,6 +19,11 @@ const SideBarHeading: React.FC<{ element: GraphElement }> = ({ element }) => {
1619
<TopologyActions element={element} />
1720
</div>
1821
</h1>
22+
{resourceKind === DeploymentConfigModel.kind && (
23+
<div className="dc-deprecation-sidebar-alert">
24+
<DeploymentConfigDeprecationAlert />
25+
</div>
26+
)}
1927
<div className="odc-topology-sidebar-alert">
2028
<SideBarAlerts element={element} />
2129
</div>

frontend/public/components/deployment-config.tsx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ import {
4444
navFactory,
4545
togglePaused,
4646
RuntimeClass,
47+
ExternalLink,
48+
getDocumentationURL,
49+
documentationURLs,
4750
} from './utils';
4851
import { ReplicationControllersPage } from './replication-controller';
4952
import { WorkloadTableRow, WorkloadTableHeader } from './workload-table';
5053
import { PodDisruptionBudgetField } from '@console/app/src/components/pdb/PodDisruptionBudgetField';
54+
import { Alert } from '@patternfly/react-core';
5155

5256
const DeploymentConfigsReference: K8sResourceKindReference = 'DeploymentConfig';
5357

@@ -210,6 +214,33 @@ export const DeploymentConfigDetailsList = ({ dc }) => {
210214
);
211215
};
212216

217+
export const DeploymentConfigDeprecationAlert: React.FC = () => {
218+
const { t } = useTranslation();
219+
return (
220+
<Alert
221+
isInline
222+
variant="info"
223+
title={t('public~DeploymentConfig is being deprecated with OpenShift 4.14')}
224+
>
225+
<p>
226+
{t(
227+
'public~Feature development of DeploymentConfigs will be deprecated in OpenShift Container Platform 4.14.',
228+
)}
229+
</p>
230+
<p>
231+
{t(
232+
'public~DeploymentConfigs will continue to be supported for security and critical fixes, but you should migrate to Deployments wherever it is possible.',
233+
)}
234+
</p>
235+
<ExternalLink
236+
href={getDocumentationURL(documentationURLs.deprecatedDeploymentConfig)}
237+
text={t('public~Learn more about Deployments')}
238+
additionalClassName="pf-u-mt-md"
239+
/>
240+
</Alert>
241+
);
242+
};
243+
213244
export const DeploymentConfigsDetails: React.FC<{ obj: K8sResourceKind }> = ({ obj: dc }) => {
214245
const { t } = useTranslation();
215246
return (
@@ -326,7 +357,10 @@ export const DeploymentConfigsDetailsPage: React.FC<DeploymentConfigsDetailsPage
326357
kind={DeploymentConfigsReference}
327358
customActionMenu={customActionMenu}
328359
pages={pages}
329-
/>
360+
>
361+
<DeploymentConfigDeprecationAlert />
362+
<br />
363+
</DetailsPage>
330364
);
331365
};
332366
DeploymentConfigsDetailsPage.displayName = 'DeploymentConfigsDetailsPage';
@@ -372,6 +406,7 @@ export const DeploymentConfigsPage: React.FC<DeploymentConfigsPageProps> = (prop
372406
ListComponent={DeploymentConfigsList}
373407
createProps={createProps}
374408
canCreate={true}
409+
helpText={<DeploymentConfigDeprecationAlert />}
375410
{...props}
376411
/>
377412
);

frontend/public/components/utils/documentation.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export const documentationURLs: documentationURLsType = {
8080
downstream: 'html/building_applications/projects#working-with-projects',
8181
upstream: 'applications/projects/working-with-projects.html',
8282
},
83+
deprecatedDeploymentConfig: {
84+
downstream: 'html/building_applications/deployments',
85+
upstream: 'applications/deployments/what-deployments-are.html',
86+
},
8387
};
8488

8589
export const isUpstream = () => window.SERVER_FLAGS.branding === 'okd';

frontend/public/locales/en/public.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@
467467
"{{maxSurge}} greater than {{count}} pod_other": "{{maxSurge}} greater than {{count}} pods",
468468
"Min ready seconds": "Min ready seconds",
469469
"Triggers": "Triggers",
470+
"DeploymentConfig is being deprecated with OpenShift 4.14": "DeploymentConfig is being deprecated with OpenShift 4.14",
471+
"Feature development of DeploymentConfigs will be deprecated in OpenShift Container Platform 4.14.": "Feature development of DeploymentConfigs will be deprecated in OpenShift Container Platform 4.14.",
472+
"DeploymentConfigs will continue to be supported for security and critical fixes, but you should migrate to Deployments wherever it is possible.": "DeploymentConfigs will continue to be supported for security and critical fixes, but you should migrate to Deployments wherever it is possible.",
473+
"Learn more about Deployments": "Learn more about Deployments",
470474
"DeploymentConfig details": "DeploymentConfig details",
471475
"ReplicationControllers": "ReplicationControllers",
472476
"DeploymentConfigs": "DeploymentConfigs",

0 commit comments

Comments
 (0)