Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image registry bug fix #4887

Merged
merged 7 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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
21 changes: 20 additions & 1 deletion chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import experimentYamlService from 'services/experiment';
import KubernetesChaosInfrastructureReferenceFieldController from '@controllers/KubernetesChaosInfrastructureReferenceField';
import { InfrastructureType } from '@api/entities';
import css from './StudioOverview.module.scss';

Check failure on line 26 in chaoscenter/web/src/views/StudioOverview/StudioOverview.tsx

View workflow job for this annotation

GitHub Actions / frontend-checks

`./StudioOverview.module.scss` import should occur after import of `@utils`
import { getImageRegistry } from '@api/core/ImageRegistry';
import { getScope } from '@utils';

interface StudioOverviewViewProps {
formRef: React.MutableRefObject<FormikProps<ExperimentMetadata> | undefined>;
Expand Down Expand Up @@ -52,6 +54,20 @@

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 @@
})
})}
onSubmit={values => {

values.imageRegistry = imageRegistry

if (values.chaosInfrastructure.namespace === undefined) {
delete values.chaosInfrastructure.namespace;
}
Expand Down Expand Up @@ -144,7 +163,7 @@
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
Loading