From 40590071d9500ed572cf590f538057b2cf43010e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 14 Nov 2023 14:13:01 +0100 Subject: [PATCH] Fix: Rename parameter to better match functionality Signed-off-by: Knut Ahlers --- README.md | 9 +++++++++ main.go | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4beec14..5d15d34 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ This repository contains a manager which health-checks given endpoints and gener ## Configuration +```console +# ipt-loadbalancer --help +Usage of ipt-loadbalancer: + -c, --config string Configuration file to load (default "config.yaml") + -e, --enable-managed-chain Modify PREROUTING / POSTROUTING chain to contain a jump to managed chain + --log-level string Log level (debug, info, warn, error, fatal) (default "info") + --version Prints current version and exits +``` + ### Main Configuration File ```yaml diff --git a/main.go b/main.go index 8eb6e77..9dac1a8 100644 --- a/main.go +++ b/main.go @@ -14,10 +14,10 @@ import ( var ( cfg = struct { - Config string `flag:"config,c" default:"config.yaml" description:"Configuration file to load"` - InsertIntoPrerouting bool `flag:"insert-into-prerouting,i" default:"false" description:"Modify PREROUTING chain to contain a jump to managed chain"` - LogLevel string `flag:"log-level" default:"info" description:"Log level (debug, info, warn, error, fatal)"` - VersionAndExit bool `flag:"version" default:"false" description:"Prints current version and exits"` + Config string `flag:"config,c" default:"config.yaml" description:"Configuration file to load"` + EnableManagedChain bool `flag:"enable-managed-chain,e" default:"false" description:"Modify PREROUTING / POSTROUTING chain to contain a jump to managed chain"` + LogLevel string `flag:"log-level" default:"info" description:"Log level (debug, info, warn, error, fatal)"` + VersionAndExit bool `flag:"version" default:"false" description:"Prints current version and exits"` }{} version = "dev" @@ -63,7 +63,7 @@ func main() { logrus.WithError(err).Fatal("creating managed chain") } - if cfg.InsertIntoPrerouting { + if cfg.EnableManagedChain { if err = ipt.EnableMangedRoutingChains(); err != nil { logrus.WithError(err).Fatal("enabling routing") }