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
Move topology from dev-console to its own monorepo #7254
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
jeff-phillips-18:topology-package
Nov 24, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions
4
frontend/packages/console-shared/src/components/modals/index.ts
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,4 @@ | ||
export const deleteResourceModal = (props) => | ||
import('./DeleteResourceModal' /* webpackChunkName: "shared-modals" */).then((m) => | ||
m.deleteResourceModal(props), | ||
); |
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
2 changes: 1 addition & 1 deletion
2
...s/dev-console/src/components/hpa/hooks.ts → ...ges/console-shared/src/hooks/hpa-hooks.ts
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
49 changes: 49 additions & 0 deletions
49
frontend/packages/console-shared/src/utils/__tests__/hpa-utils-data.ts
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,49 @@ | ||
import { HorizontalPodAutoscalerKind } from '@console/internal/module/k8s'; | ||
|
||
export const deploymentHasCpuAndMemoryLimits = { | ||
kind: 'Deployment', | ||
apiVersion: 'apps/v1', | ||
metadata: { | ||
name: 'nodejs-rest-http-with-resource-limits', | ||
namespace: 'test-ns', | ||
}, | ||
}; | ||
|
||
export const deploymentConfigHasCpuAndMemoryLimits = { | ||
kind: 'DeploymentConfig', | ||
apiVersion: 'apps.openshift.io/v1', | ||
metadata: { | ||
name: 'nodejs-rest-http-crud-resource-limits', | ||
namespace: 'test-ns', | ||
}, | ||
}; | ||
|
||
export const cpuScaled: HorizontalPodAutoscalerKind = { | ||
kind: 'HorizontalPodAutoscaler', | ||
apiVersion: 'autoscaling/v2beta2', | ||
metadata: { | ||
name: 'example', | ||
namespace: 'test-ns', | ||
}, | ||
spec: { | ||
scaleTargetRef: { | ||
kind: 'DeploymentConfig', | ||
name: 'nodejs-rest-http-crud-resource-limits', | ||
apiVersion: 'apps.openshift.io/v1', | ||
}, | ||
minReplicas: 2, | ||
maxReplicas: 10, | ||
metrics: [ | ||
{ | ||
type: 'Resource', | ||
resource: { | ||
name: 'cpu', | ||
target: { | ||
type: 'Utilization', | ||
averageUtilization: 42, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
16 changes: 16 additions & 0 deletions
16
frontend/packages/console-shared/src/utils/__tests__/hpa-utils.spec.ts
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,16 @@ | ||
import { | ||
deploymentHasCpuAndMemoryLimits, | ||
deploymentConfigHasCpuAndMemoryLimits, | ||
cpuScaled, | ||
} from './hpa-utils-data'; | ||
import { doesHpaMatch } from '../hpa-utils'; | ||
|
||
describe('doesHpaMatch checks if it aligns to a workload', () => { | ||
it('expect not to match when hpa does not target workload', () => { | ||
expect(doesHpaMatch(deploymentHasCpuAndMemoryLimits)(cpuScaled)).toBe(false); | ||
}); | ||
|
||
it('expect to match when hpa does target workload', () => { | ||
expect(doesHpaMatch(deploymentConfigHasCpuAndMemoryLimits)(cpuScaled)).toBe(true); | ||
}); | ||
}); |
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,13 @@ | ||
import { HorizontalPodAutoscalerKind, K8sResourceCommon } from '@console/internal/module/k8s'; | ||
|
||
export const doesHpaMatch = (workload: K8sResourceCommon) => ( | ||
thisHPA: HorizontalPodAutoscalerKind, | ||
) => { | ||
const { | ||
apiVersion, | ||
kind, | ||
metadata: { name }, | ||
} = workload; | ||
const ref = thisHPA?.spec?.scaleTargetRef; | ||
return ref && ref.apiVersion === apiVersion && ref.kind === kind && ref.name === name; | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
frontend/packages/dev-console/src/actions/modify-helm-release.ts
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
92 changes: 0 additions & 92 deletions
92
frontend/packages/dev-console/src/components/dropdown/ApplicationDropdown.tsx
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...d/packages/dev-console/src/components/edit-application/__tests__/edit-application-data.ts
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 | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||
import { K8sResourceKind } from '@console/internal/module/k8s'; | ||||||
import { ServiceModel } from '@console/knative-plugin'; | ||||||
import { UNASSIGNED_KEY } from '../../../const'; | ||||||
import { UNASSIGNED_KEY } from '@console/topology/src/const'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Suggested change
|
||||||
import { DeployImageFormData, GitImportFormData, Resources } from '../../import/import-types'; | ||||||
import { AppResources } from '../edit-application-types'; | ||||||
import { healthChecksProbeInitialData } from '../../health-checks/health-checks-probe-utils'; | ||||||
|
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 | ||||
---|---|---|---|---|---|---|
|
@@ -10,7 +10,7 @@ import { DeploymentConfigModel, DeploymentModel } from '@console/internal/models | |||||
import { hasIcon } from '@console/internal/components/catalog/catalog-item-icon'; | ||||||
import { ServiceModel } from '@console/knative-plugin'; | ||||||
import { Pipeline } from '@console/pipelines-plugin/src/utils/pipeline-augment'; | ||||||
import { UNASSIGNED_KEY } from '../../const'; | ||||||
import { UNASSIGNED_KEY } from '@console/topology/src/const'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Suggested change
|
||||||
import { Resources, DeploymentData, GitReadableTypes } from '../import/import-types'; | ||||||
import { AppResources } from './edit-application-types'; | ||||||
import { RegistryType } from '../../utils/imagestream-utils'; | ||||||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this PR not just a refactor... why the change in component usage?
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.
There were two different ApplicationSelector components, one in shared one in dev-console. Both are now in topology (since the use the topology data retrieval) and this one was renamed.
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.
Gotcha. Thanks for the clarification!