Why is berks install not getting latest cookbook version from Berks API server?

I uploaded my latest linux_role cookbook to my Berks API server, which is just an organization on my Chef server accessed via port 26200. Hence I see

$ knife node show linux_role
linux_role 1.1.80 1.1.79 1.1.78 1.1.77 1.1.76 1.1.75 1.1.74 1.1.72 1.1.71 1.1.70 1.1.69 1.1.68 1.1.67 1.1.66 1.1.65 1.1.64 1.1.63

Now I want to upload v1.1.80 to my Chef server.

First I have to run berks install so I get the cookbook from my Berks API server to my workstation correct? So I do

$ berks install
Installing linux_role (1.1.79) from http://chef-server.domain.com:26200 ([chef_server] https://chef-server.domain.com:443/organizations/berks-api)

Why doesn’t it pick up v1.1.80? How can I make it pick up v1.1.80? I even restarted the berks-api service to no avail.

Here’s my Berksfile
source "http://chef-server.domain.com:26200"
metadata
Here’s the corresponding metadata.rb file
name "top_level_metadata"
depends ‘linux_role’, '~> 1.1.0’
I don’t necessarily want to change the version to ‘= 1.1.80’ because I have other role cookbooks that depends on linux_role, which means I’ll have to update it’s version in their metadata.rb file, which means I have to update their version. Other cookbooks in turn depend on them so… the cycle continues.
What am I missing?
Chris

~> is pessimistic

From the docs[0]:

~>(approximately greater than; also known as “pessimistically greater
than
”, or “pessimistic”),

​That means it will take the lowest version that fits the constraints given.

​If you’re following semantec versioning you could set
depends ‘linux_role’, '>= 1.1.0’
​which should pickup all versions in the 1.1.x range​

[0] ​https://docs.chef.io/config_rb_metadata.html

-Eric Helgeson
@nulleric https://twitter.com/nulleric

On Wed, Aug 19, 2015 at 5:04 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I uploaded my latest linux_role cookbook to my Berks API server, which is
just an organization on my Chef server accessed via port 26200. Hence I see

$ knife node show linux_role

linux_role 1.1.80 1.1.79 1.1.78 1.1.77 1.1.76 1.1.75 1.1.74
1.1.72 1.1.71 1.1.70 1.1.69 1.1.68 1.1.67 1.1.66 1.1.65 1.1.64
1.1.63

Now I want to upload v1.1.80 to my Chef server.

First I have to run berks install so I get the cookbook from my Berks API
server to my workstation correct? So I do

$ berks install
Installing linux_role (1.1.79) from http://chef-server.domain.com:26200
http://chef-server.domain.com:26200
([chef_server] https://chef-server.domain.com:443/organizations/berks-api
https://chef-server.domain.com:443/organizations/berks-api
)

Why doesn’t it pick up v1.1.80? How can I make it pick up v1.1.80? I even
restarted the berks-api service to no avail.

Here’s my Berksfile

source “http://chef-server.domain.com:26200
http://chef-server.domain.com:26200

metadata

Here’s the corresponding metadata.rb file

name “top_level_metadata”

depends ‘linux_role’, ‘~> 1.1.0’

I don’t necessarily want to change the version to ‘= 1.1.80’ because I
have other role cookbooks that depends on linux_role, which means I’ll have
to update it’s version in their metadata.rb file, which means I have to
update their version. Other cookbooks in turn depend on them so…. the cycle
continues.

What am I missing?

Chris

On Aug 19, 2015, at 3:04 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

I uploaded my latest linux_role cookbook to my Berks API server, which is just an organization on my Chef server accessed via port 26200. Hence I see

$ knife node show linux_role
linux_role 1.1.80 1.1.79 1.1.78 1.1.77 1.1.76 1.1.75 1.1.74 1.1.72 1.1.71 1.1.70 1.1.69 1.1.68 1.1.67 1.1.66 1.1.65 1.1.64 1.1.63

Now I want to upload v1.1.80 to my Chef server.

First I have to run berks install so I get the cookbook from my Berks API server to my workstation correct? So I do

