Skip to content

Commit

Permalink
fix: more type fixes for inputs
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek committed Jul 14, 2023
1 parent fff2d40 commit 0e9838e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 37 deletions.
2 changes: 0 additions & 2 deletions api/observability/v1alpha1/loki_limit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ func (t *BlockedQueryTypes) UnmarshalYAML(unmarshal func(interface{}) error) err
return nil
}

type BlockedQueryInput BlockedQuery

type RulerAlertManagerConfig struct {
// URL of the Alertmanager to send notifications to.
AlertmanagerURL string `yaml:"alertmanager_url,omitempty" json:"alertmanager_url,omitempty"`
Expand Down
15 changes: 15 additions & 0 deletions api/observability/v1alpha1/prom_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ type ProxyConfig struct {
// +kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9_]*$"
type LabelName string

// UnmarshalGQL implements the graphql.Unmarshaler interface
func (l *LabelName) UnmarshalGQL(v interface{}) error {
label, ok := v.(string)
if !ok {
return fmt.Errorf("LabelName must be a string")
}
*l = LabelName(label)
return nil
}

// MarshalGQL implements the graphql.Marshaler interface
func (l LabelName) MarshalGQL(w io.Writer) {
w.Write([]byte(l))
}

type RelabelConfig struct {
// A list of labels from which values are taken and concatenated
// with the configured separator in order.
Expand Down
35 changes: 0 additions & 35 deletions api/observability/v1alpha1/zz_generated.deepcopy.go

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

0 comments on commit 0e9838e

Please sign in to comment.