-
Notifications
You must be signed in to change notification settings - Fork 65
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
allow overriding release name #416
Conversation
8945aa8
to
ba7c15b
Compare
@vhdirk The goal of #252 is for the subject alternative names of the example certificates to always match the Hono service names, so that we can enable hostname verification in the clients. With the release name being part of the service name, matching names cannot be guaranteed. Therefore the discussion in #252 lead to the plan to remove the release name from the Hono service names, meaning service names are fixed (see #252 (comment)). In your PR here, this approach is not taken. Can you explain what the relation to #252 is? Just looking at the PR changes itself, I see that these would harmonize K8s resource naming with the approach taken in the ditto chart. This would mean that in the cloud2edge chart, service names would then be
and not
any more, making the naming clearer. This will need changes in the cloud2edge chart as well though (e.g. in scripts invoking the services). Therefore we have to think about versioning and compatibility here. (To stay compatible with the cloud2edge chart, we would even have to make this change here a major version jump. I guess we could consider adapting the cloud2edge chart Hono requirements version range though (to ~2.1.0), requiring only a minor version jump here.) |
When asking on gitter if there was an option to override the release name, I was pointed to #252, which is why I referenced it. I can't imagine removing the prefix altogether would be the only option with regard to hostname verification? |
I am sorry, that was my fault. I had simply thought that we could kill two birds with one stone. However, I guess this PR has value on its own, even if it does not address the host name verification problem itself. I agree with @calohmn that we need be transparent about backward compatibility (or the lack thereof) by means of choosing a proper version number increase. @calohmn apart from the version and corresponding release notes entry, is there anything else that needs to be changed?
Probably not, I am currently thinking in the direction to (dynamically) create the demo certificates by means of cert-manager, i.e. making cert-manager a pre-requisite for the Hono chart when using demo certs. |
@@ -48,6 +48,6 @@ spec: | |||
volumes: | |||
- name: post-install-data | |||
configMap: | |||
name: {{ printf "%s-post-install-device-registry-conf" .Release.Name }} | |||
name: {{ include "hono.fullname" . }}"-post-install-device-registry-conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this produces "hono\"-post-install-device-registry-conf\"
which causes the deployment test to fail
I suggest to use
name: {{ printf "%s-post-install-device-registry-conf" ( include "hono.fullname" . ) }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it for al occurrences of the same thing
b36216b
to
d705224
Compare
@@ -74,5 +74,5 @@ spec: | |||
volumes: | |||
- name: conf | |||
configMap: | |||
name: {{ printf "%s-%s-conf" .Release.Name $args.name }} | |||
name: {{ printf "%s-%s-conf" (include "hono.name" .) $args.name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason why you are using "hono.name"
here instead of "hono.fullname"
?
IMHO this is the reason for the deployment tests to still fail ...
I guess the other places in this file where "hono.name"
is used also need to be updated ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I took inspiration from the ditto helm chart, that is all. I'll change all occurrences
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
charts/hono/Chart.yaml
Outdated
@@ -15,7 +15,7 @@ name: hono | |||
description: | | |||
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and | |||
interacting with them in a uniform way regardless of the device communication protocol. | |||
version: 2.1.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding cloud2edge compatibility, we have 2 options here:
- use version
3.0.0
here. That means the current cloud2edge chart won't reference it (^2.1.0
used there now). - use version
2.2.0
here and first create a new cloud2edge chart version that only changes the Hono dependency requirement from^2.1.0
to~2.1.0
.
I would tend towards the 2nd option here. Having just the patch-level version range in the cloud2edge chart offers more flexibility regarding Hono chart changes affecting the cloud2edge chart, without having to do a major version jump of the Hono chart each time.
@sophokles73 WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also gravitate more towared the second option here.
charts/hono/Chart.yaml
Outdated
@@ -15,7 +15,7 @@ name: hono | |||
description: | | |||
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and | |||
interacting with them in a uniform way regardless of the device communication protocol. | |||
version: 2.1.5 | |||
version: 2.1.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vhdirk Can you also add an entry in the Release Notes
section of the README.md
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Changed to v2.2.0 as per #416 (comment)
charts/hono/templates/_helpers.tpl
Outdated
@@ -102,7 +102,7 @@ The scope passed in is expected to be a dict with keys | |||
- "component": the value to use for the "app.kubernetes.io/component" label | |||
*/}} | |||
{{- define "hono.metadata" -}} | |||
name: {{ printf "%s-%s" .dot.Release.Name .name | quote }} | |||
name: {{ printf "%s-%s" (include "hono.fullname" .dot ) .name | quote }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are still some more replacements like this needed:
- the pod list in
NOTES.txt
- data-grid server name in
hono-data-grid.xml
- host entries in
qdrouterd.json
HTTP_BASE_URL
inadd_example_data_device_registry.sh
{{ .Release.Name }}-kafka-example-keys
invalues.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@vhdirk with all the discussion around whether this PR actually helps with fixing the SAN verification problem, I have lost track of what this PR actually tries to achieve. Would you mind creating a dedicated issue describing the lacking functionality and/or problems with the currently implemented naming strategy? We can then better assess, if your PR goes in the right direction or should better take another route to achieving the goal. |
@sophokles73 no problem, that's perfectly understandable. I've created #430 and linked this PR to it |
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
3380233
to
ef29280
Compare
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
e3560df
to
a535abb
Compare
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
6a0902d
to
5cf3ad4
Compare
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
@@ -15,7 +15,7 @@ name: hono | |||
description: | | |||
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and | |||
interacting with them in a uniform way regardless of the device communication protocol. | |||
version: 2.2.0 | |||
version: 2.2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a 2.2.1 version now. Can you rebase? As discussed in an earlier comment, this should better be 2.3.0 here.
@@ -11,7 +11,7 @@ | |||
# SPDX-License-Identifier: EPL-2.0 | |||
# | |||
apiVersion: v1 | |||
version: 0.4.0 | |||
version: 0.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes of the cloud2edge
chart here should go in a separate PR, to be created once this PR has been merged. This will ensure that the tests for the cloud2edge chart PR will actually run using the Hono chart changes of this PR.
{{- define "hono.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- $fullnameOverride := .dot.Values.fullnameOverride -}} | ||
{{- if $fullnameOverride -}} | ||
{{- (tpl $fullnameOverride .dot) | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- $nameOverride := .dot.Values.nameOverride -}} | ||
{{- $name := empty $nameOverride | ternary .dot.Chart.Name (tpl $nameOverride .dot) -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the motivation for the change towards requiring a dict with the dot
key here (instead of the top-level .
scope as before)? This makes this PR quite big (and there are occurrences of include "hono.fullname" .
that haven't been replaced yet).
I also wonder whether the tpl
function really needs to be used here.
Same applies also to the hono.name
, hono.chart
and hono.std.labels
named templates.
@vhdirk can we close this PR? |
Closing this PR as this feature was merged via #469. |
Fixes #430
Signed-off-by: Dirk Van Haerenborgh [email protected]