This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
feat(certs): create MRC on install #4747
Merged
+382
−92
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3b4e1ed
feat(certs): create MRC on install
jaellio 56e7537
Rebase
jaellio 3260809
Updated tests and removed last applied annotation
jaellio ee27ae8
Update MRC listing
jaellio 9dd1784
Add annotation on create
jaellio 5d30cc5
PR feedback
jaellio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: preset-mesh-root-certificate | ||
namespace: {{ include "osm.namespace" . }} | ||
data: | ||
preset-mesh-root-certificate.json: | | ||
{ | ||
"provider": { | ||
{{- if eq (.Values.osm.certificateProvider.kind | lower) "tresor"}} | ||
"tresor": { | ||
"ca": { | ||
"secretRef": { | ||
"name": {{.Values.osm.caBundleSecretName | mustToJson}}, | ||
"namespace": "{{include "osm.namespace" .}}" | ||
} | ||
} | ||
} | ||
{{- end}} | ||
{{- if eq (.Values.osm.certificateProvider.kind | lower) "cert-manager"}} | ||
"certManager": { | ||
"issuerName": {{.Values.osm.certmanager.issuerName | mustToJson}}, | ||
"issuerKind": {{.Values.osm.certmanager.issuerKind | mustToJson}}, | ||
"issuerGroup": {{.Values.osm.certmanager.issuerGroup | mustToJson}} | ||
} | ||
{{- end}} | ||
{{- if eq (.Values.osm.certificateProvider.kind | lower) "vault"}} | ||
"vault": { | ||
"token": { | ||
"secretKeyRef": { | ||
"name": {{.Values.osm.vault.secret.name | mustToJson}}, | ||
"key": {{.Values.osm.vault.secret.key | mustToJson}}, | ||
"namespace": "{{include "osm.namespace" .}}" | ||
} | ||
}, | ||
"host": {{.Values.osm.vault.host | mustToJson}}, | ||
"role": {{.Values.osm.vault.role | mustToJson}}, | ||
"protocol": {{.Values.osm.vault.protocol | mustToJson}}, | ||
"port": {{.Values.osm.vault.port | mustToJson}} | ||
} | ||
{{- end}} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 function returns an error, so prefer to return the error vs log.Fatal.
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.
Good point. I was following the same pattern we have for the MeshConfig, but that makes sense. For my own understanding, should a fatal log only be used when a function doesn't return an error? I would consider this error irrecoverable and I think log.Fatal fits here in that sense.
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.
Ya I'd say that I try to keep errors opaque. So there's either an error or a warning. A warning might get logged (but not returned), and the caller can decide what to do when the call to the function fails.
ie: an error just means the call failed, the caller decides what to do.
Another rule that's touted a lot is: only panic/exit in package main. All other packages should return errors. The typical exception is convenience functions that begin with
Must
, ie:text.MustParse