-
Notifications
You must be signed in to change notification settings - Fork 80
Don't block if traitDefinition or workloadDefinition not exist #82
Comments
I agree that a Trait/workload definition that is merely an empty envelope feels redundant. However, they are designed to act like "registration" of external CRDs on OAM runtime. One potential concern is how do we know if a typo in the appConfig results in the controller can't locate the definition of a trait/workload and creates a wrong definition by mistake? |
Are we clear particular features in OAM rely on definition objects? If that's clear, we can allow non-definition case and assume users know what's missing. From my point of view, definition objects make more sense to an end-to-end app engine. |
what's the verdict? |
I think the points that
are not conflict. One way to make it happen is that there is mega-definition that will cover CRDs not linked to explicit definitions. Just like PID 0. |
I met this error who and when to add it the best way is that the CRD was produced, this XDefinitions was also generated at the same time, but kubebuilder can not Another way is that app-config controller is the entry to workload and trait instance generation, If it can be automatically detected and created XDefinitions, the upper usage cost can be reduced the question is whether outside of the oam-runtime should be aware of xdefinition ? |
The platform admin is expected to register capability so users have a way to know what workloads/traits the system currently supported. And oam-k8s-runtime should report error (or warning at least) if definition object is missing. @allenhaozi Do you think auto-generating definition objects for common k8s built-in resources help?
It seems the best answer for now is:
That means definitions will be left for external tools (like app engine) but a bunch of default definitions will be installed in oam-k8s-runtim. |
LGTM, I will update the code |
Yes, "auto-generating definition objects" is the best answer now |
After deep discussing with @hongchaodeng and @resouer , we have concluded that: Besides "auto-generating definition objects", for CRDs that we can't automatically generate previously. We will not block app from running if no traitdefinition found, but we will output warning message to tell user that the trait will miss some capability such as Proposal Detail
Case 1: Normal Case in this design -- trait with definition have a label added, MUST have a definition
Case 2: Compatible Case -- trait with no label.
oam runtime will check if there's a definition with name
If there is, runtime will use it. If not, oam runtime will complain warning or errors, but will not block app from running. (Currently, it will report error and block) |
LGTM |
Now oam-k8s-runtime will check traitDefinition(for revisionAware) andworkloadDefinition(for workloadRef), but if these definition file not exist, application deploy will fail. However, the trait or workload can work without these information, so we shouldn't require definition files MUST exist.
In fact, we can automatically generate a basic definition file for those workload/trait, or we can regard there's one. Then the deploy won't fail.
For example, for ingress trait as below:
If we don't have a traitdefinition, we can assume it's a basic one like below:
All the information can be automatically generated. The main idea is to not block a normal deploy.
The text was updated successfully, but these errors were encountered: