Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinity loop when assign static IPs #62

Closed
kei-yamazaki opened this issue Nov 17, 2015 · 0 comments
Closed

Infinity loop when assign static IPs #62

kei-yamazaki opened this issue Nov 17, 2015 · 0 comments

Comments

@kei-yamazaki
Copy link
Contributor

In commit id 6f5a63a, Infinity loop occurs when reserve static IPs more then 256.

Following is an example.

$ cat template.yml
networks:
- name: cf1
  subnets:
  - static:
    - 10.0.0.2 - 10.0.1.254
jobs:
- name: foo
  templates:
  - name: bar
  instances: 1
  networks:
  - name: cf1
    static_ips: (( static_ips(0) ))
$ spruce -D merge template.yml
DEBUG> Processing file 'template.yml'
DEBUG> $.networks: not found upstream, adding it
DEBUG> $.jobs: not found upstream, adding it
DEBUG> parsing `(( static_ips(0) ))': looks like a (( static_ips ... )) operator
DEBUG>  arguments:
DEBUG>   #0: parsed as unquoted integer literal '0'
DEBUG>
DEBUG> patching up YAML by evaluating outstanding operators
DEBUG>
DEBUG> running (( static_ips ... )) operation at $.jobs.0.networks.0.static_ips
DEBUG>   determining what job context (( static_ips ... )) was called in
DEBUG>   got it.  $.jobs.0
DEBUG>
DEBUG>   extracting job name from $.jobs.0.name
DEBUG>   got it.  job is foo
DEBUG>
DEBUG>   determining how many instances of job foo there are
DEBUG>   got it.  there are 1 instances of foo
DEBUG>
DEBUG>   checking to see if the caller asked for enough static_ips to provision all job instances (need at least 1)
DEBUG>   looks good.  asking for 1 IPs for a job with 1 instances
DEBUG>
DEBUG>   determining the pool of static IPs from which to provision

# gone away!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant