tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

Whitelisting fields to keep on decommission doesn't work #363

Closed thenaterhood closed 9 years ago

thenaterhood commented 9 years ago

Whitelisting attribute fields using keepSomeMetaOnRepurpose doesn't appear to work. Tried with a few combinations of options, with and without deleteMetaOnDecommission which appears to ignore the option and just remove everything (tracing the logic through the code), and without which appears from the code that it should observe the whitelist but instead doesn't remove anything at all.

We're trying to use it in conjunction with deleteIpAddressOnDecommission and deleteIpmiOnDecommision.

Using a blacklist (deleteSomeMetaOnRepurpose) works as expected, which we're considering using in the interim. The relevant section of our configuration, which does not work, is:

features {
    deleteIpmiOnDecommission = true
    deleteIpAddressOnDecommission = true
    keepSomeMetaOnRepurpose = [COST, INVOICE_NUMBER]
    useWhiteListOnRepurpose = true
}

Of note, the feature is documented in the config documentation but there is no associated example in the collins configuration examples that we've found. We're using a build of collins from master as of a couple weeks ago.

papaben commented 9 years ago

It looks like you're using a capital "L" inuseWhiteListOnRepurpose. The code expects Whitelist. Did you try with both?

yl3w commented 9 years ago

Apologies for the delay @thenaterhood . Thanks @asheepapart.

Nate, did you verify the config you are using. As Benjamin says, the code does expect useWhitelistOnRepurpose

yl3w commented 9 years ago

Please reopen if issue is unresolved for you.

thenaterhood commented 9 years ago

It looks like a lowercase "L" should work fine. I would like to point out that the documentation lists the option with a capital "L" however whenever it is mentioned.

william-richard commented 9 years ago

I think the confusion comes from the fact that the configuration is useWhitelistOnRepurpose, but the variables in the code are useWhiteListOnRepurpose, and the base dev config file has the wrong value too. I'll go through and fix up the example conf, and fix the docs.

william-richard commented 9 years ago

https://github.com/tumblr/collins/pull/365 https://github.com/tumblr/collins/pull/366