-
Notifications
You must be signed in to change notification settings - Fork 80
implement Trait patch back before workload emitted #134
base: master
Are you sure you want to change the base?
Conversation
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.
Can you help add an real example about patch trait?
@@ -172,26 +193,87 @@ func (r *components) renderComponent(ctx context.Context, acc v1alpha2.Applicati | |||
return &Workload{ComponentName: acc.ComponentName, ComponentRevisionName: componentRevisionName, Workload: w, Traits: traits, Scopes: scopes}, nil | |||
} | |||
|
|||
func (r *components) renderTrait(ctx context.Context, ct v1alpha2.ComponentTrait, ac *v1alpha2.ApplicationConfiguration, | |||
func (r *components) renderComponentFromPatchTrait(ctx context.Context, w *unstructured.Unstructured, acc *v1alpha2.ApplicationConfigurationComponent, t *unstructured.Unstructured) error { |
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.
Does this one have a unit test? I would also suggest to break this function into multiple pieces (the patch itself can be a function)
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.
OK, I'll add a unit test
…before workload emitted Signed-off-by: chengji.lsb <[email protected]>
Signed-off-by: chengji.lsb <[email protected]>
Signed-off-by: chengji.lsb <[email protected]>
Signed-off-by: chengji.lsb <[email protected]>
Any progress on this PR? |
pending on this issue #157 |
Just FYI, the strategicMergepatch is in a library at "k8s.io/apimachinery/pkg/util/strategicpatch" |
//oam-k8s-runtime will periodically check the status of patch trait. If the phase of status become Ready, the oam-k8s-runtime will gather the patch data from the ConfigMap. After all patch traits gathered, oam-k8s-runtime will patch all the information into workload i have a little problem..where is this logic,periodically check and patch |
This comment has been minimized.
This comment has been minimized.
//All patch traits MUST be created or updated before workload emit, and oam-k8s-runtime will be pending until all patch traits are ready. |
@antiClocke Let's talk deep in wechat or Dingtalk, my ID is wonderflow |
|
Ref to proposal https://github.com/crossplane/oam-kubernetes-runtime/blob/master/design/trait-separated-from-underlying-workload-should-patch-back.md
Signed-off-by: chengji.lsb [email protected]