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 devfile registry entry name and ingress url #203

Merged

Conversation

michael-valdron
Copy link
Member

Please specify the area for this PR

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

Fixes the devfile registry entry name for registry viewer component of the helm chart. Fixed name 'Community' changed to value of {{ template "devfileregistry.name" . }} (the deployment name).

Additionally, the ingress url is now define and built under _template.tpl: https://github.com/michael-valdron/devfile-registry-support/blob/1df84bc08021587d954a3f6749699d77b40aaf28/deploy/chart/devfile-registry/templates/_template.tpl#L20-L27

Currently, this is only built from the ingress domain for k8s and devfile/api#1467 needs resolving to either separate this field or not rely on manually setting the domain for OpenShift environments.

Which issue(s) this PR fixes:

Fixes #?

fixes devfile/api#1433

PR acceptance criteria:

  • Test Coverage
    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?

Documentation (WIP)

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot requested a review from elsony March 5, 2024 17:25
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.23%. Comparing base (dd51121) to head (aafd64e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #203   +/-   ##
=======================================
  Coverage   27.23%   27.23%           
=======================================
  Files           7        7           
  Lines        2012     2012           
=======================================
  Hits          548      548           
  Misses       1417     1417           
  Partials       47       47           

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

@michael-valdron michael-valdron force-pushed the chart/fix-dr-entry-name branch 2 times, most recently from 414b63f to 65a1c02 Compare March 5, 2024 20:32
@michael-valdron michael-valdron force-pushed the chart/fix-dr-entry-name branch from 9e42554 to aafd64e Compare March 5, 2024 21:30
@michael-valdron
Copy link
Member Author

Documentation (WIP)

Does the REST API doc need to be updated with your changes?
Does the registry library doc need to be updated with your changes?

No changes needed.

@@ -17,6 +17,20 @@
{{- .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- end -}}

{{- define "devfileregistry.ingressHostname" -}}
{{- $hostname := .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- .Values.global.ingress.domain | printf "%s.%s" $hostname -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this format differ than the one from devfile/registry-operator#80? On the operator side the hostname is {hostName}.{ingressDomain} but here it looks like {ingressDomain}.{hostName}. Is this the case and if so does it matter or should they be identical in formatting?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Jdubrick The piping {{- .Values.global.ingress.domain | printf "%s.%s" $hostname -}} passes .Values.global.ingress.domain into the last argument of printf, so its still {hostName}.{ingressDomain}. I guess I could do {{- printf "%s.%s" $hostname .Values.global.ingress.domain -}} instead since the piping seems unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I was under the impression it was going first, in that case I think it's all good, the piping gets the job done I just misunderstood.

Copy link
Contributor

@Jdubrick Jdubrick 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 Mar 6, 2024
Copy link

openshift-ci bot commented Mar 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, 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:
  • OWNERS [Jdubrick,michael-valdron]

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

@michael-valdron michael-valdron merged commit ffc3a09 into devfile:main Mar 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set entry name of tied devfile registry to app name under helm chart
2 participants