Skip to content

Commit

Permalink
SourceCardModal: switch to v1 weldr API
Browse files Browse the repository at this point in the history
The v0 Weldr API actually doesn't support setting rhsm=true. Thus, we need to
switch to v1 in order to fix that. V1 requires IDs to be set on repos, so
I altered the modal to allow that.
  • Loading branch information
ondrejbudai authored and jkozol committed Feb 14, 2024
1 parent d542ff3 commit 1a1bc36
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@ export function deleteImage(image) {
}

export function createSource(source) {
return post("/api/v0/projects/source/new", source);
return post("/api/v1/projects/source/new", source);
}

export function getAllSources() {
return get("/api/v0/projects/source/info/*").then(
return get("/api/v1/projects/source/info/*").then(
(response) => response.sources
);
}

export function deleteSource(sourceName) {
return _delete(
`/api/v0/projects/source/delete/${encodeURIComponent(sourceName)}`
`/api/v1/projects/source/delete/${encodeURIComponent(sourceName)}`
);
}

Expand Down
24 changes: 23 additions & 1 deletion src/components/Modal/SourceCardModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ export const SourceCardModal = (props) => {

const schema = {
fields: [
{
component: "text-field",
label: intl.formatMessage({
defaultMessage: "ID",
}),
isRequired: true,
name: "id",
validate: [
{
type: validatorTypes.REQUIRED,
},
{
type: "custom",
},
],
},
{
component: "text-field",
label: intl.formatMessage({
Expand Down Expand Up @@ -189,7 +205,7 @@ export const SourceCardModal = (props) => {
<CardHeader className="pf-u-pr-0">
<CardTitle>
<Title headingLevel="h4" size="xl">
{props.source?.name}
{props.source?.id}
</Title>
</CardTitle>
{props.isEditable && (
Expand All @@ -203,6 +219,12 @@ export const SourceCardModal = (props) => {
<Divider />
<CardBody>
<DescriptionList isCompact isHorizontal>
<DescriptionListGroup>
<DescriptionListTerm>Name</DescriptionListTerm>
<DescriptionListDescription>
{props.source?.name}
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Type</DescriptionListTerm>
<DescriptionListDescription>
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
"q4qEK9": "OSBuild Composer is not started",
"q5lNfF": "Alternatively, you may manually configure the file system of your image by adding, removing, and editing partitions.",
"q96L4B": "DIUN Public Key Insecure",
"qlcuNQ": "ID",
"r1lzNw": "Add ignition",
"r6XTzy": "Stop image build",
"rEQ/Rp": "Datastore",
Expand Down

2 comments on commit 1a1bc36

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your Packit configuration the settings of the @osbuild/cockpit-composer Copr project would need to be updated as follows:

field old value new value
chroots ['epel-8-x86_64'] ['centos-stream-8-x86_64', 'centos-stream-9-x86_64', 'epel-8-x86_64', 'epel-9-x86_64', 'fedora-38-x86_64', 'fedora-39-x86_64', 'fedora-rawhide-x86_64']

Diff of chroots:

+centos-stream-9-x86_64
+fedora-rawhide-x86_64
+fedora-39-x86_64
+epel-9-x86_64
+centos-stream-8-x86_64
+fedora-38-x86_64

Packit was unable to update the settings above as it is missing admin permissions on the @osbuild/cockpit-composer Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the @osbuild/cockpit-composer Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your Packit configuration the settings of the @osbuild/cockpit-composer Copr project would need to be updated as follows:

field old value new value
chroots ['epel-8-x86_64'] ['centos-stream-8-x86_64', 'centos-stream-9-x86_64', 'epel-8-x86_64', 'epel-9-x86_64', 'fedora-38-x86_64', 'fedora-39-x86_64', 'fedora-rawhide-x86_64']

Diff of chroots:

+fedora-38-x86_64
+centos-stream-9-x86_64
+fedora-39-x86_64
+centos-stream-8-x86_64
+epel-9-x86_64
+fedora-rawhide-x86_64

Packit was unable to update the settings above as it is missing admin permissions on the @osbuild/cockpit-composer Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the @osbuild/cockpit-composer Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

Please sign in to comment.