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

(e2e) Use custom built test catalog for e2e testing #250

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

anik120
Copy link
Contributor

@anik120 anik120 commented Jun 2, 2023

This PR

  • Stands up a local image registry in the cluster

  • Builds bundles and catalog images and uploads them to the image registry

  • Uses the custom images in the e2e test suite

  • Also introduces a pullSecret field for the Operator API's Spec struct, to allow installation of operators on cluster whose bundles require imagePullSecret to be provisioned. This is required because the bundle images built and uploaded to the local registry above requires a pull secret for the local registry.

closes #215

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@joelanford
Copy link
Member

  • Stands up a local image registry in the cluster
  • Builds bundles and catalog images and uploads them to the image registry

I think this is overkill. We should be able to simply build the images, kind load them, and then refer to them directly in the e2e. No need to run an extra image registry, IMO.

@joelanford
Copy link
Member

@everettraven
Copy link
Contributor

Stands up a local image registry in the cluster

This feels very heavy handed - is there a reason we have to stand up an image registry on cluster instead of just kind loading the images? As long as we aren't using images with :latest tags the default Kube pull policy should just allow us to use kind load to load images and use them with the unpack pods.

In my head the most simple and straightforward approach to using a custom built test catalog would be to:

  1. Build a custom test catalog & pull the bundle image, tagging with a non :latest tag
    2 kind load docker-image ... for both images from 1
  2. Change the catalog image in the e2e tests
  3. Run the e2e tests

@anik120
Copy link
Contributor Author

anik120 commented Jun 2, 2023

Looks like my use of the latest tag was in fact the problem.

:latest tags the default Kube pull policy

TIL.

Updated the PR to just use built and loaded images

@anik120 anik120 force-pushed the test-catalog branch 2 times, most recently from ae4519e to 0532f43 Compare June 2, 2023 14:34
Makefile Show resolved Hide resolved
testdata/catalogs/test-catalog/catalog.yaml Outdated Show resolved Hide resolved
testdata/catalogs/test-catalog/catalog.yaml Outdated Show resolved Hide resolved
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2023
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, only have a question about the related images in the bundle blob

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2023
@anik120
Copy link
Contributor Author

anik120 commented Jun 2, 2023

Overall looks good to me, only have a question about the related images in the bundle blob

Removed the related images, they aren't needed 👍🏽

@anik120
Copy link
Contributor Author

anik120 commented Jun 2, 2023

/hold

looks like the e2e tests are failing after rebasing on top of #216, have to investigate it

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 2, 2023
{
"schema": "olm.package",
"name": "prometheus",
"defaultChannel": "beta"
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to remove this line as well based on my other comment, but I think catalogd may validate the input (and removing this line would cause that validation to fail)

Maybe add a TODO comment to this line that we're only setting this to satisfy the existing OLMv0-based validation logic and that we should look for a way to be able to remove this. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like adding comments to a json file isn't that easy.
One way would be to add a key/value of the form "comment": "TODO:...", but that's possibly a bit confusing?

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah, forgot about that. Let's just leave it as is.

@anik120 anik120 force-pushed the test-catalog branch 2 times, most recently from dd41d0b to 2609831 Compare June 2, 2023 19:39
@anik120
Copy link
Contributor Author

anik120 commented Jun 2, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 2, 2023
@everettraven everettraven self-requested a review June 2, 2023 20:09
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 2, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 2, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

All this seems fine for now. There is likely going to be some modifications as part of #242

Comment on lines +30 to +32
"relatedImages": [
{}
]
Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove "relatedImages" entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like spec.relatedImages field is not optional:

condition "Unpacked" is False/UnpackFailed; message: "create bundle metadata objects: applying bundle metadata \"test-catalog-prometheusoperator.0.47.0\": BundleMetadata.catalogd.operatorframework.io \"test-catalog-prometheusoperator.0.47.0\" is invalid: spec.relatedImages: Invalid value: \"null\": spec.relatedImages in body must be of type array: \"null\""

Admittedly I'd have preferred to keep it at "relatedImages": [] but even that is read as null, and had to do some json jujitsu to come up with [{}]

Copy link
Contributor

Choose a reason for hiding this comment

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

^ Shouldn't be an issue after operator-framework/catalogd#38 is done

Copy link
Member

Choose a reason for hiding this comment

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

This is a bug in catalogd. We should not require relatedImages to be populated. In fact, I would argue that [{}] is more invalid because it is saying "here's a related image. it's image is "" and it's name is "".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll have to create a follow up issue to fix this.

test/e2e/install_test.go Outdated Show resolved Hide resolved
test/e2e/install_test.go Outdated Show resolved Hide resolved
closes operator-framework#215

Signed-off-by: Anik <anikbhattacharya93@gmail.com>
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/approve

@joelanford joelanford merged commit 4391c50 into operator-framework:main Jun 5, 2023
5 checks passed
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 6, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 6, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 6, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
everettraven added a commit to everettraven/operator-controller that referenced this pull request Jun 6, 2023
… tests

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
awgreene pushed a commit to awgreene/operator-controller that referenced this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e flake: [FAILED] Operator Install when An operator is installed from an operator catalog
4 participants