@openshift-assisted/ui-lib 2.9.12-cim → 2.9.14-cim
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/Agent/BMCForm.d.ts.map +1 -1
- package/build/@types/cim/components/Agent/tableUtils.d.ts +1 -1
- package/build/@types/cim/components/Agent/tableUtils.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ScaleUpForm.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.d.ts +2 -0
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/index.d.ts +0 -1
- package/build/@types/cim/components/InfraEnv/index.d.ts.map +1 -1
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +0 -1
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
- package/build/@types/common/components/hosts/utils.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/cjs/cim/components/Agent/BMCForm.js +21 -3
- package/build/cjs/cim/components/Agent/BMCForm.js.map +1 -1
- package/build/cjs/cim/components/Agent/tableUtils.js +7 -3
- package/build/cjs/cim/components/Agent/tableUtils.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js +6 -6
- package/build/cjs/cim/components/ClusterDeployment/ScaleUpForm.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.js +10 -0
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js +2 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/index.js +0 -1
- package/build/cjs/cim/components/InfraEnv/index.js.map +1 -1
- package/build/cjs/common/components/hosts/utils.js +2 -1
- package/build/cjs/common/components/hosts/utils.js.map +1 -1
- package/build/cjs/common/components/ui/formik/validationSchemas.js +1 -1
- package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +9 -3
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
- package/lib/cim/components/Agent/BMCForm.tsx +23 -3
- package/lib/cim/components/Agent/tableUtils.tsx +9 -1
- package/lib/cim/components/ClusterDeployment/ScaleUpForm.tsx +30 -24
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.tsx +35 -2
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.tsx +2 -0
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.ts +2 -0
- package/lib/cim/components/InfraEnv/index.ts +0 -1
- package/lib/cim/types/k8s/agent-cluster-install.ts +0 -1
- package/lib/common/components/hosts/utils.ts +2 -1
- package/lib/common/components/ui/formik/validationSchemas.ts +1 -1
- package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +10 -5
- package/package.json +3 -3
- package/build/@types/cim/components/InfraEnv/utils.d.ts +0 -14
- package/build/@types/cim/components/InfraEnv/utils.d.ts.map +0 -1
- package/build/cjs/cim/components/InfraEnv/utils.js +0 -117
- package/build/cjs/cim/components/InfraEnv/utils.js.map +0 -1
- package/lib/cim/components/InfraEnv/utils.ts +0 -147
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AgentClusterInstallK8sResource,
|
|
3
|
-
ClusterDeploymentK8sResource,
|
|
4
|
-
InfraEnvK8sResource,
|
|
5
|
-
SecretK8sResource,
|
|
6
|
-
} from '../../types';
|
|
7
|
-
import { EnvironmentStepFormValues } from './InfraEnvFormPage';
|
|
8
|
-
import { getClusterDeploymentResource } from '../helpers';
|
|
9
|
-
import { AGENT_LOCATION_LABEL_KEY } from '../common';
|
|
10
|
-
|
|
11
|
-
export const getLabels = (values: EnvironmentStepFormValues) =>
|
|
12
|
-
values.labels.reduce((acc, curr) => {
|
|
13
|
-
const label = curr.split('=');
|
|
14
|
-
acc[label[0]] = label[1];
|
|
15
|
-
return acc;
|
|
16
|
-
}, {} as Record<string, string>);
|
|
17
|
-
|
|
18
|
-
// TODO(mlibra): This should not be needed once we have late-binding
|
|
19
|
-
export const getClusterDeploymentForInfraEnv = (
|
|
20
|
-
pullSecretName: string,
|
|
21
|
-
namespace: string,
|
|
22
|
-
values: EnvironmentStepFormValues,
|
|
23
|
-
): ClusterDeploymentK8sResource =>
|
|
24
|
-
getClusterDeploymentResource({
|
|
25
|
-
name: values.name,
|
|
26
|
-
namespace,
|
|
27
|
-
baseDnsDomain: '', // TODO(mlibra): This function is about to be removed anyway
|
|
28
|
-
annotations: getLabels(values),
|
|
29
|
-
pullSecretName,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
type GetAgentClusterInstallProps = {
|
|
33
|
-
clusterDeploymentName?: string;
|
|
34
|
-
namespace: string;
|
|
35
|
-
values: EnvironmentStepFormValues;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const getAgentClusterInstall = ({
|
|
39
|
-
clusterDeploymentName,
|
|
40
|
-
namespace,
|
|
41
|
-
values,
|
|
42
|
-
}: GetAgentClusterInstallProps): AgentClusterInstallK8sResource => {
|
|
43
|
-
const obj: AgentClusterInstallK8sResource = {
|
|
44
|
-
apiVersion: 'extensions.hive.openshift.io/v1beta1',
|
|
45
|
-
kind: 'AgentClusterInstall',
|
|
46
|
-
metadata: {
|
|
47
|
-
name: values.name,
|
|
48
|
-
namespace,
|
|
49
|
-
},
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
spec: {
|
|
53
|
-
holdInstallation: true,
|
|
54
|
-
networking: {
|
|
55
|
-
clusterNetwork: [
|
|
56
|
-
{
|
|
57
|
-
cidr: '10.128.0.0/14', // '10.128.0.0/14',
|
|
58
|
-
hostPrefix: 23, // 23,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
serviceNetwork: ['172.30.0.0/16'],
|
|
62
|
-
},
|
|
63
|
-
provisionRequirements: {
|
|
64
|
-
controlPlaneAgents: 3,
|
|
65
|
-
},
|
|
66
|
-
imageSetRef: {
|
|
67
|
-
name: 'openshift-v4.8.0', // 'openshift-v4.7.0',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
if (obj.spec && clusterDeploymentName) {
|
|
73
|
-
obj.spec.clusterDeploymentRef = {
|
|
74
|
-
name: clusterDeploymentName,
|
|
75
|
-
namespace,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (obj.spec && values.sshPublicKey) {
|
|
80
|
-
obj.spec.sshPublicKey = values.sshPublicKey;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return obj;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const getSecret = (
|
|
87
|
-
namespace: string,
|
|
88
|
-
values: EnvironmentStepFormValues,
|
|
89
|
-
): SecretK8sResource => ({
|
|
90
|
-
kind: 'Secret',
|
|
91
|
-
apiVersion: 'v1',
|
|
92
|
-
metadata: {
|
|
93
|
-
name: values.name,
|
|
94
|
-
namespace,
|
|
95
|
-
},
|
|
96
|
-
data: {
|
|
97
|
-
'.dockerconfigjson': btoa(values.pullSecret),
|
|
98
|
-
},
|
|
99
|
-
type: 'kubernetes.io/dockerconfigjson',
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
export const getInfraEnv = (
|
|
103
|
-
namespace: string,
|
|
104
|
-
values: EnvironmentStepFormValues,
|
|
105
|
-
): InfraEnvK8sResource => {
|
|
106
|
-
const labels = getLabels(values);
|
|
107
|
-
if (values.location) {
|
|
108
|
-
labels[AGENT_LOCATION_LABEL_KEY] = labels[AGENT_LOCATION_LABEL_KEY] || values.location;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const infraEnv: InfraEnvK8sResource = {
|
|
112
|
-
apiVersion: 'agent-install.openshift.io/v1beta1',
|
|
113
|
-
kind: 'InfraEnv',
|
|
114
|
-
metadata: {
|
|
115
|
-
name: values.name,
|
|
116
|
-
namespace,
|
|
117
|
-
labels: {
|
|
118
|
-
[AGENT_LOCATION_LABEL_KEY]: values.location,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
spec: {
|
|
122
|
-
agentLabels: labels,
|
|
123
|
-
clusterRef: {
|
|
124
|
-
name: values.name,
|
|
125
|
-
namespace,
|
|
126
|
-
},
|
|
127
|
-
pullSecretRef: {
|
|
128
|
-
name: values.name,
|
|
129
|
-
},
|
|
130
|
-
sshAuthorizedKey: values.sshPublicKey,
|
|
131
|
-
},
|
|
132
|
-
status: {
|
|
133
|
-
agentLabelSelector: {
|
|
134
|
-
matchLabels: labels,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
if (infraEnv.spec && values.enableProxy) {
|
|
140
|
-
infraEnv.spec.proxy = {
|
|
141
|
-
httpProxy: values.httpProxy,
|
|
142
|
-
httpsProxy: values.httpsProxy,
|
|
143
|
-
noProxy: values.noProxy,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
return infraEnv;
|
|
147
|
-
};
|