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

Revert "cmd-build: Conditionally change the packing structure of container image #3506

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions pkg/builds/cosa_v1.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds

// generated by 'make schema'
// source hash: a5fec50536bd4c2eed006dfb897b3b40fdf50393a0e3e32edf874b4e200e4e4d
// source hash: 2cd4fe2a0c72e389ee6cb2b906653cdfd33f87b87d7e2e261fce4615a8c0272a

type AdvisoryDiff []AdvisoryDiffItems

Expand Down Expand Up @@ -106,7 +106,6 @@ type BuildArtifacts struct {
Metal *Artifact `json:"metal,omitempty"`
Metal4KNative *Artifact `json:"metal4k,omitempty"`
Nutanix *Artifact `json:"nutanix,omitempty"`
OciManifest *Artifact `json:"oci-manifest,omitempty"`
OpenStack *Artifact `json:"openstack,omitempty"`
Ostree Artifact `json:"ostree"`
PowerVirtualServer *Artifact `json:"powervs,omitempty"`
Expand Down
11 changes: 2 additions & 9 deletions pkg/builds/schema_doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by ./generate-schema.sh
// Source hash: a5fec50536bd4c2eed006dfb897b3b40fdf50393a0e3e32edf874b4e200e4e4d
// Source hash: 2cd4fe2a0c72e389ee6cb2b906653cdfd33f87b87d7e2e261fce4615a8c0272a
// DO NOT EDIT

package builds
Expand Down Expand Up @@ -479,8 +479,7 @@ var generatedSchemaJSON = `{
"vmware",
"vultr",
"qemu-secex",
"ignition-gpg-key",
"oci-manifest"
"ignition-gpg-key"
],
"properties": {
"ostree": {
Expand All @@ -489,12 +488,6 @@ var generatedSchemaJSON = `{
"title": "OSTree",
"$ref": "#/definitions/artifact"
},
"oci-manifest": {
"$id": "#/properties/images/properties/oci-manifest",
"type": "object",
"title": "OCI Manifest",
"$ref": "#/definitions/artifact"
},
"dasd": {
"$id": "#/properties/images/properties/dasd",
"type": "object",
Expand Down
27 changes: 0 additions & 27 deletions src/cmd-build
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,6 @@ if [ "${commit}" == "${previous_commit}" ] && \
ostree_tarfile_path=$(jq -r '.images.ostree.path' < "${previous_builddir}/meta.json")
cp-reflink "${previous_builddir}/${previous_ostree_tarfile_path}" "${ostree_tarfile_path}"
ostree_tarfile_sha256=$(jq -r '.images.ostree.sha256' < "${previous_builddir}/meta.json")

ostree_oci_manifest_path="${name}-${buildid}-ostree.${basearch}-manifest.json"
skopeo inspect --raw oci-archive:"${ostree_tarfile_path}" > tmp/manifest.json
/usr/lib/coreos-assembler/finalize-artifact tmp/manifest.json "${ostree_oci_manifest_path}"
ostree_oci_manifest_sha256=$(sha256sum "${ostree_oci_manifest_path}" | awk '{print$1}')
ostree_oci_manifest_size=$(stat --format=%s "${ostree_oci_manifest_path}")

# backcompat: allow older build without this field
if [ "${ostree_tarfile_sha256}" = "null" ]; then
ostree_tarfile_sha256=
Expand All @@ -459,33 +452,18 @@ else
"--label=io.openshift.build.versions=machine-os=${buildid}"
)
fi

last_build_manifest=()
# Use the last stable release if buildfetch used
if [ -n "${PARENT_BUILD}" ]; then
last_build_manifest+=("--previous-build-manifest=${parent_builddir}/${name}-${PARENT_BUILD}-ostree.${basearch}-manifest.json")
# Use the previous local build
elif [ -n "${previous_build}" ]; then
last_build_manifest+=("--previous-build-manifest=${previous_builddir}/${name}-${previous_build}-ostree.${basearch}-manifest.json")
fi
runv rpm-ostree compose container-encapsulate --max-layers="$MAX_OSTREECONTAINER_LAYERS" --format-version=1 \
--repo="${tmprepo}" \
--label="coreos-assembler.image-config-checksum=${image_config_checksum}" \
--label="coreos-assembler.image-input-checksum=${image_input_checksum}" \
--label="org.opencontainers.image.source=${gitsrc}" \
--label="org.opencontainers.image.revision=${config_gitrev}" \
--copymeta-opt=fedora-coreos.stream \
"${last_build_manifest[@]}" \
"${labels[@]}" \
"${buildid}" \
oci-archive:"${ostree_tarfile_path}".tmp:latest
/usr/lib/coreos-assembler/finalize-artifact "${ostree_tarfile_path}"{.tmp,}
ostree_tarfile_sha256=$(sha256sum "${ostree_tarfile_path}" | awk '{print$1}')
ostree_oci_manifest_path="${name}-${buildid}-ostree.${basearch}-manifest.json"
skopeo inspect --raw oci-archive:"${ostree_tarfile_path}" > tmp/manifest.json
/usr/lib/coreos-assembler/finalize-artifact tmp/manifest.json "${ostree_oci_manifest_path}"
ostree_oci_manifest_sha256=$(sha256sum "${ostree_oci_manifest_path}" | awk '{print$1}')
ostree_oci_manifest_size=$(stat --format=%s "${ostree_oci_manifest_path}")
fi

# The base metadata, plus locations for code sources.
Expand Down Expand Up @@ -529,11 +507,6 @@ cat > tmp/images.json <<EOF
"sha256": "${ostree_tarfile_sha256}",
"size": ${ostree_tarfile_size},
"skip-compression": true
},
"oci-manifest": {
"path": "${ostree_oci_manifest_path}",
"sha256": "${ostree_oci_manifest_sha256}",
"size": ${ostree_oci_manifest_size}
}
}
}
Expand Down
9 changes: 1 addition & 8 deletions src/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,7 @@
"vmware",
"vultr",
"qemu-secex",
"ignition-gpg-key",
"oci-manifest"
"ignition-gpg-key"
],
"properties": {
"ostree": {
Expand All @@ -483,12 +482,6 @@
"title": "OSTree",
"$ref": "#/definitions/artifact"
},
"oci-manifest": {
"$id": "#/properties/images/properties/oci-manifest",
"type": "object",
"title": "OCI Manifest",
"$ref": "#/definitions/artifact"
},
"dasd": {
"$id": "#/properties/images/properties/dasd",
"type": "object",
Expand Down
Loading