Description
The transformation requires all data structures used in a transformation specification to be DeepCopyable.
This is because we want to reuse our existing type system for transformations. Thereby - to convert a generic transformation to a typed transformation - we have to construct a new object from a prototype.
During the prototype implementation, we noticed that v2.descriptor is not easily deep copy able (apparently, it was not sufficient to simply add the deep copy annotation). We patched this by directly implementing the DeepCopy method as an ugly workaround in the prototype.
Starting Point:
Adding the deep copy annotation to component did not work.
type Component struct {
ComponentMeta `json:",inline"`
RepositoryContexts []*runtime.Raw `json:"repositoryContexts"`
Provider string `json:"provider"`
Resources []Resource `json:"resources"`
Sources []Source `json:"sources"`
References []Reference `json:"componentReferences"`
}
I suspect this has something to do with the embedded ComponentMeta which already implements DeepCopy
// +k8s:deepcopy-gen=true
type ComponentMeta struct {
ObjectMeta `json:",inline"`
CreationTime string `json:"creationTime,omitempty"`
}
Scope
- Find a solution to enable deep copy for
v2.descriptors
- Confirm the finding described above (DO NOT BLINDLY RELY ON THE DESCRIPTION HERE)
Done Criteria
Description
The transformation requires all data structures used in a transformation specification to be
DeepCopyable.This is because we want to reuse our existing type system for transformations. Thereby - to convert a generic transformation to a typed transformation - we have to construct a new object from a prototype.
During the prototype implementation, we noticed that
v2.descriptoris not easily deep copy able (apparently, it was not sufficient to simply add the deep copy annotation). We patched this by directly implementing theDeepCopymethod as an ugly workaround in the prototype.Starting Point:
Adding the deep copy annotation to component did not work.
I suspect this has something to do with the embedded
ComponentMetawhich already implementsDeepCopyScope
v2.descriptorsDone Criteria