-
Notifications
You must be signed in to change notification settings - Fork 13
Added resource annotations and parameters support #39
Conversation
Signed-off-by: Eugene Yarshevich <yarshevich@gmail.com>
Signed-off-by: Eugene Yarshevich <yarshevich@gmail.com>
Signed-off-by: Eugene Yarshevich <yarshevich@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a missing case for referencing private workload resources in another workload.
internal/humanitec/convert.go
Outdated
} | ||
// END (DEPRECATED) | ||
|
||
if strings.HasPrefix(resId, "externals.") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also possible to reference resources in other workloads - e.g. modules.other-workload.externals.my-res
This case would fail here.
This does not require explicit addition of a resource to the delta, but it should be allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are adding a new feature here. This logic was not supported with the extensions file mechanism.
Let's create a separate issue and describe possible cases, requirements, and app behaviour there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This third case is as follows:
the res-id can have the format:
modules.{workloadId}.externals.{resId}
In this case, there are 2 outcomes:
- if
{workloadId}
matches the current workload, treat asexternals.{resId}
- if
{workloadId}
does not match the current workload, just re-render the placeholder as having the value of the annotation (i.e. don't add anything toexternals
orshared
properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workload-id
is unknown to score. what do we compare with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we to support short versions if the same res-id? E.g. external.{resId}
? What about app-shared res-ids? How would they look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workload-id is unknown to score. what do we compare with?
The workload ID is known because the delta includes it. This is the workload ID to consider.
Here are the formats to support:
shared.{resId}
-> replaceexternals.{resId}
-> treat atexternals.{resId}
modules.{workloadId}.externals.{redId}
-> replace. IfworkloadId
== current workload ID (as determined when creating the delta treat atexternals.{resId}
otherwise replace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: Eugene Yarshevich <yarshevich@gmail.com>
…tions Signed-off-by: Eugene Yarshevich <yarshevich@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds support for resource annotations (see score-spec/spec#56) and resource inputs hints (see score-spec/spec#9).
Types of changes
Checklist: