diff --git a/chaoscenter/web/src/views/ExperimentBuilderTemplateSelection/blankCanvasTemplate.ts b/chaoscenter/web/src/views/ExperimentBuilderTemplateSelection/blankCanvasTemplate.ts index 6f13e4a8e61..1474014dcc2 100644 --- a/chaoscenter/web/src/views/ExperimentBuilderTemplateSelection/blankCanvasTemplate.ts +++ b/chaoscenter/web/src/views/ExperimentBuilderTemplateSelection/blankCanvasTemplate.ts @@ -10,7 +10,12 @@ export default function blankCanvasTemplate( switch (infrastructureType) { case InfrastructureType.KUBERNETES: - return kubernetesBlankCanvasTemplate(experimentName, experiment?.chaosInfrastructure?.namespace); + return kubernetesBlankCanvasTemplate( + experimentName, + experiment?.chaosInfrastructure?.namespace, + undefined, + experiment?.imageRegistry, + ); } } diff --git a/chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx b/chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx index 89f8207357d..ac0b9ac926c 100644 --- a/chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx +++ b/chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx @@ -23,6 +23,8 @@ import { ChaosInfrastructureReferenceFieldProps, StudioErrorState, StudioTabs } import experimentYamlService from 'services/experiment'; import KubernetesChaosInfrastructureReferenceFieldController from '@controllers/KubernetesChaosInfrastructureReferenceField'; import { InfrastructureType } from '@api/entities'; +import { getImageRegistry } from '@api/core/ImageRegistry'; +import { getScope } from '@utils'; import css from './StudioOverview.module.scss'; interface StudioOverviewViewProps { @@ -52,6 +54,20 @@ export default function StudioOverviewView({ const [currentExperiment, setCurrentExperiment] = React.useState(); + const scope = getScope(); + + // Fetch the image registry data using Apollo's useQuery hook + const { data: getImageRegistryData, loading: imageRegistryLoading } = getImageRegistry({ + projectID: scope.projectID, + }); + + const imageRegistry = getImageRegistryData?.getImageRegistry?{ + name: getImageRegistryData.getImageRegistry.imageRegistryInfo.imageRegistryName, + repo: getImageRegistryData.getImageRegistry.imageRegistryInfo.imageRepoName, + secret: getImageRegistryData.getImageRegistry.imageRegistryInfo.secretName, + } + : undefined; + React.useEffect(() => { experimentHandler?.getExperiment(experimentKey).then(experiment => { delete experiment?.manifest; @@ -85,6 +101,9 @@ export default function StudioOverviewView({ }) })} onSubmit={values => { + + values.imageRegistry = imageRegistry + if (values.chaosInfrastructure.namespace === undefined) { delete values.chaosInfrastructure.namespace; } @@ -144,7 +163,13 @@ export default function StudioOverviewView({ text={getString('cancel')} onClick={openDiscardDialog} /> -