Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Add IgnoreListenMetricsURLs option
Browse files Browse the repository at this point in the history
  • Loading branch information
granular-ryanbonham committed Nov 24, 2020
1 parent 9becd1b commit c781d9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions pkg/etcd/etcdprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ type etcdProcess struct {

// ListenMetricsURLs is the set of urls we should listen for metrics on
ListenMetricsURLs []string

// IgnoreListenMetricsURLs if this is set, we will not set Metrics URL even if ENV is set.
IgnoreListenMetricsURLs bool
}

func (p *etcdProcess) ExitState() (error, *os.ProcessState) {
Expand Down Expand Up @@ -269,6 +272,10 @@ func (p *etcdProcess) Start() error {
}
}

//IgnoreListenMetricsURLs
if p.IgnoreListenMetricsURLs {
delete(env, "ETCD_LISTEN_METRICS_URLS")
}
for k, v := range env {
c.Env = append(c.Env, k+"="+v)
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/etcd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ func RunEtcdFromBackup(backupStore backup.Store, backupName string, basedir stri
ClusterToken: clusterToken,
Nodes: []*protoetcd.EtcdNode{myNode},
},
MyNodeName: myNodeName,
ListenAddress: "127.0.0.1",
DisableTLS: false,
IgnoreListenMetricsURLs: true, // Do not Set ListenMetricsURLs for restore to avoid port conflicts
MyNodeName: myNodeName,
ListenAddress: "127.0.0.1",
DisableTLS: false,
}

var etcdClientsCA *pki.Keypair
Expand Down

0 comments on commit c781d9c

Please sign in to comment.