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

adding call to pyxis for non EOL catalogs and updating imagestream logic #160

Conversation

acornett21
Copy link
Contributor

Motivation

The old logic we have in place was trying to mirror all of the tags within a given namespace/image, and since there are about ~4k tags at this point, our logic would timeout and not create an ImageStream. This could cause us to be stuck on these sub-reconcilers, until a user manually added the imagestreams with the tags that they cared about.

Implementation

For the implementation, a graphql client for pyxis was added and a query that looks for non End Of Life catalogs. For the implementation of the query we can look for OCP versions where eol equals null.

Sample GraphQL Query

query:
{
  find_operator_indices(
    filter: {
      and : [
        {
          organization: {
            eq: "redhat-marketplace"
          }
        },
        {
          end_of_life: {
            eq: null
          }
        }
      ]
    }
  ) {
    data{
      ocp_version
      organization
      end_of_life
      }
    error {
      status
      detail
    }
  }
}

results:
{
  "data": {
    "find_operator_indices": {
      "data": [
        {
          "ocp_version": "4.12",
          "organization": "redhat-marketplace",
          "end_of_life": null
        },
        {
          "ocp_version": "4.13",
          "organization": "redhat-marketplace",
          "end_of_life": null
        },
        {
          "ocp_version": "4.14",
          "organization": "redhat-marketplace",
          "end_of_life": null
        },
        {
          "ocp_version": "4.15",
          "organization": "redhat-marketplace",
          "end_of_life": null
        },
        {
          "ocp_version": "4.16",
          "organization": "redhat-marketplace",
          "end_of_life": null
        },
        {
          "ocp_version": "4.17",
          "organization": "redhat-marketplace",
          "end_of_life": null
        }
      ],
      "error": null
    }
  }
}

Testing

This was tested in a cluster both as a catalog/bundle and also running locally in debug mode.

oc get is
NAME                       IMAGE REPOSITORY                                                                       TAGS                                  UPDATED
certified-operator-index   default-route-openshift-image-registry.apps-crc.testing/oco/certified-operator-index   v4.12,v4.13,v4.14,v4.15,v4.16,v4.17   27 minutes ago
redhat-marketplace-index   default-route-openshift-image-registry.apps-crc.testing/oco/redhat-marketplace-index   v4.12,v4.13,v4.14,v4.15,v4.16,v4.17   27 minutes ago

As you can see we only get the tags for catalogs which are not EOL.

@acornett21 acornett21 requested review from bcrochet and komish August 12, 2024 20:33
@openshift-ci openshift-ci bot requested review from mrhillsman and skattoju August 12, 2024 20:33
@acornett21 acornett21 force-pushed the implement_pyxis_catalog_lookup branch from af0e332 to 152ad19 Compare August 12, 2024 20:38
internal/pyxis/types.go Outdated Show resolved Hide resolved
internal/pyxis/pyxis.go Outdated Show resolved Hide resolved
internal/pyxis/pyxis.go Outdated Show resolved Hide resolved
internal/pyxis/pyxis.go Outdated Show resolved Hide resolved
@acornett21 acornett21 force-pushed the implement_pyxis_catalog_lookup branch from ecf820f to d124aba Compare August 19, 2024 20:47
@acornett21 acornett21 force-pushed the implement_pyxis_catalog_lookup branch from d124aba to f42aa16 Compare August 21, 2024 20:45
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2024
Copy link

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

@acornett21 acornett21 merged commit 82bc0f5 into redhat-openshift-ecosystem:main Aug 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't pull the right certified-operator-index image in a brand new cluster
4 participants