Skip to content

Commit

Permalink
Add autoscaler references in DDM status to improve usability (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
vboulineau authored Jul 9, 2020
1 parent 22f0154 commit 9c71245
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deploy/crds/datadoghq.com_datadogmetrics_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ spec:
- JSONPath: .status.currentValue
name: value
type: string
- JSONPath: .status.autoscalerReferences
name: references
type: string
- JSONPath: .status.conditions[?(@.type=='Updated')].lastUpdateTime
name: update time
type: date
Expand Down Expand Up @@ -54,6 +57,9 @@ spec:
status:
description: DatadogMetricStatus defines the observed state of DatadogMetric
properties:
autoscalerReferences:
description: List of autoscalers currently using this DatadogMetric
type: string
conditions:
description: Conditions Represents the latest available observations
of a DatadogMetric's current state.
Expand Down Expand Up @@ -95,6 +101,7 @@ spec:
description: Value is the latest value of the metric
type: string
required:
- autoscalerReferences
- currentValue
type: object
type: object
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/datadogmetric_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type DatadogMetricStatus struct {
Conditions []DatadogMetricCondition `json:"conditions,omitempty"`
// Value is the latest value of the metric
Value string `json:"currentValue"`
// List of autoscalers currently using this DatadogMetric
AutoscalerReferences string `json:"autoscalerReferences"`
}

// DatadogMetricCondition describes the state of a DatadogMetric at a certain point.
Expand Down Expand Up @@ -73,6 +75,7 @@ const (
// +kubebuilder:printcolumn:name="active",type="string",JSONPath=".status.conditions[?(@.type=='Active')].status"
// +kubebuilder:printcolumn:name="valid",type="string",JSONPath=".status.conditions[?(@.type=='Valid')].status"
// +kubebuilder:printcolumn:name="value",type="string",JSONPath=".status.currentValue"
// +kubebuilder:printcolumn:name="references",type="string",JSONPath=".status.autoscalerReferences"
// +kubebuilder:printcolumn:name="update time",type="date",JSONPath=".status.conditions[?(@.type=='Updated')].lastUpdateTime"
type DatadogMetric struct {
metav1.TypeMeta `json:",inline"`
Expand Down

0 comments on commit 9c71245

Please sign in to comment.