constants: Introduce RHEL_8 constant

Bump rhel-84 to rhel-85.
This commit is contained in:
Sanne Raymaekers 2021-11-11 18:24:10 +01:00 committed by jkozol
parent afcdb285e1
commit b986067079
9 changed files with 34 additions and 24 deletions

View file

@ -1,9 +1,10 @@
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
import nextStepMapper from './imageOutputStepMapper';
import { RHEL_8 } from '../../../constants.js';
export const releaseValues = {
'rhel-84': 'Red Hat Enterprise Linux (RHEL) 8',
[RHEL_8]: 'Red Hat Enterprise Linux (RHEL) 8',
'centos-8': 'CentOS Stream 8'
};
@ -17,7 +18,7 @@ export default {
label: 'Release',
name: 'release',
simpleValue: true,
initialValue: 'rhel-84',
initialValue: RHEL_8,
options: Object.entries(releaseValues).map(([ key, title ]) => ({
label: title,
value: key

View file

@ -1,3 +1,5 @@
import { RHEL_8 } from '../../../constants.js';
export default ({ 'target-environment': targetEnv, release } = {}, { skipAws, skipGoogle, skipAzure } = {}) => {
if (!skipAws && targetEnv?.aws) {
return 'aws-target-env';
@ -11,5 +13,5 @@ export default ({ 'target-environment': targetEnv, release } = {}, { skipAws, sk
return 'ms-azure-target-env';
}
return release === 'rhel-84' ? 'registration' : 'packages';
return release === RHEL_8 ? 'registration' : 'packages';
};

View file

@ -2,10 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Label } from '@patternfly/react-core';
import { RHEL_8 } from '../../constants.js';
const Release = (props) => {
const releaseOptions = {
'rhel-84': 'RHEL 8',
[RHEL_8]: 'RHEL 8',
'centos-8': 'CentOS Stream 8'
};
const release = releaseOptions[props.release] ? releaseOptions[props.release] : props.release;

View file

@ -1 +1,2 @@
export const IMAGE_BUILDER_API = '/api/image-builder/v1';
export const RHEL_8 = 'rhel-85';

View file

@ -1,9 +1,10 @@
import types from '../types';
import { RHEL_8 } from '../../constants.js';
const initialPendingComposeState = {
release: {
arch: 'x86_64',
distro: 'rhel-84',
distro: RHEL_8,
},
uploadDestinations: {
aws: false,

View file

@ -6,6 +6,7 @@ import userEvent from '@testing-library/user-event';
import { renderWithReduxRouter } from '../../testUtils';
import CreateImageWizard from '../../../Components/CreateImageWizard/CreateImageWizard';
import api from '../../../api.js';
import { RHEL_8 } from '../../../constants.js';
let historySpy = undefined;
let store = undefined;
@ -155,7 +156,7 @@ describe('Step Image output', () => {
// const release = screen.getByTestId('release-select');
// expect(release).toBeEnabled();
// userEvent.selectOptions(release, [ 'rhel-84' ]);
// userEvent.selectOptions(release, [ RHEL_8 ]);
// });
test('target environment is required', () => {
@ -599,7 +600,7 @@ describe('Click through all steps', () => {
const next = screen.getByRole('button', { name: /Next/ });
// select image output
// userEvent.selectOptions(screen.getByTestId('release-select'), [ 'rhel-84' ]);
// userEvent.selectOptions(screen.getByTestId('release-select'), [ RHEL_8 ]);
screen.getByTestId('upload-aws').click();
screen.getByTestId('upload-azure').click();
screen.getByTestId('upload-google').click();
@ -650,7 +651,7 @@ describe('Click through all steps', () => {
let id;
if (body.image_requests[0].upload_request.type === 'aws') {
expect(body).toEqual({
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [{
architecture: 'x86_64',
image_type: 'ami',
@ -675,7 +676,7 @@ describe('Click through all steps', () => {
id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f56';
} else if (body.image_requests[0].upload_request.type === 'gcp') {
expect(body).toEqual({
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [{
architecture: 'x86_64',
image_type: 'vhd',
@ -700,7 +701,7 @@ describe('Click through all steps', () => {
id = 'edbae1c2-62bc-42c1-ae0c-3110ab718f57';
} else if (body.image_requests[0].upload_request.type === 'azure') {
expect(body).toEqual({
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [{
architecture: 'x86_64',
image_type: 'vhd',
@ -748,7 +749,7 @@ describe('Click through all steps', () => {
const next = screen.getByRole('button', { name: /Next/ });
// select release
// userEvent.selectOptions(screen.getByTestId('release-select'), [ 'rhel-84' ]);
// userEvent.selectOptions(screen.getByTestId('release-select'), [ RHEL_8 ]);
screen.getByTestId('upload-aws').click();
next.click();
@ -786,7 +787,7 @@ describe('Click through all steps', () => {
test('with invalid values', async () => {
// select release
// userEvent.selectOptions(screen.getByTestId('release-select'), [ 'rhel-84' ]);
// userEvent.selectOptions(screen.getByTestId('release-select'), [ RHEL_8 ]);
// select upload target
screen.getByTestId('upload-aws').click();
screen.getByRole('button', { name: /Next/ }).click();

View file

@ -6,6 +6,7 @@ import ImageBuildStatus from '../../../Components/ImagesTable/ImageBuildStatus';
import ImageLink from '../../../Components/ImagesTable/ImageLink';
import Upload from '../../../Components/ImagesTable/Upload';
import '@testing-library/jest-dom';
import { RHEL_8 } from '../../../constants.js';
jest.mock('../../../store/actions/actions', () => {
return {
@ -34,7 +35,7 @@ const store = {
id: '1579d95b-8f1d-4982-8c53-8c2afa4ab04c',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -63,7 +64,7 @@ const store = {
id: 'c1cfa347-4c37-49b5-8e73-6aa1d1746cfa',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -83,7 +84,7 @@ const store = {
id: 'edbae1c2-62bc-42c1-ae0c-3110ab718f58',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -103,7 +104,7 @@ const store = {
id: '42ad0826-30b5-4f64-a24e-957df26fd564',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -123,7 +124,7 @@ const store = {
id: '955944a2-e149-4058-8ac1-35b514cb5a16',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -143,7 +144,7 @@ const store = {
id: 'f7a60094-b376-4b58-a102-5c8c82dfd18b',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -163,7 +164,7 @@ const store = {
id: '61b0effa-c901-4ee5-86b9-2010b47f1b22',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -183,7 +184,7 @@ const store = {
id: 'ca03f120-9840-4959-871e-94a5cb49d1f2',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -215,7 +216,7 @@ const store = {
id: '551de6f6-1533-4b46-a69f-7924051f9bc6',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',
@ -235,7 +236,7 @@ const store = {
id: '77fa8b03-7efb-4120-9a20-da66d68c4494',
created_at: '2021-04-27 12:31:12.794809 +0000 UTC',
request: {
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',

View file

@ -1,10 +1,11 @@
import { actions } from '../../store/actions';
import types from '../../store/types';
import { RHEL_8 } from '../../constants.js';
const compose = {
'77e4c693-0497-4b85-936d-b2a3ad69571b': {
id: '77e4c693-0497-4b85-936d-b2a3ad69571b',
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',

View file

@ -1,9 +1,10 @@
import { composes } from '../../store/reducers/composes';
import types from '../../store/types';
import { RHEL_8 } from '../../constants.js';
const compose = {
id: '77e4c693-0497-4b85-936d-b2a3ad69571b',
distribution: 'rhel-84',
distribution: RHEL_8,
image_requests: [
{
architecture: 'x86_64',