Skip to content

Change body from an attribute to a block in a backwards-compatible way #36

@gotwarlost

Description

@gotwarlost

Right now we have body as an attribute that contains the entire K8s object. This means that the apiVersion and kind of the resource are not available at the HCL level. This makes it impossible to write specific kinds of tooling like language servers that only need to concern themselves with HCL blocks and attributes.

Change this as follows:

  • the body attribute under resource and template becomes a block.
  • the body attribute under composite is also a block.
  • the body attribute in a function definition is renamed to result - this is not strictly needed but it is inconsistent to have some bodies be a block and others be an attribute. Specifically, for the function definition case we cannot make body a block since it needs to be able to return scalar values.

Implement this such that for one release both old and new forms work. The old form is deprecated but still honored.
Make another release where the old form is completely removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions