-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metrics-operator): add AnalysisValueTemplate CRD (#1822)
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
- Loading branch information
Showing
13 changed files
with
436 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: analysisvaluetemplates.metrics.keptn.sh | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.12.1 | ||
labels: | ||
app.kubernetes.io/part-of: keptn-lifecycle-toolkit | ||
crdGroup: metrics.keptn.sh | ||
keptn.sh/inject-cert: "true" | ||
{{- include "chart.labels" . | nindent 4 }} | ||
spec: | ||
group: metrics.keptn.sh | ||
names: | ||
kind: AnalysisValueTemplate | ||
listKind: AnalysisValueTemplateList | ||
plural: analysisvaluetemplates | ||
singular: analysisvaluetemplate | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .spec.provider.name | ||
name: Provider | ||
type: string | ||
name: v1alpha3 | ||
schema: | ||
openAPIV3Schema: | ||
description: AnalysisValueTemplate is the Schema for the analysisvaluetemplates | ||
API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: Spec contains the specification for the AnalysisValueTemplate | ||
properties: | ||
provider: | ||
description: Provider refers to the KeptnMetricsProvider which should | ||
be used to retrieve the data | ||
properties: | ||
name: | ||
description: Name defines the name of the referenced object | ||
type: string | ||
namespace: | ||
description: Namespace defines the namespace of the referenced | ||
object | ||
type: string | ||
required: | ||
- name | ||
type: object | ||
query: | ||
description: Query represents the query to be run. It can include | ||
placeholders that are defined using the go template syntax. More | ||
info on go templating - https://pkg.go.dev/text/template | ||
type: string | ||
required: | ||
- provider | ||
- query | ||
type: object | ||
status: | ||
description: unused field | ||
type: string | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
metrics-operator/api/v1alpha3/analysisvaluetemplate_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha3 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// AnalysisValueTemplateSpec defines the desired state of AnalysisValueTemplate | ||
type AnalysisValueTemplateSpec struct { | ||
// Provider refers to the KeptnMetricsProvider which should be used to retrieve the data | ||
Provider ObjectReference `json:"provider"` | ||
// Query represents the query to be run. It can include placeholders that are defined using the go template | ||
// syntax. More info on go templating - https://pkg.go.dev/text/template | ||
Query string `json:"query"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="Provider",type=string,JSONPath=`.spec.provider.name` | ||
|
||
// AnalysisValueTemplate is the Schema for the analysisvaluetemplates API | ||
type AnalysisValueTemplate struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec contains the specification for the AnalysisValueTemplate | ||
Spec AnalysisValueTemplateSpec `json:"spec,omitempty"` | ||
// unused field | ||
Status string `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// AnalysisValueTemplateList contains a list of AnalysisValueTemplate | ||
type AnalysisValueTemplateList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []AnalysisValueTemplate `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&AnalysisValueTemplate{}, &AnalysisValueTemplateList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
metrics-operator/config/crd/bases/metrics.keptn.sh_analysisvaluetemplates.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.12.1 | ||
name: analysisvaluetemplates.metrics.keptn.sh | ||
spec: | ||
group: metrics.keptn.sh | ||
names: | ||
kind: AnalysisValueTemplate | ||
listKind: AnalysisValueTemplateList | ||
plural: analysisvaluetemplates | ||
singular: analysisvaluetemplate | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .spec.provider.name | ||
name: Provider | ||
type: string | ||
name: v1alpha3 | ||
schema: | ||
openAPIV3Schema: | ||
description: AnalysisValueTemplate is the Schema for the analysisvaluetemplates | ||
API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: Spec contains the specification for the AnalysisValueTemplate | ||
properties: | ||
provider: | ||
description: Provider refers to the KeptnMetricsProvider which should | ||
be used to retrieve the data | ||
properties: | ||
name: | ||
description: Name defines the name of the referenced object | ||
type: string | ||
namespace: | ||
description: Namespace defines the namespace of the referenced | ||
object | ||
type: string | ||
required: | ||
- name | ||
type: object | ||
query: | ||
description: Query represents the query to be run. It can include | ||
placeholders that are defined using the go template syntax. More | ||
info on go templating - https://pkg.go.dev/text/template | ||
type: string | ||
required: | ||
- provider | ||
- query | ||
type: object | ||
status: | ||
description: unused field | ||
type: string | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
Oops, something went wrong.