Skip to content

Commit

Permalink
Merge branch 'master' into implicit
Browse files Browse the repository at this point in the history
  • Loading branch information
andoriyaprashant authored Oct 7, 2024
2 parents 144d30e + 29e7130 commit 0000704
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
}

Expand Down
27 changes: 26 additions & 1 deletion chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -52,6 +54,20 @@ export default function StudioOverviewView({

const [currentExperiment, setCurrentExperiment] = React.useState<ExperimentMetadata | undefined>();

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;
Expand Down Expand Up @@ -85,6 +101,9 @@ export default function StudioOverviewView({
})
})}
onSubmit={values => {

values.imageRegistry = imageRegistry

if (values.chaosInfrastructure.namespace === undefined) {
delete values.chaosInfrastructure.namespace;
}
Expand Down Expand Up @@ -144,7 +163,13 @@ export default function StudioOverviewView({
text={getString('cancel')}
onClick={openDiscardDialog}
/>
<Button type="submit" intent="primary" text={getString('next')} rightIcon="chevron-right" />
<Button
type="submit"
intent="primary"
text={getString('next')}
rightIcon="chevron-right"
disabled={imageRegistryLoading}
/>
</Layout.Horizontal>
</Form>
</Layout.Vertical>
Expand Down

0 comments on commit 0000704

Please sign in to comment.