Skip to content

Commit d3650cd

Browse files
authored
Merge pull request #22 from RainbowMango/pr_sync_19
Sync APIs from karmada repo based on v1.9.0
2 parents 81a2cd5 + 24f3cd9 commit d3650cd

36 files changed

+1008
-79
lines changed

autoscaling/v1alpha1/zz_generated.deepcopy.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaling/v1alpha1/zz_generated.register.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ type ResourceModel struct {
213213
type ResourceModelRange struct {
214214
// Name is the name for the resource that you want to categorize.
215215
// +required
216-
Name ResourceName
216+
Name corev1.ResourceName
217217

218218
// Min is the minimum amount of this resource represented by resource name.
219219
// Note: The Min value of first grade(usually 0) always acts as zero.
@@ -290,6 +290,11 @@ type ClusterStatus struct {
290290
// ResourceSummary represents the summary of resources in the member cluster.
291291
// +optional
292292
ResourceSummary *ResourceSummary
293+
294+
// RemedyActions represents the remedy actions that needs to be performed
295+
// on the cluster.
296+
// +optional
297+
RemedyActions []string
293298
}
294299

295300
// APIEnablement is a list of API resource, it is used to expose the name of the

cluster/v1alpha1/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ type ClusterStatus struct {
302302
// ResourceSummary represents the summary of resources in the member cluster.
303303
// +optional
304304
ResourceSummary *ResourceSummary `json:"resourceSummary,omitempty"`
305+
306+
// RemedyActions represents the remedy actions that needs to be performed
307+
// on the cluster.
308+
// +optional
309+
RemedyActions []string `json:"remedyActions,omitempty"`
305310
}
306311

307312
// APIEnablement is a list of API resource, it is used to expose the name of the

cluster/v1alpha1/zz_generated.conversion.go

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/v1alpha1/zz_generated.deepcopy.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/v1alpha1/zz_generated.register.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/zz_generated.deepcopy.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/v1alpha1/resourceinterpretercustomization_types.go

Lines changed: 74 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,14 @@ type LocalValueRetention struct {
139139
// to the desired specification.
140140
//
141141
// The script should implement a function as follows:
142-
// luaScript: >
143-
// function Retain(desiredObj, observedObj)
144-
// desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo
145-
// return desiredObj
146-
// end
142+
//
143+
// ```
144+
// luaScript: >
145+
// function Retain(desiredObj, observedObj)
146+
// desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo
147+
// return desiredObj
148+
// end
149+
// ```
147150
//
148151
// The content of the LuaScript needs to be a whole function including both
149152
// declaration and implementation.
@@ -167,16 +170,19 @@ type ReplicaResourceRequirement struct {
167170
// replica as well as resource requirements
168171
//
169172
// The script should implement a function as follows:
170-
// luaScript: >
171-
// function GetReplicas(desiredObj)
172-
// replica = desiredObj.spec.replicas
173-
// requirement = {}
174-
// requirement.nodeClaim = {}
175-
// requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector
176-
// requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations
177-
// requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits
178-
// return replica, requirement
179-
// end
173+
//
174+
// ```
175+
// luaScript: >
176+
// function GetReplicas(desiredObj)
177+
// replica = desiredObj.spec.replicas
178+
// requirement = {}
179+
// requirement.nodeClaim = {}
180+
// requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector
181+
// requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations
182+
// requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits
183+
// return replica, requirement
184+
// end
185+
// ```
180186
//
181187
// The content of the LuaScript needs to be a whole function including both
182188
// declaration and implementation.
@@ -198,11 +204,14 @@ type ReplicaResourceRequirement struct {
198204
type ReplicaRevision struct {
199205
// LuaScript holds the Lua script that is used to revise replicas in the desired specification.
200206
// The script should implement a function as follows:
201-
// luaScript: >
202-
// function ReviseReplica(desiredObj, desiredReplica)
203-
// desiredObj.spec.replicas = desiredReplica
204-
// return desiredObj
205-
// end
207+
//
208+
// ```
209+
// luaScript: >
210+
// function ReviseReplica(desiredObj, desiredReplica)
211+
// desiredObj.spec.replicas = desiredReplica
212+
// return desiredObj
213+
// end
214+
// ```
206215
//
207216
// The content of the LuaScript needs to be a whole function including both
208217
// declaration and implementation.
@@ -222,12 +231,15 @@ type ReplicaRevision struct {
222231
type StatusReflection struct {
223232
// LuaScript holds the Lua script that is used to get the status from the observed specification.
224233
// The script should implement a function as follows:
225-
// luaScript: >
226-
// function ReflectStatus(observedObj)
227-
// status = {}
228-
// status.readyReplicas = observedObj.status.observedObj
229-
// return status
230-
// end
234+
//
235+
// ```
236+
// luaScript: >
237+
// function ReflectStatus(observedObj)
238+
// status = {}
239+
// status.readyReplicas = observedObj.status.observedObj
240+
// return status
241+
// end
242+
// ```
231243
//
232244
// The content of the LuaScript needs to be a whole function including both
233245
// declaration and implementation.
@@ -247,13 +259,16 @@ type StatusAggregation struct {
247259
// LuaScript holds the Lua script that is used to aggregate decentralized statuses
248260
// to the desired specification.
249261
// The script should implement a function as follows:
250-
// luaScript: >
251-
// function AggregateStatus(desiredObj, statusItems)
252-
// for i = 1, #statusItems do
253-
// desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas
254-
// end
255-
// return desiredObj
256-
// end
262+
//
263+
// ```
264+
// luaScript: >
265+
// function AggregateStatus(desiredObj, statusItems)
266+
// for i = 1, #statusItems do
267+
// desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas
268+
// end
269+
// return desiredObj
270+
// end
271+
// ```
257272
//
258273
// The content of the LuaScript needs to be a whole function including both
259274
// declaration and implementation.
@@ -273,12 +288,15 @@ type HealthInterpretation struct {
273288
// LuaScript holds the Lua script that is used to assess the health state of
274289
// a specific resource.
275290
// The script should implement a function as follows:
276-
// luaScript: >
277-
// function InterpretHealth(observedObj)
278-
// if observedObj.status.readyReplicas == observedObj.spec.replicas then
279-
// return true
280-
// end
281-
// end
291+
//
292+
// ```
293+
// luaScript: >
294+
// function InterpretHealth(observedObj)
295+
// if observedObj.status.readyReplicas == observedObj.spec.replicas then
296+
// return true
297+
// end
298+
// end
299+
// ```
282300
//
283301
// The content of the LuaScript needs to be a whole function including both
284302
// declaration and implementation.
@@ -299,20 +317,23 @@ type DependencyInterpretation struct {
299317
// LuaScript holds the Lua script that is used to interpret the dependencies of
300318
// a specific resource.
301319
// The script should implement a function as follows:
302-
// luaScript: >
303-
// function GetDependencies(desiredObj)
304-
// dependencies = {}
305-
// if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= "default" then
306-
// dependency = {}
307-
// dependency.apiVersion = "v1"
308-
// dependency.kind = "ServiceAccount"
309-
// dependency.name = desiredObj.spec.serviceAccountName
310-
// dependency.namespace = desiredObj.namespace
311-
// dependencies[1] = {}
312-
// dependencies[1] = dependency
313-
// end
314-
// return dependencies
315-
// end
320+
//
321+
// ```
322+
// luaScript: >
323+
// function GetDependencies(desiredObj)
324+
// dependencies = {}
325+
// if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= "default" then
326+
// dependency = {}
327+
// dependency.apiVersion = "v1"
328+
// dependency.kind = "ServiceAccount"
329+
// dependency.name = desiredObj.spec.serviceAccountName
330+
// dependency.namespace = desiredObj.namespace
331+
// dependencies[1] = {}
332+
// dependencies[1] = dependency
333+
// end
334+
// return dependencies
335+
// end
336+
// ```
316337
//
317338
// The content of the LuaScript needs to be a whole function including both
318339
// declaration and implementation.

0 commit comments

Comments
 (0)