Skip to content

Commit a376a35

Browse files
authored
Add feedbackScrapeType field (#418)
Signed-off-by: Jian Qiu <[email protected]>
1 parent 8307845 commit a376a35

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ spec:
284284
- type
285285
type: object
286286
type: array
287+
feedbackScrapeType:
288+
default: Poll
289+
description: FeedbackScrapeType represents the way to monitor
290+
resource, it could be Poll or Watch
291+
enum:
292+
- Poll
293+
- Watch
294+
type: string
287295
resourceIdentifier:
288296
description: |-
289297
ResourceIdentifier represents the group, resource, name and namespace of a resoure.

work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ spec:
269269
- type
270270
type: object
271271
type: array
272+
feedbackScrapeType:
273+
default: Poll
274+
description: FeedbackScrapeType represents the way to monitor
275+
resource, it could be Poll or Watch
276+
enum:
277+
- Poll
278+
- Watch
279+
type: string
272280
resourceIdentifier:
273281
description: |-
274282
ResourceIdentifier represents the group, resource, name and namespace of a resoure.

work/v1/types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ type ManifestConfigOption struct {
117117
// +listMapKey:=condition
118118
// +optional
119119
ConditionRules []ConditionRule `json:"conditionRules,omitempty"`
120+
121+
// FeedbackScrapeType represents the way to monitor resource, it could be Poll or Watch
122+
// +kubebuilder:validation:Enum=Poll;Watch
123+
// +kubebuilder:default=Poll
124+
// +optional
125+
FeedbackScrapeType FeedbackScrapeType `json:"feedbackScrapeType,omitempty"`
120126
}
121127

122128
// +kubebuilder:validation:XValidation:rule="self.type != 'CEL' || self.condition != \"\"",message="Condition is required for CEL rules"
@@ -168,6 +174,17 @@ const (
168174
CelConditionExpressionsType ConditionRuleType = "CEL"
169175
)
170176

177+
// FeedbackScrapeType represents the type of method to monitor resource and feedback
178+
type FeedbackScrapeType string
179+
180+
const (
181+
// FeedbackPollType indicates checking resource in polling way
182+
FeedbackPollType FeedbackScrapeType = "Poll"
183+
184+
// FeedbackWatchType indicates watching resource
185+
FeedbackWatchType FeedbackScrapeType = "Watch"
186+
)
187+
171188
// ManifestWorkExecutor is the executor that applies the resources to the managed cluster. i.e. the
172189
// work agent.
173190
type ManifestWorkExecutor struct {

work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ spec:
303303
- type
304304
type: object
305305
type: array
306+
feedbackScrapeType:
307+
default: Poll
308+
description: FeedbackScrapeType represents the way to monitor
309+
resource, it could be Poll or Watch
310+
enum:
311+
- Poll
312+
- Watch
313+
type: string
306314
resourceIdentifier:
307315
description: |-
308316
ResourceIdentifier represents the group, resource, name and namespace of a resoure.

0 commit comments

Comments
 (0)