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

Changes in inputs produce an error if redeployed #248

Open
alexmaslenn opened this issue Feb 9, 2022 · 8 comments
Open

Changes in inputs produce an error if redeployed #248

alexmaslenn opened this issue Feb 9, 2022 · 8 comments
Labels
bug Something isn't working TOSCA Something that considers TOSCA standard

Comments

@alexmaslenn
Copy link
Contributor

alexmaslenn commented Feb 9, 2022

Description

After a service template with inputs is deployed, a removing an input can cause an error.

Steps

Consider having the following simple service template service.yaml file with inputs section:

tosca_definitions_version: tosca_simple_yaml_1_3

topology_template:
  inputs:
    input1:
      type: string
    input2:
      type: string

  node_templates:
    my-workstation:
      type: tosca.nodes.Compute
      attributes:
        private_address: { get_input: input1 }
        public_address:  { get_input: input2 }

with inputs.yaml file being

input1: localhost
input2: localhost

After we successfully execute the deployment with opera deploy -i input.yaml service.yaml we make the following changes in the files, removing input2:

tosca_definitions_version: tosca_simple_yaml_1_3

topology_template:
  inputs:
    input1:
      type: string

  node_templates:
    my-workstation:
      type: tosca.nodes.Compute
      attributes:
        private_address: { get_input: input1 }
input1: localhost

Current behaviour

Execution of the command opera deploy -i input.yaml service.yaml -c returns the following error:

opera.error.DataError: Undeclared inputs: input2

This happens because if instances directory is present in .opera file storage, inputs are read from the storage, not from the file provided in -i arg.

Expected behaviour

No error is returned and deployment is successful.

@anzoman anzoman added bug Something isn't working TOSCA Something that considers TOSCA standard labels Feb 9, 2022
@anzoman
Copy link
Contributor

anzoman commented Feb 9, 2022

Thanks @alexmaslenn, we will fix that ASAP.

@alexmaslenn
Copy link
Contributor Author

Lets not hurry. It is connected to #240 I think. Maybe some other connected issues will arise.

@anzoman
Copy link
Contributor

anzoman commented Feb 9, 2022

Huh okay I'll hold my horses. We need to be careful and explore any additional issues, so please supply here or in separate issues (if not connected) when you find anything unusual with TOSCA inputs.

@alexmaslenn
Copy link
Contributor Author

@anzoman I've tested another scenario and found an issue that is connected I guess #250

@cankarm
Copy link
Contributor

cankarm commented Feb 14, 2022

Maybe this is irrelevant and my next point can be wrong, but... I guess that appropriate approach should be to use opera diff or opera update when you do any changes on the deployed IaC (service and inputs definition)?

Somehow I think that it is OK, that it is failing - explaining you that you actually changed something after deploy, so you might be very careful with executing this command.

@anzoman
Copy link
Contributor

anzoman commented Feb 15, 2022

@cankarm good point, opera diff should be used to see changes and then opera update to apply them.

But here (as @alexmaslenn described before) we are talking about redeploying with -c/--clean.state option which should erase the opera's storage folder properly and the user should be able to redeploy anything regardless of the current state of already deployed application (the user is already warned that "the clean state deploy option might have unexpected consequences on the already deployed blueprint").

@alexmaslenn
Copy link
Contributor Author

@cankarm I've tested opera diff -i input.yaml service.yaml with the scenario above and it also fails.

Undeclared inputs: input2

@anzoman
Copy link
Contributor

anzoman commented Feb 17, 2022

@alexmaslenn strange, this definitely needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working TOSCA Something that considers TOSCA standard
Projects
None yet
Development

No branches or pull requests

3 participants