Skip to content

Commit

Permalink
Merge pull request #1439 from flanksource/feat/namespace-for-check
Browse files Browse the repository at this point in the history
feat: namespace on checks
  • Loading branch information
moshloop authored Nov 12, 2023
2 parents 80c0cd8 + 18b2315 commit ab6a631
Show file tree
Hide file tree
Showing 55 changed files with 726 additions and 71 deletions.
1 change: 1 addition & 0 deletions api/external/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Describable interface {
GetDescription() string
GetIcon() string
GetName() string
GetNamespace() string
GetLabels() map[string]string
GetTransformDeleteStrategy() string
GetMetricsSpec() []Metrics
Expand Down
2 changes: 0 additions & 2 deletions api/v1/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type HTTPCheck struct {
Connection `yaml:",inline" json:",inline"`
// Deprecated: Use url instead
Endpoint string `yaml:"endpoint" json:"endpoint,omitempty" template:"true"`
// Namespace to crawl for TLS endpoints. Mutually exclusive with Endpoint
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty" template:"true"`
// Maximum duration in milliseconds for the HTTP request. It will fail the check if it takes longer.
ThresholdMillis int `yaml:"thresholdMillis,omitempty" json:"thresholdMillis,omitempty"`
// Expected response codes for the HTTP Request.
Expand Down
6 changes: 6 additions & 0 deletions api/v1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ type Description struct {
Description string `yaml:"description,omitempty" json:"description,omitempty" template:"true"`
// Name of the check
Name string `yaml:"name" json:"name" template:"true"`
// Namespace of the check
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
// Icon for overwriting default icon on the dashboard
Icon string `yaml:"icon,omitempty" json:"icon,omitempty" template:"true"`
// Labels for the check
Expand Down Expand Up @@ -378,6 +380,10 @@ func (d Description) GetName() string {
return d.Name
}

func (d Description) GetNamespace() string {
return d.Namespace
}

func (d Description) GetLabels() map[string]string {
return d.Labels
}
Expand Down
Loading

0 comments on commit ab6a631

Please sign in to comment.