Skip to content

feat: Add --host as a command line flag#2227

Merged
ritazh merged 4 commits into
open-policy-agent:masterfrom
maxsmythe:host-flag
Aug 23, 2022
Merged

feat: Add --host as a command line flag#2227
ritazh merged 4 commits into
open-policy-agent:masterfrom
maxsmythe:host-flag

Conversation

@maxsmythe
Copy link
Copy Markdown
Contributor

Signed-off-by: Max Smythe smythe@google.com

What this PR does / why we need it:

Fixes #2097

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

@maxsmythe maxsmythe requested review from ritazh and sozercan August 16, 2022 01:31
@maxsmythe maxsmythe changed the title Add --host as a command line flag feat: Add --host as a command line flag Aug 16, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 16, 2022

Codecov Report

Merging #2227 (a5292ef) into master (dfa6b33) will increase coverage by 0.16%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2227      +/-   ##
==========================================
+ Coverage   54.37%   54.53%   +0.16%     
==========================================
  Files         111      111              
  Lines        9553     9553              
==========================================
+ Hits         5194     5210      +16     
+ Misses       3959     3947      -12     
+ Partials      400      396       -4     
Flag Coverage Δ
unittests 54.53% <ø> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/readiness/list.go 79.41% <0.00%> (-11.77%) ⬇️
pkg/readiness/object_tracker.go 83.98% <0.00%> (+1.06%) ⬆️
...onstrainttemplate/constrainttemplate_controller.go 59.95% <0.00%> (+4.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread main.go
healthAddr = flag.String("health-addr", ":9090", "The address to which the health endpoint binds.")
metricsAddr = flag.String("metrics-addr", "0", "The address the metric endpoint binds to.")
port = flag.Int("port", 443, "port for the server. defaulted to 443 if unspecified ")
host = flag.String("host", "", "the host address the webhook server listens on. defaults to all addresses.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could. I took a look and port is missing as well.

IMO we should also be careful about not documenting every flag, since they are also self-documented via the --help command, but rather highlight the most interesting flags that users might not know to search for.

Since host and port are fairly common customizations, should they qualify here?

Copy link
Copy Markdown
Member

@sozercan sozercan Aug 19, 2022

Choose a reason for hiding this comment

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

I agree with you for gator but for gatekeeper it's not self-documenting as we don't ship gatekeeper as a binary and it's not something that users would use directly from their terminal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docker run openpolicyagent/gatekeeper:v3.10.0-beta.0 --help prints out flags. Would it be better to document that as a way of getting the full list of options?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

docker run openpolicyagent/gatekeeper:v3.10.0-beta.0 --help prints out flags. Would it be better to document that as a way of getting the full list of options?

+1 on adding this to the customize-startup doc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

Signed-off-by: Max Smythe <smythe@google.com>
Signed-off-by: Max Smythe <smythe@google.com>
Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

@ritazh ritazh merged commit 7d71639 into open-policy-agent:master Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--bind-addr flag to control the address configured for ctrl.Options.Host

4 participants