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

Apply newer service_discovery plugin helper methods #3362

Merged
merged 4 commits into from
May 10, 2021
Merged

Commits on May 7, 2021

  1. Apply newer service_discovery plugin helper methods

    Signed-off-by: TAGOMORI Satoshi <tagomoris@gmail.com>
    tagomoris authored and ashie committed May 7, 2021
    Configuration menu
    Copy the full SHA
    909938d View commit details
    Browse the repository at this point in the history
  2. test: Fix an inappropriate expected value type

    Plugin type is a string value, so the test should exepect a string
    value while the previous out_forward code pass a symbol value as a
    service_discovery plugin type by one-off code.
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 7, 2021
    Configuration menu
    Copy the full SHA
    8276600 View commit details
    Browse the repository at this point in the history
  3. test_out_forward: Simplify assertion in a test to make easy to debug

    A test should ensure to have only one assertion because trailing
    assertions aren't evalueated when an assertions is failed. It makes
    debugging hard. Here is an example output of the test:
    
    before:
    
      Failure: test: server is an abbreviation of static type of service_discovery(ForwardOutputTest)
      /home/aho/Projects/Fluentd/fluentd/test/plugin/test_out_forward.rb:282:in `block in <class:ForwardOutputTest>'
      <1234> expected but was
      <1235>
    
      diff:
      ? 1234
      ?    5
    
    after:
    
      Failure: test: server is an abbreviation of static type of service_discovery(ForwardOutputTest)
      /home/aho/Projects/Fluentd/fluentd/test/plugin/test_out_forward.rb:281:in `block in <class:ForwardOutputTest>'
      <[{:host=>"127.0.0.1", :port=>1234}, {:host=>"127.0.0.1", :port=>1235}]> expected but was
      <[{:host=>"127.0.0.1", :port=>1235}, {:host=>"127.0.0.1", :port=>1234}]>
    
      diff:
      ? [{:host=>"127.0.0.1", :port=>1234}, {:host=>"127.0.0.1", :port=>1235}]
      ?                                 5                                  4
    
    The later one is easy to understand that the array is inverted.
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 7, 2021
    Configuration menu
    Copy the full SHA
    a2a9ba0 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2021

  1. service_discovery: Fix prioprity of "server" directive

    "server" directive should have higher priority than "service" in
    "service_discovery" to keep backward compatibility.
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed May 10, 2021
    Configuration menu
    Copy the full SHA
    c04ab95 View commit details
    Browse the repository at this point in the history