Code Monkey home page Code Monkey logo

Comments (3)

e1ven avatar e1ven commented on July 16, 2024 1

I believe I ran into this as well-

It appears that goiardi will respect environment version constraints for any cookbooks that are specified in the run-list, but not their dependencies.

When I run chef-client, goiardi will pull in cookbooks with the locked versions as expected, and it will pull in any cookbooks which are specified as dependencies in metadata.rb.

When retrieving these dependencies, any version constaints specified in metadata.rb are respected.
Goiardi does not apply the environment constraints against these dependency cookbooks, however.
This is different from the Progress Software chef-server implementation, which will respect these dependencies.

So for example, if we have-

  • Environment X, specifying constraints

    • cookbook1, '~> 1.0'
    • cookbook2, '~> 2.0'
  • A run-list of ["recipe[cookbook1]"]

  • cookbook1 (available in versions 1.0, 2.0, 3.0)

    • depends on cookbook2
  • cookbook2 (available in version 1.0, 2.0, 3.0)

Running chef-client/cinc-client against goiardi will pull cookbook1 1.0 and cookbook2 3.0
Running chef-client/cinc-client against chef-server will pull cookbook1 1.0 and cookbook2 2.0

I'm not particularly familiar with this codebase, but it appears that we need to add these env constraints later in cookbook.go, when evaluating these cookbook dependencies.

I couldn't get the master branch to work quite right, so I made my own temporary fork of 0.11.10 with my implementation of this change. This change works for me in production.
Hopefully this help illustrate the problem better, even if it's not the right solution :)
https://github.com/e1ven/goiardi/pull/1/files
(The SQL index changes in the PR are unrelated -
These indexes were never accessed on my server, but it slowed the DB down substantially to keep writing them)

from goiardi.

ctdk avatar ctdk commented on July 16, 2024

I'm checking this out now, after adding options for purging statuses and reports per that earlier issue. It's in the 0.11.6-merging branch, so if you get a chance to try it out that'd be great - I have more testing to do on it still, so it's not release worthy yet, but for the first step it passes the go tests.

from goiardi.

ctdk avatar ctdk commented on July 16, 2024

Moving along on this. One thing I noticed, though, is that it doesn't look like knife cookbook download obeys environment constraints, so that's behaving as intended at least. The first thing is still a problem though, although it's one of those things that chef-pedant tests for and it passes that fine. I'll dig in, but I suspect there's a subtle interaction between two cookbooks. (I've certainly had goiardi do the right thing with environment constraints plenty of times.)

from goiardi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.