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

Ref in Instance Template errors with CYCLIC_REFERENCES #670

Open
alexapplebaum opened this issue Aug 7, 2021 · 0 comments
Open

Ref in Instance Template errors with CYCLIC_REFERENCES #670

alexapplebaum opened this issue Aug 7, 2021 · 0 comments

Comments

@alexapplebaum
Copy link

When 'updating' a deployment that contains an instant template similar to your:

https://github.com/GoogleCloudPlatform/deploymentmanager-samples/tree/master/examples/v2/igm-updater

If the instance template contains references:

ex.
https://github.com/alexapplebaum/deploymentmanager-samples/tree/cyclic/community/full-stack-autoscale-vm

https://github.com/alexapplebaum/deploymentmanager-samples/blob/cyclic/community/full-stack-autoscale-vm/parent/parent.py#L56

Rendered Config:

      networkInterfaces:
      - accessConfigs:
        - name: Management NAT
          type: ONE_TO_ONE_NAT
        network: $(ref.mycyclic-network0.selfLink)
        subnetwork: $(ref.mycyclic-mgmt1.selfLink)

It errors out with:

$ gcloud  deployment-manager deployments update myparent --config parent-2.yaml
The fingerprint of the deployment is b'OrC90UgOl7yY-lGlOMt_yA=='
Waiting for update [operation-1628281354059-5c8e9cbb3fd70-4ceff8f4-ae04ad50]...failed.                                                                        
ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation [operation-1628281354059-5c8e9cbb3fd70-4ceff8f4-ae04ad50]: errors:
- code: CYCLIC_REFERENCES
  message: |
    A cycle was found during reference analysis:
    Detected cycle:
    mycyclic-network0 <- myparent-it-v-1 <- myparent-igm <- myparent-it-v-2

NOTE: The igm-updater example mentioned has networks hardcoded. If you hardcode the networks as strings instead, the deployment manager can update the deployment just fine. However, we would obviously like to leverage references for benefits mentioned here:

https://cloud.google.com/deployment-manager/docs/configuration/use-references

  1. To avoid parallel deployments and create the dependency graph.
  2. Make dynamic per inputs
  3. etc.

NOTE: First deployment works fine with the references. It is only the Update process (in order to toggle the instance template to trigger a rolling update as per the igm updater example) but updating is required lifecycle functionality.

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