This is an outcome of #688, discussed and agreed with @mszostok. The solution is to use value field to store the rendered value, even for dynamic TypeInstances (the ones which has dynamic values fetched based on context).
Add new gRPC method to the dynamic (context-only) Storage:
message GetPreCreateValueRequest {
// no TypeInstance ID and resourceVersion
bytes context = 1;
}
message GetPreCreateValueResponse {
optional bytes value = 1;
}
service StorageBackend {
rpc GetPreCreateValue(GetPreCreateValueRequest) returns (GetPreCreateValueResponse);
}
[x] ~Update JSON schema for Storages (instead of acceptValue, there will be an enum)~
Not valid anymore, as there is no nice way of services composition in ProtoBuf. Every service would need to implement multiple gRPC servers and multiplex them (e.g. dynamic TI + locking TI)
Add generic container to enrich TypeInstance (run GetPreCreateValue) at the end of a given workflow
Manually added by Content Developer
Add the following steps after Helm installation:
- - name: resolve-dynamic-ti-value
template: resolve-dynamic-ti-value
arguments:
- name: input-artifact
from: "{{steps.resolve-dynamic-ti.outputs.artifacts.postgresql}}"
- name: backend
# fortunately it is already injected into workflow
from: "{{workflow.outputs.artifacts.helm-template-storage}}"
[x] Modify TypeInstance uploader: TypeInstance upload would ignore TypeInstance value if a given Storage Backend (we have its ID) is dynamic (accepts only context)
some additional logging could be helpful
[x] Support GetPreCreate for Helm storage backends
Description
This is an outcome of #688, discussed and agreed with @mszostok. The solution is to use
value
field to store the rendered value, even for dynamic TypeInstances (the ones which has dynamic values fetched based on context).AC
[x] Split gRPC API (resolved in https://github.com/capactio/capact/pull/696)
[x] ~Update JSON schema for Storages (instead of
acceptValue
, there will be an enum)~[x] Update Mattermost installation manifest and fully use Helm template backend for PostgreSQL (https://github.com/capactio/hub-manifests/pull/66)
GetPreCreateValue
) at the end of a given workflow[x] Modify TypeInstance uploader: TypeInstance upload would ignore TypeInstance value if a given Storage Backend (we have its ID) is dynamic (accepts only context)
[x] Support GetPreCreate for Helm storage backends
[x] Update documentation on website (resolved in https://github.com/capactio/website/pull/119)
Reason
Previously, every downloaded TypeInstance in a workflow had a form of an artifact with the TypeInstance value. Now, every TypeInstance have:
Jinja2 templating and Artifact Merger already support unpacking
value
.Sometimes the artifact could contain just the
backend.context
. For example, if we took an artifact prepared for Helm Template storage:The problem is that some of further workflow steps might need actual values, and the
value
is null.Related issues
See #688