Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

add mutating for appConfig to support name/properties format of trait #242

Merged
merged 2 commits into from
Oct 12, 2020

Conversation

wonderflow
Copy link
Member

@wonderflow wonderflow commented Oct 9, 2020

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
@wonderflow wonderflow force-pushed the mutating branch 2 times, most recently from 1a4fcfe to 6b3cf46 Compare October 10, 2020 10:26
@hongchaodeng
Copy link
Member

new trait format design of spec

This link is not working. Where is the design?

@wonderflow
Copy link
Member Author

wonderflow commented Oct 11, 2020

Object: content,
}
// find out the GVK from the CRD definition and set
apiVersion := metav1.GroupVersion{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK for short term fix by simply replacing name/properties with GVK. In long term it's better to fix this in AppConfig controller so $ kubectl get appconfig will also return name/properties format.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this case is different from the component mutate hook as that was completely inside the component. I preferred to handle the explicit field in the controller instead. It's actually simpler to test.

Copy link
Member Author

@wonderflow wonderflow Oct 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

component mutate hook and this PR are actually the same thing, I hope we can use a separate PR to move them inside the controller together if we really want to do that. \cc @resouer @ryanzhang-oss

u: &unstructured.Unstructured{Object: map[string]interface{}{
"apiVersion": "extend.oam.dev/v1alpha2",
"kind": "SimpleRolloutTrait",
"metadata": map[string]interface{}{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be good to add a name here that is different from the label so we know which is the truth

"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]interface{}{
"labels": map[string]interface{}{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be good to add a name here that is different from the label so we know which is the truth

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what do you mean here? Which name?

Object: content,
}
// find out the GVK from the CRD definition and set
apiVersion := metav1.GroupVersion{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this case is different from the component mutate hook as that was completely inside the component. I preferred to handle the explicit field in the controller instead. It's actually simpler to test.

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
@wonderflow
Copy link
Member Author

@ryanzhang-oss all comments are replied/fixed, please review again, thanks

@ryanzhang-oss
Copy link
Collaborator

Synced off-line with @wonderflow, we realized that the mutation is not really addressing the new spec that uses the trait name to point to the TraitDefinition. However, we decided that it's still useful to have an applicationConfig mutation framework as we will surely need one later.

@ryanzhang-oss ryanzhang-oss merged commit d1bbf9f into crossplane:master Oct 12, 2020
@wonderflow wonderflow deleted the mutating branch October 12, 2020 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants