Skip to content

Commit 036788a

Browse files
Close #5642: Added proxy server port customization (#5669)
Signed-off-by: Venkat Ramaraju <[email protected]>
1 parent 93c4a8e commit 036788a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
entries:
2+
- description: >
3+
For ansible-based operators, proxy server port can be changed with the new `proxy-port` flag, which still defaults to 8888.
4+
5+
kind: "addition"
6+
7+
# Is this a breaking change?
8+
breaking: false

internal/ansible/flags/flag.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type Flags struct {
4040
GracefulShutdownTimeout time.Duration
4141
AnsibleArgs string
4242
AnsibleLogEvents string
43+
ProxyPort int
4344

4445
// Path to a controller-runtime componentconfig file.
4546
// If this is empty, use default values.
@@ -169,6 +170,11 @@ func (f *Flags) AddTo(flagSet *pflag.FlagSet) {
169170
"Ansible log events. The log level for console logging."+
170171
" This flag can be set to either Nothing, Tasks, or Everything.",
171172
)
173+
flagSet.IntVar(&f.ProxyPort,
174+
"proxy-port",
175+
8888,
176+
"Ansible proxy server port. Defaults to 8888.",
177+
)
172178
}
173179

174180
// ToManagerOptions uses the flag set in f to configure options.

internal/cmd/ansible-operator/run/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func run(cmd *cobra.Command, f *flags.Flags) {
254254
// start the proxy
255255
err = proxy.Run(done, proxy.Options{
256256
Address: "localhost",
257-
Port: 8888,
257+
Port: f.ProxyPort,
258258
KubeConfig: mgr.GetConfig(),
259259
Cache: mgr.GetCache(),
260260
RESTMapper: mgr.GetRESTMapper(),

0 commit comments

Comments
 (0)