-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update modals and generate meaningful k8s name for images
- Loading branch information
1 parent
6f6801c
commit 9750213
Showing
28 changed files
with
7,641 additions
and
3,114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
package.json | ||
jest.config.js |
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,7 @@ | ||
module.exports = { | ||
transform: { | ||
'node_modules': 'ts-jest', | ||
}, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// https://cloud.google.com/artifact-registry/docs/docker/names | ||
// The full name for a container image is one of the following formats: | ||
// LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE | ||
// LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG | ||
// LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE@IMAGE-DIGEST | ||
|
||
import { parseImageURL } from '../routes/api/images/imageUtils'; | ||
|
||
test('Invalid URL: space string', () => { | ||
const url = ' '; | ||
const { fullURL, host } = parseImageURL(url); | ||
expect(fullURL).toBe(''); | ||
expect(host).toBeUndefined(); | ||
}); | ||
|
||
test('Invalid URL: no match', () => { | ||
const url = '/'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBeUndefined(); | ||
expect(tag).toBeUndefined(); | ||
}); | ||
|
||
test('Invalid URL: host only', () => { | ||
const url = 'docker.io'; | ||
const { host } = parseImageURL(url); | ||
expect(host).toBe(''); | ||
}); | ||
|
||
test('Invalid URL: host and repo, no image', () => { | ||
const url = 'docker.io/opendatahub'; | ||
const { host } = parseImageURL(url); | ||
expect(host).toBe(''); | ||
}); | ||
|
||
test('Valid URL with spaces on both sides', () => { | ||
const url = ' docker.io/library/mysql:test '; | ||
const { fullURL, host, tag } = parseImageURL(url); | ||
expect(fullURL).toBe('docker.io/library/mysql:test'); | ||
expect(host).toBe('docker.io'); | ||
expect(tag).toBe('test'); | ||
}); | ||
|
||
test('Docker container URL without tag', () => { | ||
const url = 'docker.io/library/mysql'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBe('docker.io'); | ||
expect(tag).toBeUndefined(); | ||
}); | ||
|
||
test('Docker container URL with tag', () => { | ||
const url = 'docker.io/library/mysql:test-tag'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBe('docker.io'); | ||
expect(tag).toBe('test-tag'); | ||
}); | ||
|
||
test('OpenShift internal registry URL without tag', () => { | ||
const url = 'image-registry.openshift-image-registry.svc:5000/opendatahub/s2i-minimal-notebook'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBe('image-registry.openshift-image-registry.svc:5000'); | ||
expect(tag).toBeUndefined(); | ||
}); | ||
|
||
test('OpenShift internal registry URL with tag', () => { | ||
const url = | ||
'image-registry.openshift-image-registry.svc:5000/opendatahub/s2i-minimal-notebook:v0.3.0-py36'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBe('image-registry.openshift-image-registry.svc:5000'); | ||
expect(tag).toBe('v0.3.0-py36'); | ||
}); | ||
|
||
test('Quay URL with port and tag', () => { | ||
const url = 'quay.io:443/opendatahub/odh-dashboard:main-55e19fa'; | ||
const { host, tag } = parseImageURL(url); | ||
expect(host).toBe('quay.io:443'); | ||
expect(tag).toBe('main-55e19fa'); | ||
}); |
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 was deleted.
Oops, something went wrong.
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
39 changes: 39 additions & 0 deletions
39
frontend/src/pages/BYONImages/BYONImageDependenciesList.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,39 @@ | ||
import * as React from 'react'; | ||
import { | ||
DescriptionListDescription, | ||
DescriptionListGroup, | ||
DescriptionListTerm, | ||
Text, | ||
TextContent, | ||
} from '@patternfly/react-core'; | ||
|
||
type BYONImageDependenciesListProps = { | ||
dependencies: string[]; | ||
term: string; | ||
}; | ||
|
||
const BYONImageDependenciesList: React.FC<BYONImageDependenciesListProps> = ({ | ||
term, | ||
dependencies, | ||
}) => { | ||
if (dependencies.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<DescriptionListGroup> | ||
<DescriptionListTerm>{term}</DescriptionListTerm> | ||
<DescriptionListDescription> | ||
<TextContent> | ||
{dependencies.map((dep, i) => ( | ||
<Text style={{ marginBottom: 0 }} key={i} component="small"> | ||
{dep} | ||
</Text> | ||
))} | ||
</TextContent> | ||
</DescriptionListDescription> | ||
</DescriptionListGroup> | ||
); | ||
}; | ||
|
||
export default BYONImageDependenciesList; |
File renamed without changes.
Oops, something went wrong.