Removed system probe creation and updated lib images (#4203)

Signed-off-by: Saranya-jena <saranya.jena@harness.io>
This commit is contained in:
Saranya Jena 2023-10-03 10:38:33 +05:30 committed by GitHub
parent dc5757c1d5
commit 48c2ee0977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 40 deletions

View File

@ -2,7 +2,7 @@ import type { AddProbeRequest } from '@api/core';
import { InfrastructureType, ProbeType } from '@api/entities'; import { InfrastructureType, ProbeType } from '@api/entities';
const sourceObj = { const sourceObj = {
image: 'chaosnative/chaos-go-runner:ci', image: 'litmuschaos/go-runner:latest',
inheritInputs: true inheritInputs: true
}; };

View File

@ -982,7 +982,7 @@ export class KubernetesYamlService extends ExperimentYamlService {
): Promise<ChaosEngine | undefined> { ): Promise<ChaosEngine | undefined> {
try { try {
const experiment = await (await this.db).get(ChaosObjectStoreNameMap.EXPERIMENTS, key); const experiment = await (await this.db).get(ChaosObjectStoreNameMap.EXPERIMENTS, key);
const imageRegistry = experiment?.imageRegistry?.repo ?? 'chaosnative'; const imageRegistry = experiment?.imageRegistry?.repo ?? 'litmuschaos';
const experimentImagePullSecrets = experiment?.imageRegistry?.secret const experimentImagePullSecrets = experiment?.imageRegistry?.secret
? { ? {
experimentImagePullSecrets: [{ name: experiment.imageRegistry.secret }] experimentImagePullSecrets: [{ name: experiment.imageRegistry.secret }]
@ -1013,7 +1013,7 @@ export class KubernetesYamlService extends ExperimentYamlService {
...envs, ...envs,
{ {
name: 'LIB_IMAGE', name: 'LIB_IMAGE',
value: defaultCMDProbe?.['source']?.image?.replace('chaosnative', imageRegistry) value: defaultCMDProbe?.['source']?.image?.replace('litmuschaos', imageRegistry)
} }
], ],
...experimentImagePullSecrets ...experimentImagePullSecrets
@ -1023,7 +1023,7 @@ export class KubernetesYamlService extends ExperimentYamlService {
defaultCMDProbe['source'] = { defaultCMDProbe['source'] = {
...defaultCMDProbe['source'], ...defaultCMDProbe['source'],
...probeImagePullSecrets, ...probeImagePullSecrets,
image: defaultCMDProbe['source']?.image?.replace('chaosnative', imageRegistry) image: defaultCMDProbe['source']?.image?.replace('litmuschaos', imageRegistry)
}; };
} }

View File

@ -661,7 +661,7 @@ noProbeExecution: No Probe executions found
noProbeExecutionDetails: noProbeExecutionDetails:
subtitle: >- subtitle: >-
Probes are pluggable checks that can be defined within the ChaosEngine for Probes are pluggable checks that can be defined within the ChaosEngine for
any Chaos Experiment any Chaos Fault
title: There are no executions for the selected probe in your project title: There are no executions for the selected probe in your project
noProbes: No probes configured noProbes: No probes configured
noProbesAvailable: No Probes available for this node noProbesAvailable: No Probes available for this node

View File

@ -19,7 +19,7 @@ function kubernetesBlankCanvasTemplate(
chaosInfrastructureNamespace?: string, chaosInfrastructureNamespace?: string,
_serviceAccount?: string, _serviceAccount?: string,
imageRegistry: ImageRegistry = { imageRegistry: ImageRegistry = {
repo: 'chaosnative', repo: 'litmuschaos',
secret: '' secret: ''
} }
): KubernetesExperimentManifest { ): KubernetesExperimentManifest {

View File

@ -6,12 +6,9 @@ import { useHistory } from 'react-router-dom';
import noProbes from '@images/noProbes.svg'; import noProbes from '@images/noProbes.svg';
import { useStrings } from '@strings'; import { useStrings } from '@strings';
import { ParentComponentErrorWrapper } from '@errors'; import { ParentComponentErrorWrapper } from '@errors';
import { useRouteWithBaseUrl, useSearchParams } from '@hooks'; import { useRouteWithBaseUrl } from '@hooks';
import { getScope } from '@utils';
import type { AddProbeRequest, AddProbeResponse } from '@api/core'; import type { AddProbeRequest, AddProbeResponse } from '@api/core';
import { InfrastructureType } from '@api/entities';
import Loader from '@components/Loader'; import Loader from '@components/Loader';
import { KUBERENTES_SYSTEM_PROBE_CONFIG } from '@constants/SystemProbe';
import RbacButton from '@components/RbacButton'; import RbacButton from '@components/RbacButton';
import { PermissionGroup } from '@models'; import { PermissionGroup } from '@models';
import css from './SelectProbesTab.module.scss'; import css from './SelectProbesTab.module.scss';
@ -21,27 +18,11 @@ interface NoProbesProps {
addKubernetesCMDProbeMutation: MutationFunction<AddProbeResponse, AddProbeRequest>; addKubernetesCMDProbeMutation: MutationFunction<AddProbeResponse, AddProbeRequest>;
} }
export default function NoProbes({ loading, addKubernetesCMDProbeMutation }: NoProbesProps): React.ReactElement { export default function NoProbes({ loading }: NoProbesProps): React.ReactElement {
const scope = getScope();
const history = useHistory(); const history = useHistory();
const paths = useRouteWithBaseUrl(); const paths = useRouteWithBaseUrl();
const searchParams = useSearchParams();
const infrastructureType = searchParams.get('infrastructureType') as InfrastructureType;
const { getString } = useStrings(); const { getString } = useStrings();
const createSystemProbe = (): void => {
// Request Payload for Add
const addProbePayload: AddProbeRequest = {
projectID: scope.projectID,
request: KUBERENTES_SYSTEM_PROBE_CONFIG
};
if (infrastructureType === InfrastructureType.KUBERNETES)
addKubernetesCMDProbeMutation({
variables: addProbePayload
});
};
return ( return (
<Loader loading={loading} height="var(--page-min-height)"> <Loader loading={loading} height="var(--page-min-height)">
<Container className={css.noProbes}> <Container className={css.noProbes}>
@ -64,15 +45,6 @@ export default function NoProbes({ loading, addKubernetesCMDProbeMutation }: NoP
</Text> </Text>
<Layout.Vertical spacing={'medium'} flex={{ justifyContent: 'center' }}> <Layout.Vertical spacing={'medium'} flex={{ justifyContent: 'center' }}>
<Layout.Horizontal spacing={'medium'}> <Layout.Horizontal spacing={'medium'}>
<ParentComponentErrorWrapper>
<RbacButton
permission={PermissionGroup.EDITOR || PermissionGroup.OWNER}
variation={ButtonVariation.PRIMARY}
text={getString('addSystemProbe')}
icon="plus"
onClick={createSystemProbe}
/>
</ParentComponentErrorWrapper>
<ParentComponentErrorWrapper> <ParentComponentErrorWrapper>
<RbacButton <RbacButton
permission={PermissionGroup.EDITOR || PermissionGroup.OWNER} permission={PermissionGroup.EDITOR || PermissionGroup.OWNER}

View File

@ -138,7 +138,7 @@
</tr> </tr>
<tr> <tr>
<td> TARGET_HOSTNAMES </td> <td> TARGET_HOSTNAMES </td>
<td> List of the target hostnames or keywords eg. '["litmuschaos","chaosnative.com"]'</td> <td> List of the target hostnames or keywords eg. '["litmuschaos"]'</td>
<td> If not provided, all hostnames/domains will be targeted</td> <td> If not provided, all hostnames/domains will be targeted</td>
</tr> </tr>
<tr> <tr>
@ -219,7 +219,7 @@ spec:
## comma separated list of host names ## comma separated list of host names
## if not provided, all hostnames/domains will be targeted ## if not provided, all hostnames/domains will be targeted
- name: TARGET_HOSTNAMES - name: TARGET_HOSTNAMES
value: '["litmuschaos","chaosnative.com"]' value: '["litmuschaos"]'
- name: TOTAL_CHAOS_DURATION - name: TOTAL_CHAOS_DURATION
value: '60' value: '60'
``` ```

View File

@ -19,6 +19,6 @@ spec:
## comma separated list of host names ## comma separated list of host names
## if not provided, all hostnames/domains will be targeted ## if not provided, all hostnames/domains will be targeted
- name: TARGET_HOSTNAMES - name: TARGET_HOSTNAMES
value: '["litmuschaos","chaosnative.com"]' value: '["litmuschaos"]'
- name: TOTAL_CHAOS_DURATION - name: TOTAL_CHAOS_DURATION
value: '60' value: '60'