$ berks install
Installing linux_role (1.1.79) from http://chef-server.domain.com:26200 ([chef_server] https://chef-server.domain.com:443/organizations/berks-api)

Why doesn’t it pick up v1.1.80? How can I make it pick up v1.1.80? I even restarted the berks-api service to no avail.

Here’s my Berksfile
source "http://chef-server.domain.com:26200"
metadata
Here’s the corresponding metadata.rb file
name “top_level_metadata”
depends ‘linux_role’, ‘~> 1.1.0’
I don’t necessarily want to change the version to ‘= 1.1.80’ because I have other role cookbooks that depends on linux_role, which means I’ll have to update it’s version in their metadata.rb file, which means I have to update their version. Other cookbooks in turn depend on them so…. the cycle continues.
What am I missing?
Chris

If there is a lock file that has the cookbook solved to 1.1.79 already and that still matches the constraint (which it does) you would have to do berks update linux_role to tell it to re-solve things.

–Noah

On Thu, Aug 20, 2015 at 3:36 AM, Eric Helgeson erichelgeson@gmail.com
wrote:

~> is pessimistic

From the docs[0]:

~>(approximately greater than; also known as “pessimistically greater
than
”, or “pessimistic”),

​That means it will take the lowest version that fits the constraints
given.

​If you’re following semantec versioning you could set
depends ‘linux_role’, '>= 1.1.0’
​which should pickup all versions in the 1.1.x range​

I’m pretty sure that is incorrect - “~> 1.1.0” will match 1.1.x, while “>=
1.1.0” will match 1.1.x, 1.2.x, 99.100.x, etc.

The rubygems page on the subject[0] gives a fairly good treatment, but the
same logic applies to cookbook dependencies.

Zac

[0] http://guides.rubygems.org/patterns/#pessimistic-version-constraint

Thanks, I’ll try the “>=” versioning. I am following semantic versioning

Chris

From: Eric Helgeson [mailto:erichelgeson@gmail.com]
Sent: Wednesday, August 19, 2015 10:37 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Why is berks install not getting latest cookbook version from Berks API server?

~> is pessimistic

From the docs[0]:
~>(approximately greater than; also known as “pessimistically greater than”, or “pessimistic”),

​That means it will take the lowest version that fits the constraints given.

​If you’re following semantec versioning you could set
depends ‘linux_role’, '>= 1.1.0’
​which should pickup all versions in the 1.1.x range​

[0] ​https://docs.chef.io/config_rb_metadata.html

-Eric Helgeson
@nullerichttps://twitter.com/nulleric

On Wed, Aug 19, 2015 at 5:04 PM, Fouts, Chris <Chris.Fouts@sensus.commailto:Chris.Fouts@sensus.com> wrote:
I uploaded my latest linux_role cookbook to my Berks API server, which is just an organization on my Chef server accessed via port 26200. Hence I see

$ knife node show linux_role
linux_role 1.1.80 1.1.79 1.1.78 1.1.77 1.1.76 1.1.75 1.1.74 1.1.72 1.1.71 1.1.70 1.1.69 1.1.68 1.1.67 1.1.66 1.1.65 1.1.64 1.1.63

Now I want to upload v1.1.80 to my Chef server.

First I have to run berks install so I get the cookbook from my Berks API server to my workstation correct? So I do

$ berks install
Installing linux_role (1.1.79) from http://chef-server.domain.com:26200 ([chef_server] https://chef-server.domain.com:443/organizations/berks-api)

Why doesn’t it pick up v1.1.80? How can I make it pick up v1.1.80? I even restarted the berks-api service to no avail.

Here’s my Berksfile
source "http://chef-server.domain.com:26200"
metadata
Here’s the corresponding metadata.rb file
name “top_level_metadata”
depends ‘linux_role’, ‘~> 1.1.0’
I don’t necessarily want to change the version to ‘= 1.1.80’ because I have other role cookbooks that depends on linux_role, which means I’ll have to update it’s version in their metadata.rb file, which means I have to update their version. Other cookbooks in turn depend on them so…. the cycle continues.
What am I missing?
Chris