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

Fix registry viewer host alias resolution #51

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

kim-tsao
Copy link
Contributor

@kim-tsao kim-tsao commented Sep 20, 2023

Please specify the area for this PR

What does does this PR do / why we need it:

  • Removes the configmap and volume mounts to pick up the ENV variables for the registry-viewer since this never worked
  • Environment variables are specified in the deployment spec and updated if there is a patch
  • Added a new DevfileRegistry controller test case with supported test environment types:
    • The controller test is limited to just CRD creation and updates since we can't rely on a successful status update. This depends on a valid DevfileRegistry route being created and resolved. We may want to consider mocking this in the future.
    • Added a local Route CRD similar to what HAS did in order to get the tests to recognize this kind

Which issue(s) this PR fixes:
devfile/api#1028

Fixes #?

PR acceptance criteria:

  • Change Log

  • Test Coverage

    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?
      • Manually tested by deploying on a local cluster and verifying the FQDN in the viewer gets updated.
      • Updated deployment (changed other properties like the write key) and verified the ENV var got properly updated (while FQDN remained unchanged)
  • Gosec scans

Documentation

  • Does the registry operator documentation need to be updated with your changes?

How to test changes / Special notes to the reviewer:

Signed-off-by: Kim Tsao <ktsao@redhat.com>
@kim-tsao kim-tsao requested review from michael-valdron and johnmcollier and removed request for feloy and thepetk September 20, 2023 15:12
Signed-off-by: Kim Tsao <ktsao@redhat.com>
Signed-off-by: Kim Tsao <ktsao@redhat.com>
controllers/suite_test.go Outdated Show resolved Hide resolved
controllers/suite_test.go Outdated Show resolved Hide resolved
controllers/suite_test.go Outdated Show resolved Hide resolved
@kim-tsao kim-tsao changed the title Fix registry viewer host alias resolution [WIP] Fix registry viewer host alias resolution Sep 21, 2023
Signed-off-by: Kim Tsao <ktsao@redhat.com>
Signed-off-by: Kim Tsao <ktsao@redhat.com>
@kim-tsao kim-tsao changed the title [WIP] Fix registry viewer host alias resolution Fix registry viewer host alias resolution Sep 21, 2023
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: +3.14% 🎉

Comparison is base (46fe9e0) 22.72% compared to head (20eeb41) 25.86%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   22.72%   25.86%   +3.14%     
==========================================
  Files          23       25       +2     
  Lines        1307     1415     +108     
==========================================
+ Hits          297      366      +69     
- Misses        995     1026      +31     
- Partials       15       23       +8     
Files Changed Coverage Δ
controllers/devfileregistry_controller.go 0.00% <0.00%> (ø)
controllers/ensure.go 0.00% <ø> (ø)
controllers/update.go 0.00% <0.00%> (ø)
pkg/registry/deployment.go 0.00% <ø> (ø)

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michael-valdron
Copy link
Member

Removed since #49 was merged.

  • Does the registry operator documentation need to be updated with your changes?

No documentation changes needed.

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

Ran the manager build of this branch on both OpenShift (crc) and Kubernetes (minikube), the changes fixes this bug on both! Just left a few minor feedback comments.

controllers/update.go Outdated Show resolved Hide resolved
Signed-off-by: Kim Tsao <ktsao@redhat.com>
Copy link
Member

@michael-valdron michael-valdron 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 label Sep 22, 2023
@openshift-ci
Copy link

openshift-ci bot commented Sep 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kim-tsao, michael-valdron

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kim-tsao kim-tsao merged commit 53db91b into devfile:main Sep 22, 2023
8 of 9 checks passed
thepetk pushed a commit to thepetk/devfile-registry-operator that referenced this pull request Aug 20, 2024
* Fix registry viewer host alias resolution

Signed-off-by: Kim Tsao <ktsao@redhat.com>

* Add a fake kubeconfig to fix CI tests

Signed-off-by: Kim Tsao <ktsao@redhat.com>

* fix path

Signed-off-by: Kim Tsao <ktsao@redhat.com>

* Undo controller test changes

Signed-off-by: Kim Tsao <ktsao@redhat.com>

* update integration tests

Signed-off-by: Kim Tsao <ktsao@redhat.com>

* Address review comments

Signed-off-by: Kim Tsao <ktsao@redhat.com>

---------

Signed-off-by: Kim Tsao <ktsao@redhat.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants