Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

[feature request] Use resource ID aliases in delta to allow multiple classes for a single resource ID #67

Closed
chrishumanitec opened this issue Jan 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chrishumanitec
Copy link
Contributor

Is your feature request related to a problem? Please describe.
score-humanitec currently generates a single resource ID in the deployment set when the score.humanitec.io/resId annotation is used. This means that if the same resource ID is needed with 2 different classes, only one of them is generated.

For example:

resources:
  upload-bucket:
    metadata:
      annotations:
        score.humanitec.io/resId: shared.file-bucket
    type: bucket
    class: write
  download-bucket:
    metadata:
      annotations:
        score.humanitec.io/resId: shared.file-bucket
    type: bucket
    class: read

This will generate a delta wich will result in *one of" those classes added to deployment set.

Describe the solution you'd like
Humanitec supports an alias id in shared reosurces that allows 2 resource dependencies to be genmerated that use the same resource ID and different classes.

If a resource dependency has the score.humanitec.io/resId annotation AND the class is not default, an additional resource dependencey is created in the delta that is suffixed with -class-{className}. The resource placeholeders in teh score file are rewritten to use this alternative resource dependency.

The resource dependency name should remain the same in all cases if class is ommitted or is default.

Describe alternatives you've considered
None. This is simple supporting new functionality.

Additional context
This is not usually a problem in a single score file, but is an issue when deploying multiple workloads to a single application in humanitec. For example, producers and consumers of a queue or read and writing to shared storage.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant