Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ spec:
- type
type: object
type: array
feedbackScrapeType:
default: Poll
description: FeedbackScrapeType represents the way to monitor
resource, it could be Poll or Watch
enum:
- Poll
- Watch
type: string
resourceIdentifier:
description: |-
ResourceIdentifier represents the group, resource, name and namespace of a resoure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ spec:
- type
type: object
type: array
feedbackScrapeType:
default: Poll
description: FeedbackScrapeType represents the way to monitor
resource, it could be Poll or Watch
enum:
- Poll
- Watch
type: string
resourceIdentifier:
description: |-
ResourceIdentifier represents the group, resource, name and namespace of a resoure.
Expand Down
17 changes: 17 additions & 0 deletions work/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ type ManifestConfigOption struct {
// +listMapKey:=condition
// +optional
ConditionRules []ConditionRule `json:"conditionRules,omitempty"`

// FeedbackScrapeType represents the way to monitor resource, it could be Poll or Watch
// +kubebuilder:validation:Enum=Poll;Watch
// +kubebuilder:default=Poll
// +optional
FeedbackScrapeType FeedbackScrapeType `json:"feedbackScrapeType,omitempty"`
}

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

// FeedbackScrapeType represents the type of method to monitor resource and feedback
type FeedbackScrapeType string

const (
// FeedbackPollType indicates checking resource in polling way
FeedbackPollType FeedbackScrapeType = "Poll"

// FeedbackWatchType indicates watching resource
FeedbackWatchType FeedbackScrapeType = "Watch"
)

// ManifestWorkExecutor is the executor that applies the resources to the managed cluster. i.e. the
// work agent.
type ManifestWorkExecutor struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ spec:
- type
type: object
type: array
feedbackScrapeType:
default: Poll
description: FeedbackScrapeType represents the way to monitor
resource, it could be Poll or Watch
enum:
- Poll
- Watch
type: string
resourceIdentifier:
description: |-
ResourceIdentifier represents the group, resource, name and namespace of a resoure.
Expand Down