Giter Club home page Giter Club logo

Comments (2)

jpalermo avatar jpalermo commented on August 19, 2024

The /deployments/:deployment/diff endpoint does use runtime configs to generate the diff between the old manifest and the new manifest.

if deployment
before_manifest = Manifest.load_from_model(deployment, resolve_interpolation: false)
before_manifest.resolve_aliases
teams = deployment.teams
else
before_manifest = Manifest.generate_empty_manifest
teams = Bosh::Director::Models::Team.transform_admin_team_scope_to_teams(token_scopes)
end
after_cloud_configs = Bosh::Director::Models::Config.latest_set_for_teams('cloud', *teams)
after_runtime_configs = Bosh::Director::Models::Config.latest_set_for_teams('runtime', *teams)
after_manifest = Manifest.load_from_hash(
manifest_hash,
manifest_text,
after_cloud_configs,
after_runtime_configs,
resolve_interpolation:
false,
)
after_manifest.resolve_aliases

Seems like a lot of that code could be used to do what you want on /deployments/:deployment.

Since that endpoint currently renders the "currently deployed manifest", if you're adding an option to add runtime configs, it feels correct that the option should have a flag for "currently deployed manifest + runtime configs", but also adding a flag for "currently deployed manifest + new runtime configs" seems like a fine option too.

You might also be able to just use the diff endpoint to achieve what you want without any changes, but I'll leave that up to you.

from bosh.

gberche-orange avatar gberche-orange commented on August 19, 2024

Thanks @jpalermo for your detailed analysis and suggestion for contribution !

from bosh.

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.