#71 Remove brew bias from the container-image type.
Merged 4 years ago by ralph. Opened 4 years ago by ralph.

@@ -3,9 +3,7 @@ 

        "type": "container-image",

        "repository": "someapp",

        "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-       "nvr": "someapp-2.8.71-7.el7_4",

-       "issuer": "jenkins",

-       "scratch": true,

+       "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

        "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

        "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

      },

@@ -3,9 +3,7 @@ 

        "type": "container-image",

        "repository": "someapp",

        "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-       "nvr": "someapp-2.8.71-7.el7_4",

-       "issuer": "jenkins",

-       "scratch": true,

+       "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

        "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

        "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

      },

@@ -3,9 +3,7 @@ 

        "type": "container-image",

        "repository": "someapp",

        "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-       "nvr": "someapp-2.8.71-7.el7_4",

-       "issuer": "jenkins",

-       "scratch": true,

+       "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

        "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

        "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

      },

@@ -3,9 +3,7 @@ 

        "type": "container-image",

        "repository": "someapp",

        "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-       "nvr": "someapp-2.8.71-7.el7_4",

-       "issuer": "jenkins",

-       "scratch": true,

+       "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

        "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

        "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

      },

@@ -19,9 +19,7 @@ 

      "type": "container-image",

      "repository": "someapp",

      "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-     "nvr": "someapp-2.8.71-7.el7_4",

-     "issuer": "jenkins",

-     "scratch": true,

+     "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

      "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

      "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

    },

@@ -19,9 +19,7 @@ 

      "type": "container-image",

      "repository": "someapp",

      "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-     "nvr": "someapp-2.8.71-7.el7_4",

-     "issuer": "jenkins",

-     "scratch": true,

+     "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

      "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

      "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

    },

@@ -17,9 +17,7 @@ 

      "type": "container-image",

      "repository": "someapp",

      "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-     "nvr": "someapp-2.8.71-7.el7_4",

-     "issuer": "jenkins",

-     "scratch": true,

+     "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

      "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

      "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

    },

@@ -17,9 +17,7 @@ 

      "type": "container-image",

      "repository": "someapp",

      "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

-     "nvr": "someapp-2.8.71-7.el7_4",

-     "issuer": "jenkins",

-     "scratch": true,

+     "pull_ref": "docker://registry.fedoraproject.org/someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433",

      "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a",

      "id": "someapp@sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433"

    },

file modified
+9 -13
@@ -11,6 +11,13 @@ 

        enum:

            - container-image

        type: string

+     registry:

+         description:

+             URL of the container image registry.

+         examples:

+             - quay.io

+             - docker.io

+         type: string

      repository:

          description:

              Name of the container image repository.
@@ -60,19 +67,9 @@ 

              - true

              - false

          type: boolean

-     nvr:

-         description:

-             Name-version-release of the artifact.

-         examples:

-             - someapp-2.8.71-7.el7_4

-         type: string

      source:

          description:

-             The first item in the request field from task details. This is

-             usually a link to git repository with a reference, delimited with

-             the '#' sign. In case of a scratch build or other build built via

-             uploading a src.rpm the build task source will look like the bash

-             scratch build.

+             This is usually a link to git repository with a reference, delimited with the '#' sign.

          examples:

              - git+https://github.com/docker/rootfs.git#container:docker

          type: string
@@ -89,9 +86,8 @@ 

  required:

      - type

      - repository

+     - pull_ref

      - digest

-     - issuer

-     - scratch

      - id

  

  type: object

The container-image type is meant to be a more generic type than
redhat-container-image. The redhat-container-image is supposed to represent a
container image build that we know was built in brew+OSBS, which means we can
make certain assumptions about it. The container-image type here required
the use of fields which don't make sense for a generic container-image from the
Internet. Here, I only remove the requirement to include those fields. I
think we should remove the fields in general in a separate PR, but I want to
make sure that no-one is using them first.

The pull_ref should be required, because since container-images are generic
there is no way to locate the content without it.

rebased onto 19e3d4165167bf9b0c42fe392e8c43172a9bedfa

4 years ago

LGTM. I wonder who to ask about the usage .... Maybe @mikeb ?

This looks good. If we want to make this more generic, we should probably remove nvr from the schema as well. We may also want to add a repo_server or something as well, since repository is just a name, doesn't specify where the repository actually lives.

Ah, registry is probably the right term for that. I'll add it and drop nvr.

This looks good.
I only have a question: is "pull_ref" already in the message, but just not required?

rebased onto dafb72a

4 years ago

Right @gnaponie - it was there, but just not required.

FYI, I rebased on master here and added a few more changes.

Pull-Request has been merged by ralph

4 years ago