Skip to content
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

Recommendation Mission #53

Merged
merged 2 commits into from
May 7, 2022
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
18 changes: 15 additions & 3 deletions analysis/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ type AnalyticsSpec struct {
// CompletionStrategy indicate how to complete an Analytics.
// +optional
CompletionStrategy CompletionStrategy `json:"completionStrategy"`

// Override Recommendation configs
// +optional
Config map[string]string `json:"config,omitempty"`
}

// CompletionStrategy presents how to complete a recommendation or a recommendation request.
Expand Down Expand Up @@ -151,17 +155,25 @@ type AnalyticsStatus struct {
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

// Recommendations is a list of pointers to recommendations that are updated by this analytics.
// Recommendations is a list of RecommendationMission that run parallel.
// +optional
// +listType=atomic
Recommendations []RecommendationReference `json:"recommendations,omitempty"`
Recommendations []RecommendationMission `json:"recommendations,omitempty"`
}

type RecommendationReference struct {
type RecommendationMission struct {
corev1.ObjectReference `json:",inline"`

// +optional
TargetRef corev1.ObjectReference `json:"targetRef"`

// LastStartTime is last time we start a recommendation mission.
// +optional
LastStartTime *metav1.Time `json:"lastStartTime,omitempty"`

// Message presents the running message for this mission
// +optional
Message string `json:"message,omitempty"`
}

// ResourceSelector describes how the resources will be selected.
Expand Down
26 changes: 20 additions & 6 deletions analysis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions artifacts/deploy/analysis.crane.io_analytics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ spec:
format: int64
type: integer
type: object
config:
additionalProperties:
type: string
description: Override Recommendation configs
type: object
resourceSelectors:
description: ResourceSelector indicates how to select resources(e.g.
a set of Deployments) for an Analytics.
Expand Down Expand Up @@ -210,8 +215,8 @@ spec:
format: date-time
type: string
recommendations:
description: Recommendations is a list of pointers to recommendations
that are updated by this analytics.
description: Recommendations is a list of RecommendationMission that
run parallel.
items:
properties:
apiVersion:
Expand All @@ -233,6 +238,14 @@ spec:
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
lastStartTime:
description: LastStartTime is last time we start a recommendation
mission.
format: date-time
type: string
message:
description: Message presents the running message for this mission
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
Expand Down