LWRP 和自定义资源是一回事吗?
Are an LWRP and a Custom Resource the same thing?
我对这两个 Chef 术语有点困惑。网上有很多关于 Chef 的讨论 refers to LWRPs, or Lightweight Resource Providers. However, the official Chef docs barely use this term, and do not define it anywhere or have a page about LWRPs. They do, however, have a page about what they call Custom Resources, and there's what I guess was the URL of an old page at https://docs.chef.io/lwrp_custom_resource.html which now redirects to https://docs.chef.io/custom_resources.html。
"LWRP" 和 "Custom Resource" 只是同一概念的不同术语,还是它们具有不同的含义?如果它们是不同的东西,LWRP 是否仍然存在,或者它们是已从 Chef 中删除的过时构造?
是的,我们不再使用术语“LWRP”,因为我们觉得它过于混乱并且没有强调资源是相同的,无论它们来自 Chef 核心还是食谱。编写自定义资源有两种主要“风格”,一种是 resources/
和 providers/
cookbook 目录中的 LWRP-DSL 风格,另一种是 plain-old-Ruby 风格在 libraries/
。但是不管你怎么写资源,它们在底层都是一样的。
我对这两个 Chef 术语有点困惑。网上有很多关于 Chef 的讨论 refers to LWRPs, or Lightweight Resource Providers. However, the official Chef docs barely use this term, and do not define it anywhere or have a page about LWRPs. They do, however, have a page about what they call Custom Resources, and there's what I guess was the URL of an old page at https://docs.chef.io/lwrp_custom_resource.html which now redirects to https://docs.chef.io/custom_resources.html。
"LWRP" 和 "Custom Resource" 只是同一概念的不同术语,还是它们具有不同的含义?如果它们是不同的东西,LWRP 是否仍然存在,或者它们是已从 Chef 中删除的过时构造?
是的,我们不再使用术语“LWRP”,因为我们觉得它过于混乱并且没有强调资源是相同的,无论它们来自 Chef 核心还是食谱。编写自定义资源有两种主要“风格”,一种是 resources/
和 providers/
cookbook 目录中的 LWRP-DSL 风格,另一种是 plain-old-Ruby 风格在 libraries/
。但是不管你怎么写资源,它们在底层都是一样的。