Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl committed Sep 26, 2023
1 parent 4daa4dd commit ce17fc4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ spec:
type: string
description: Args corresponds to a map of key/value pairs that can
be used to substitute placeholders in the AnalysisValueTemplate
query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:)".
query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:})".
type: object
timeframe:
description: Timeframe specifies the range for the corresponding query
in the AnalysisValueTemplate
in the AnalysisValueTemplate. Please note that either a combination
of 'from' and 'to' or the 'recent' property may be set. If this
is not the case, the Analysis can not be added to the cluster.
properties:
from:
description: From is the time of start for the query, this field
Expand Down
4 changes: 3 additions & 1 deletion helm/chart/templates/analysis-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ spec:
type: object
timeframe:
description: Timeframe specifies the range for the corresponding query
in the AnalysisValueTemplate
in the AnalysisValueTemplate. Please note that either a combination
of 'from' and 'to' or the 'recent' property may be set. If this
is not the case, the Analysis can not be added to the cluster.
properties:
from:
description: From is the time of start for the query, this field
Expand Down
4 changes: 3 additions & 1 deletion metrics-operator/api/v1alpha3/analysis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import (

// AnalysisSpec defines the desired state of Analysis
type AnalysisSpec struct {
//Timeframe specifies the range for the corresponding query in the AnalysisValueTemplate
// Timeframe specifies the range for the corresponding query in the AnalysisValueTemplate. Please note that either
// a combination of 'from' and 'to' or the 'recent' property may be set. If this is not the case, the Analysis can
// not be added to the cluster.
Timeframe `json:"timeframe"`
// Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.foo}})".
Args map[string]string `json:"args,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions metrics-operator/api/v1alpha3/analysis_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ webhook.Validator = &Analysis{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (a *Analysis) ValidateCreate() (admission.Warnings, error) {
Analysislog.Info("validate create", "name", a.Name)
Analysislog.Info("validate create", "name", a.Name, "namespace", a.Namespace)

if err := a.validateTimeframe(); err != nil {
return admission.Warnings{}, err
Expand All @@ -52,7 +52,7 @@ func (a *Analysis) ValidateCreate() (admission.Warnings, error) {

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (a *Analysis) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
Analysislog.Info("validate update", "name", a.Name)
Analysislog.Info("validate update", "name", a.Name, "namespace", a.Namespace)

if err := a.validateTimeframe(); err != nil {
return admission.Warnings{}, err
Expand All @@ -63,7 +63,7 @@ func (a *Analysis) ValidateUpdate(old runtime.Object) (admission.Warnings, error

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (a *Analysis) ValidateDelete() (admission.Warnings, error) {
Analysislog.Info("validate delete", "name", a.Name)
Analysislog.Info("validate delete", "name", a.Name, "namespace", a.Namespace)

return admission.Warnings{}, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ spec:
type: object
timeframe:
description: Timeframe specifies the range for the corresponding query
in the AnalysisValueTemplate
in the AnalysisValueTemplate. Please note that either a combination
of 'from' and 'to' or the 'recent' property may be set. If this
is not the case, the Analysis can not be added to the cluster.
properties:
from:
description: From is the time of start for the query, this field
Expand Down

0 comments on commit ce17fc4

Please sign in to comment.