Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed: Delay setting initial cluster #7517

Merged
merged 1 commit into from
Mar 16, 2017

Conversation

jsok
Copy link
Contributor

@jsok jsok commented Mar 16, 2017

embed.NewConfig() sets the initial cluster from name but we should clear it in the event that another discovery option has been specified.

Fixes #7516

embed/config.go Outdated
@@ -246,6 +245,9 @@ func (cfg *configYAML) configFromFile(path string) error {
cfg.ACUrls = []url.URL(u)
}

if (cfg.Durl == "" && cfg.DNSCluster == "") && cfg.InitialCluster == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

probably have cfg.InitialCluster == cfg.InitialClusterFromName(DefaultName) instead of == "" and keep the InitialCluster line in NewConfig? otherwise the default will be blank for non-yaml cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍
Have left the default and instead clear it once we have parsed the config.

@jsok jsok force-pushed the 7516-discovery-flags branch 2 times, most recently from c18262d to 0dd8f4f Compare March 16, 2017 02:57
NewConfig() should sets initial cluster from name but we should clear it
in the event that another discovery option has been specified.

Fixes etcd-io#7516
@codecov-io
Copy link

codecov-io commented Mar 16, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@d78b03f). Click here to learn what that means.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #7517   +/-   ##
=========================================
  Coverage          ?   70.66%           
=========================================
  Files             ?      320           
  Lines             ?    26205           
  Branches          ?        0           
=========================================
  Hits              ?    18518           
  Misses            ?     6246           
  Partials          ?     1441
Impacted Files Coverage Δ
embed/config.go 70.3% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d78b03f...1a91ed0. Read the comment docs.

@heyitsanthony
Copy link
Contributor

lgtm

@xiang90 xiang90 merged commit 5015480 into etcd-io:master Mar 16, 2017
jsok added a commit to jsok/etcd that referenced this pull request Mar 28, 2017
NewConfig() sets an initial cluster (potentially using a default name)
but we should clear it in the event another discovery option has been
specified.

PR etcd-io#7517 attempted to address this however it only worked if the name
was left as "default".

(Completely) Fixes etcd-io#7516
@jsok jsok deleted the 7516-discovery-flags branch March 28, 2017 05:31
jsok added a commit to jsok/etcd that referenced this pull request Mar 30, 2017
NewConfig() sets an initial cluster (potentially using a default name)
but we should clear it in the event another discovery option has been
specified.

PR etcd-io#7517 attempted to address this however it only worked if the name
was left as "default".

(Completely) Fixes etcd-io#7516
jsok added a commit to jsok/etcd that referenced this pull request Mar 30, 2017
NewConfig() sets an initial cluster (potentially using a default name)
but we should clear it in the event another discovery option has been
specified.

PR etcd-io#7517 attempted to address this however it only worked if the name
was left as "default".

(Completely) Fixes etcd-io#7516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants