Skip to content

Commit 2375fa3

Browse files
committed
address review comments
Signed-off-by: everettraven <[email protected]>
1 parent 4526fcf commit 2375fa3

File tree

9 files changed

+70
-16
lines changed
  • docs/book/src/cronjob-tutorial/testdata/project/cmd
  • pkg/plugins/golang
    • v3/scaffolds/internal/templates
    • v4/scaffolds/internal/templates
  • testdata

9 files changed

+70
-16
lines changed

docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ func main() {
8282
"Enable leader election for controller manager. "+
8383
"Enabling this will ensure there is only one active controller manager.")
8484
flag.BoolVar(&secureMetrics, "metrics-secure", false,
85-
"Whether or not the metrics endpoint should be served securely")
85+
"If set the metrics endpoint is served securely")
8686
flag.BoolVar(&enableHTTP2, "enable-http2", false,
87-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
87+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
8888
opts := zap.Options{
8989
Development: true,
9090
}
@@ -93,6 +93,12 @@ func main() {
9393

9494
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
9595

96+
// if the enable-http2 flag is false (the default), http/2 should be disabled
97+
// due to its vulnerabilities. More specifically, disabling http/2 will
98+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
99+
// Rapid Reset CVEs. For more information see:
100+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
101+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
96102
disableHTTP2 := func(c *tls.Config) {
97103
setupLog.Info("disabling http/2")
98104
c.NextProtos = []string{"http/1.1"}

pkg/plugins/golang/v3/scaffolds/internal/templates/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func main() {
226226
"Enable leader election for controller manager. " +
227227
"Enabling this will ensure there is only one active controller manager.")
228228
flag.BoolVar(&enableHTTP2, "enable-http2", false,
229-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
229+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
230230
{{- else }}
231231
var configFile string
232232
flag.StringVar(&configFile, "config", "",
@@ -243,6 +243,12 @@ func main() {
243243
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
244244
245245
{{ if not .ComponentConfig }}
246+
// if the enable-http2 flag is false (the default), http/2 should be disabled
247+
// due to its vulnerabilities. More specifically, disabling http/2 will
248+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
249+
// Rapid Reset CVEs. For more information see:
250+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
251+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
246252
disableHTTP2 := func(c *tls.Config) {
247253
setupLog.Info("disabling http/2")
248254
c.NextProtos = []string{"http/1.1"}

pkg/plugins/golang/v4/scaffolds/internal/templates/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ func main() {
230230
"Enable leader election for controller manager. " +
231231
"Enabling this will ensure there is only one active controller manager.")
232232
flag.BoolVar(&secureMetrics, "metrics-secure", false,
233-
"Whether or not the metrics endpoint should be served securely")
233+
"If set the metrics endpoint is served securely")
234234
flag.BoolVar(&enableHTTP2, "enable-http2", false,
235-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
235+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
236236
{{- else }}
237237
var configFile string
238238
flag.StringVar(&configFile, "config", "",
@@ -249,6 +249,12 @@ func main() {
249249
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
250250
251251
{{ if not .ComponentConfig }}
252+
// if the enable-http2 flag is false (the default), http/2 should be disabled
253+
// due to its vulnerabilities. More specifically, disabling http/2 will
254+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
255+
// Rapid Reset CVEs. For more information see:
256+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
257+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
252258
disableHTTP2 := func(c *tls.Config) {
253259
setupLog.Info("disabling http/2")
254260
c.NextProtos = []string{"http/1.1"}

testdata/project-v3/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func main() {
6161
"Enable leader election for controller manager. "+
6262
"Enabling this will ensure there is only one active controller manager.")
6363
flag.BoolVar(&enableHTTP2, "enable-http2", false,
64-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
64+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
6565
opts := zap.Options{
6666
Development: true,
6767
}
@@ -70,6 +70,12 @@ func main() {
7070

7171
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7272

73+
// if the enable-http2 flag is false (the default), http/2 should be disabled
74+
// due to its vulnerabilities. More specifically, disabling http/2 will
75+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
76+
// Rapid Reset CVEs. For more information see:
77+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
78+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
7379
disableHTTP2 := func(c *tls.Config) {
7480
setupLog.Info("disabling http/2")
7581
c.NextProtos = []string{"http/1.1"}

testdata/project-v4-multigroup-with-deploy-image/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func main() {
8888
"Enable leader election for controller manager. "+
8989
"Enabling this will ensure there is only one active controller manager.")
9090
flag.BoolVar(&secureMetrics, "metrics-secure", false,
91-
"Whether or not the metrics endpoint should be served securely")
91+
"If set the metrics endpoint is served securely")
9292
flag.BoolVar(&enableHTTP2, "enable-http2", false,
93-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
93+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
9494
opts := zap.Options{
9595
Development: true,
9696
}
@@ -99,6 +99,12 @@ func main() {
9999

100100
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
101101

102+
// if the enable-http2 flag is false (the default), http/2 should be disabled
103+
// due to its vulnerabilities. More specifically, disabling http/2 will
104+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
105+
// Rapid Reset CVEs. For more information see:
106+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
107+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
102108
disableHTTP2 := func(c *tls.Config) {
103109
setupLog.Info("disabling http/2")
104110
c.NextProtos = []string{"http/1.1"}

testdata/project-v4-multigroup/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func main() {
8888
"Enable leader election for controller manager. "+
8989
"Enabling this will ensure there is only one active controller manager.")
9090
flag.BoolVar(&secureMetrics, "metrics-secure", false,
91-
"Whether or not the metrics endpoint should be served securely")
91+
"If set the metrics endpoint is served securely")
9292
flag.BoolVar(&enableHTTP2, "enable-http2", false,
93-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
93+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
9494
opts := zap.Options{
9595
Development: true,
9696
}
@@ -99,6 +99,12 @@ func main() {
9999

100100
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
101101

102+
// if the enable-http2 flag is false (the default), http/2 should be disabled
103+
// due to its vulnerabilities. More specifically, disabling http/2 will
104+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
105+
// Rapid Reset CVEs. For more information see:
106+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
107+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
102108
disableHTTP2 := func(c *tls.Config) {
103109
setupLog.Info("disabling http/2")
104110
c.NextProtos = []string{"http/1.1"}

testdata/project-v4-with-deploy-image/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func main() {
6363
"Enable leader election for controller manager. "+
6464
"Enabling this will ensure there is only one active controller manager.")
6565
flag.BoolVar(&secureMetrics, "metrics-secure", false,
66-
"Whether or not the metrics endpoint should be served securely")
66+
"If set the metrics endpoint is served securely")
6767
flag.BoolVar(&enableHTTP2, "enable-http2", false,
68-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
68+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
6969
opts := zap.Options{
7070
Development: true,
7171
}
@@ -74,6 +74,12 @@ func main() {
7474

7575
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7676

77+
// if the enable-http2 flag is false (the default), http/2 should be disabled
78+
// due to its vulnerabilities. More specifically, disabling http/2 will
79+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
80+
// Rapid Reset CVEs. For more information see:
81+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
82+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
7783
disableHTTP2 := func(c *tls.Config) {
7884
setupLog.Info("disabling http/2")
7985
c.NextProtos = []string{"http/1.1"}

testdata/project-v4-with-grafana/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ func main() {
5959
"Enable leader election for controller manager. "+
6060
"Enabling this will ensure there is only one active controller manager.")
6161
flag.BoolVar(&secureMetrics, "metrics-secure", false,
62-
"Whether or not the metrics endpoint should be served securely")
62+
"If set the metrics endpoint is served securely")
6363
flag.BoolVar(&enableHTTP2, "enable-http2", false,
64-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
64+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
6565
opts := zap.Options{
6666
Development: true,
6767
}
@@ -70,6 +70,12 @@ func main() {
7070

7171
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7272

73+
// if the enable-http2 flag is false (the default), http/2 should be disabled
74+
// due to its vulnerabilities. More specifically, disabling http/2 will
75+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
76+
// Rapid Reset CVEs. For more information see:
77+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
78+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
7379
disableHTTP2 := func(c *tls.Config) {
7480
setupLog.Info("disabling http/2")
7581
c.NextProtos = []string{"http/1.1"}

testdata/project-v4/cmd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func main() {
6363
"Enable leader election for controller manager. "+
6464
"Enabling this will ensure there is only one active controller manager.")
6565
flag.BoolVar(&secureMetrics, "metrics-secure", false,
66-
"Whether or not the metrics endpoint should be served securely")
66+
"If set the metrics endpoint is served securely")
6767
flag.BoolVar(&enableHTTP2, "enable-http2", false,
68-
"Whether or not HTTP/2 should be enabled for the metrics and webhook servers")
68+
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
6969
opts := zap.Options{
7070
Development: true,
7171
}
@@ -74,6 +74,12 @@ func main() {
7474

7575
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7676

77+
// if the enable-http2 flag is false (the default), http/2 should be disabled
78+
// due to its vulnerabilities. More specifically, disabling http/2 will
79+
// prevent from being vulnerable to the HTTP/2 Stream Cancelation and
80+
// Rapid Reset CVEs. For more information see:
81+
// - https://github.com/advisories/GHSA-qppj-fm5r-hxr3
82+
// - https://github.com/advisories/GHSA-4374-p667-p6c8
7783
disableHTTP2 := func(c *tls.Config) {
7884
setupLog.Info("disabling http/2")
7985
c.NextProtos = []string{"http/1.1"}

0 commit comments

Comments
 (0)