Skip to content

Commit

Permalink
Merge pull request #92 from atlassian-labs/mzhong/fix-observer-segfault
Browse files Browse the repository at this point in the history
remove unused commandline flag from observer
  • Loading branch information
MinyiZ authored Jan 22, 2025
2 parents 913fc99 + aa52669 commit f1dcf53
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
38 changes: 18 additions & 20 deletions cmd/observer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ var (

// app type holds options for the application from cobra
type app struct {
namespaces *[]string
cloudProviderName *string
namespace *string
addr *string
dryMode *bool
runImmediately *bool
runOnce *bool
checkInterval *time.Duration
waitInterval *time.Duration
nodeStartupTime *time.Duration
prometheusScrapeInterval *time.Duration
namespaces *[]string
cloudProviderName *string
namespace *string
addr *string
dryMode *bool
runImmediately *bool
runOnce *bool
checkInterval *time.Duration
waitInterval *time.Duration
nodeStartupTime *time.Duration
}

// newApp creates a new app and sets up the cobra flags
Expand Down Expand Up @@ -115,15 +114,14 @@ func (a *app) run() {
}

options := observer.Options{
CNRPrefix: "observer",
Namespace: *a.namespace,
CheckInterval: *a.checkInterval,
DryMode: *a.dryMode,
RunImmediately: *a.runImmediately,
RunOnce: *a.runOnce,
WaitInterval: *a.waitInterval,
NodeStartupTime: *a.nodeStartupTime,
PrometheusScrapeInterval: *a.prometheusScrapeInterval,
CNRPrefix: "observer",
Namespace: *a.namespace,
CheckInterval: *a.checkInterval,
DryMode: *a.dryMode,
RunImmediately: *a.runImmediately,
RunOnce: *a.runOnce,
WaitInterval: *a.waitInterval,
NodeStartupTime: *a.nodeStartupTime,
}

go awaitStopSignal(stopCh)
Expand Down
2 changes: 0 additions & 2 deletions docs/automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ Flags:
--node-startup-time duration duration to wait after a cluster-autoscaler scaleUp event is detected (default 2m0s)
--now makes the check loop run straight away on program start rather than wait for the check interval to elapse
--once run the check loop once then exit. also works with --now
--prometheus-address string Prometheus service address used to query cluster-autoscaler metrics (default "prometheus")
--prometheus-scrape-interval duration Prometheus scrape interval used to detect change of value from prometheus query, needed to detect scaleUp event (default 40s)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr
Expand Down
7 changes: 3 additions & 4 deletions pkg/observer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ type Options struct {
RunImmediately bool
RunOnce bool

CheckInterval time.Duration
WaitInterval time.Duration
NodeStartupTime time.Duration
PrometheusScrapeInterval time.Duration
CheckInterval time.Duration
WaitInterval time.Duration
NodeStartupTime time.Duration
}

// ListedNodeGroups defines a type that contains a NodeGroup, a List of Nodes for that NodeGroup, and an optional Reason for why they are there
Expand Down

0 comments on commit f1dcf53

Please sign in to comment.