【问题标题】:How to unfreeze cookbook如何解冻食谱
【发布时间】:2018-11-21 13:50:00
【问题描述】:

我发现通过 berks 上传意外冻结厨师中的食谱的能力。能够防止更改并上传到食谱听起来很棒。但是……

如何解冻食谱?我找不到任何文档或任何帖子问这个问题。对于为什么,您为什么要这样做……这听起来可能违反直觉?你发布了你的食谱,你不应该改变历史。

但是,如果您遇到生产紧急情况并且该版本的食谱破坏了一切,该怎么办。第一个答案可能是,继续前进并解决问题——但这可能需要一段时间。第二个答案可能是,将固定版本更改为以前的版本 --- 但是如果您有 50 本书固定到该版本怎么办?也不实用。

能够解冻某些东西似乎非常有用。是的,您可以使用 -f 选项强制更新。但是,必须在未来无限期地强制更新每一个变化听起来很笨拙而且不合适。尤其是当有人不小心冻结了一本食谱时(比如我的例子)。

【问题讨论】:

    标签: chef-infra berkshelf


    【解决方案1】:

    您可以强制上传新版本,并将冻结标志设置为 false。我们没有特别公开这一点或让它变得容易,因为它有点违背了这一点。更好的解决方案是使用 SemVer pinning 而不是单一版本,或者使用更新的 Policyfile 系统。

    【讨论】:

      【解决方案2】:

      当您不小心冻结了食谱版本时,您可以使用 berks upload --force。我不明白你不使用 force 选项的意思。

      $ berks help upload
      Usage:
        berks upload [COOKBOOKS]
      
      Options:
        -b, [--berksfile=PATH]                               # Path to a Berksfile to operate off of.
        -e, [--except=one two three]                         # Exclude cookbooks that are in these groups.
        -o, [--only=one two three]                           # Only cookbooks that are in these groups.
            [--no-freeze], [--no-no-freeze]                  # Do not freeze uploaded cookbook(s).
            [--force]                                        # Upload all cookbooks even if a frozen one exists on the Chef Server.
            [--ssl-verify], [--no-ssl-verify]                # Disable/Enable SSL verification when uploading cookbooks.
        -s, [--skip-syntax-check], [--no-skip-syntax-check]  # Skip Ruby syntax check when uploading cookbooks.
            [--halt-on-frozen], [--no-halt-on-frozen]        # Exit with a non zero exit code if the Chef Server already has the version of the cookbook(s).
        -c, [--config=PATH]                                  # Path to Berkshelf configuration to use.
        -F, [--format=FORMAT]                                # Output format to use.
                                                             # Default: human
        -q, [--quiet], [--no-quiet]                          # Silence all informational output.
        -d, [--debug], [--no-debug]                          # Output debug information
      

      【讨论】:

        【解决方案3】:

        只需删除该食谱的版本并重新加载。试试下面:

        knife cookbook delete <cookbook name>
        knife cookbook upload <cookbook name>
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-07-17
          • 2016-09-22
          • 1970-01-01
          • 2014-11-06
          • 1970-01-01
          • 2015-01-25
          • 2021-07-28
          • 1970-01-01
          相关资源
          最近更新 更多