QueryLibrary: Adding Tags as new set field to queries (#105702)

bergquist_update_tempo_ref
Collin Fingar 4 weeks ago committed by GitHub
parent 301d78bf96
commit c23ee1e116
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/apis/query/v0alpha1/template/types.go
  2. 5
      pkg/apis/query/v0alpha1/template/zz_generated.deepcopy.go
  3. 20
      pkg/apis/query/v0alpha1/zz_generated.openapi.go

@ -17,6 +17,10 @@ type QueryTemplate struct {
// Toggle for visible/hidden queries // Toggle for visible/hidden queries
IsVisible bool `json:"isVisible,omitempty"` IsVisible bool `json:"isVisible,omitempty"`
// The tags that can be used to filter the template
// +listType=set
Tags []string `json:"tags,omitempty"`
// Whether the query is locked and cannot be edited // Whether the query is locked and cannot be edited
// Note: This is purely for UI display purposes and not for security // Note: This is purely for UI display purposes and not for security
IsLocked bool `json:"isLocked,omitempty"` IsLocked bool `json:"isLocked,omitempty"`

@ -26,6 +26,11 @@ func (in *Position) DeepCopy() *Position {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *QueryTemplate) DeepCopyInto(out *QueryTemplate) { func (in *QueryTemplate) DeepCopyInto(out *QueryTemplate) {
*out = *in *out = *in
if in.Tags != nil {
in, out := &in.Tags, &out.Tags
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Variables != nil { if in.Variables != nil {
in, out := &in.Variables, &out.Variables in, out := &in.Variables, &out.Variables
*out = make([]TemplateVariable, len(*in)) *out = make([]TemplateVariable, len(*in))

@ -409,6 +409,26 @@ func schema_apis_query_v0alpha1_template_QueryTemplate(ref common.ReferenceCallb
Format: "", Format: "",
}, },
}, },
"tags": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "set",
},
},
SchemaProps: spec.SchemaProps{
Description: "The tags that can be used to filter the template",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
},
},
"isLocked": { "isLocked": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "Whether the query is locked and cannot be edited Note: This is purely for UI display purposes and not for security", Description: "Whether the query is locked and cannot be edited Note: This is purely for UI display purposes and not for security",

Loading…
Cancel
Save