GithubHelp home page GithubHelp logo

Validate the config file about footloose HOT 4 OPEN

dlespiau avatar dlespiau commented on May 30, 2024
Validate the config file

from footloose.

Comments (4)

dlespiau avatar dlespiau commented on May 30, 2024 1

Thanks for filing these validation cases!

from footloose.

stealthybox avatar stealthybox commented on May 30, 2024

If a user gets the wrong indentation or misspells a field name, we should look into how to provide errors or warnings:

cluster:
  name: test
  privateKey: $HOME/.ssh/id_rsa
machines:
- count: 1
  spec:
    image: quay.io/footloose/ubuntu18.04
    name: test-%d
    portMappings:
    - containerPort: 22
  privileged: true
  ignite:
    cpus: 4
    memory: 2GB
    copyFiles:
      /foo/bar: /foo/bar

In this example, the user made an indentation error meaning ignite: and privileged: were not part of the spec:.
Footloose in its current form will silently continue ignoring these unspecified fields.

Context from user issue

from footloose.

stealthybox avatar stealthybox commented on May 30, 2024

Here's another example of specifying a field at the wrong level with no warnings:

cluster:
  name: cluster
  privateKey: cluster-key
machines:
- spec:
    count: 1
    image: quay.io/footloose/ubuntu18.04
    name: a-%d
- spec:
    count: 1
    image: quay.io/footloose/ubuntu18.04
    name: b-%d
footloose create
INFO[0000] Docker Image: quay.io/footloose/ubuntu18.04 present locally 
INFO[0000] Docker Image: quay.io/footloose/ubuntu18.04 present locally 
# no machines created

from footloose.

stealthybox avatar stealthybox commented on May 30, 2024

When you don't pass a top-level name, footloose reports that containers with invalid names have already been created:

cluster:
# name: cluster
  privateKey: cluster-key
machines:
- count: 1
  spec:
    image: quay.io/footloose/ubuntu18.04
    name: a-%d
- count: 1
  spec:
    image: quay.io/footloose/ubuntu18.04
    name: b-%d
footloose create
INFO[0000] Docker Image: quay.io/footloose/ubuntu18.04 present locally 
INFO[0000] Docker Image: quay.io/footloose/ubuntu18.04 present locally 
INFO[0000] Creating machine: -a-0 ...                   
INFO[0000] Machine -a-0 is already created...           
INFO[0000] Creating machine: -b-0 ...                   
INFO[0000] Machine -b-0 is already created... 

It's worth noting that I actually just expected name to default to basename $PWD like docker-compose, so this was unexpected for me.

from footloose.

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.