Uploaded image for project: 'Cookbooks'
  1. Cookbooks
  2. COOK-93

Do not unconditionally set node.default['hadoop']['distribution_version']

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: hadoop
    • Labels:
      None
    • Rank:
      1|hzzax3:

      Description

      I have a wrapper cookbook (of hadoop) that itself wishes to be wrapped. My use case is to establish a "generic" hadoop install for internal company applications. By committing to decisions that aren't necessarily appropriate for the community at large (but still internally acceptable) I am able to add desirable non-trivial application-agnostic features like service discovery and orchestration.

      Being a wrapper cookbook that itself wishes to be wrapped, my cookbook tries to express configuration with only default attributes. Your hadoop cookbook generally plays well with this strategy.

      However this block from recipes/repo.rb causes a problem:

      node.default['hadoop']['distribution_version'] =
        if node['hadoop']['distribution'] == 'hdp'
          '2.3.4.7'
        elsif node['hadoop']['distribution'] == 'cdh'
          '5.6.0'
        elsif node['hadoop']['distribution'] == 'bigtop'
          '1.0.0'
        end
      

      This unconditionally sets the default value of node['hadoop']['distribution_version'], which prevents my choice of default from taking effect. It seems the issue could be resolved by guarding this assignment with an absence check, similar to other occurrences of attribute logic in the cookbook. Could you add this guard?

        Attachments

          Activity

            People

            • Assignee:
              chris Chris Gianelloni
              Reporter:
              phs Phil Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: