-
Notifications
You must be signed in to change notification settings - Fork 408
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
Adds Envoy Bootstrap Config #206
Conversation
address: | ||
socket_address: | ||
address: {{ .XdsServerAddress }} | ||
port_value: 18000 |
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.
should be templated
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.
#212 tracks this requirement.
Codecov Report
@@ Coverage Diff @@
## main #206 +/- ##
==========================================
- Coverage 63.60% 63.23% -0.37%
==========================================
Files 27 27
Lines 2349 2358 +9
==========================================
- Hits 1494 1491 -3
- Misses 768 776 +8
- Partials 87 91 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: danehans <daneyonhansen@gmail.com>
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.
bootstrap looks good to me
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.
Some nits that you can choose to ignore. On the whole, lgtm.
// envoyHTTPPort is the container port number of Envoy's HTTP endpoint. | ||
envoyHTTPPort = int32(8080) | ||
// envoyHTTPSPort is the container port number of Envoy's HTTPS endpoint. | ||
envoyHTTPSPort = int32(8443) | ||
) | ||
|
||
var bootstrapTmpl = template.Must(template.New(envoyCfgFileName).Parse(` |
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'd consider putting this in a separate bootstrap.yaml
file and saying
//go:embed bootstrap.yaml
const string bootstrapTmplStr
var bootstrapTmpl = template.Must(template.New(envoyCfgFileName).Parse(bootstrapTmplStr))
so that the file is easier to edit, with editors recognizing it as yaml.
buf := new(bytes.Buffer) | ||
if err := bootstrapTmpl.Execute(buf, b.parameters); err != nil { | ||
return fmt.Errorf("failed to render bootstrap config: %v", err) | ||
} | ||
b.rendered = buf.String() |
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.
If we never need access it as a []byte
or mutate it (other than append), then it'd be more efficient to use a strings.Builder
instead of a bytes.Buffer
.
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.
Adds support for managing Envoy's bootstrap config through a ConfigMap.
Fixes: #201
Signed-off-by: danehans daneyonhansen@gmail.com