-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api] merge interpretation structs. #2732
Conversation
Signed-off-by: yingjinhui <yingjinhui@didiglobal.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
/assign @RainbowMango
// Now only supports Lua. Interpretation.LuaScript holds the Lua script that is used to interpret the dependencies of | ||
// a specific resource. | ||
// The script should implement a function as follows: | ||
// retention: | ||
// luaScript: > | ||
// function GetDependencies(desiredObj) | ||
// dependencies = {} | ||
// if desiredObj.spec.serviceAccountName ~= "" and desiredObj.spec.serviceAccountName ~= "default" then | ||
// dependency = {} | ||
// dependency.apiVersion = "v1" | ||
// dependency.kind = "ServiceAccount" | ||
// dependency.name = desiredObj.spec.serviceAccountName | ||
// dependency.namespace = desiredObj.namespace | ||
// dependencies[0] = {} | ||
// dependencies[0] = dependency | ||
// end | ||
// return dependencies | ||
// end |
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.
This comment seems not to match the current operation.
// +optional | ||
Retention *LocalValueRetention `json:"retention,omitempty"` | ||
Retention *Interpretation `json:"retention,omitempty"` |
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.
Will the degree of coupling be too high?
Why? What's the benefit? |
I can handle the script in one function. |
The reason why I didn't use a common struct to describe the rules is
In other words, each interpreter operation may have different customization methods respectively. I'm afraid using a common struct would be very hard to do so. |
Codecov Report
@@ Coverage Diff @@
## master #2732 +/- ##
==========================================
- Coverage 32.73% 32.73% -0.01%
==========================================
Files 199 199
Lines 19401 19401
==========================================
- Hits 6351 6350 -1
- Misses 12696 12697 +1
Partials 354 354
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
OK, Keep the api. |
Signed-off-by: yingjinhui yingjinhui@didiglobal.com
What type of PR is this?
/kind api-change
What this PR does / why we need it:
xxxInterpretation structs can be merged.
Which issue(s) this PR fixes:
Part of #2371
Special notes for your reviewer:
Does this PR introduce a user-facing change?: