diff --git a/apps/advisor/kinds/check.cue b/apps/advisor/kinds/check.cue
index 755561ab615..2ce51faf910 100644
--- a/apps/advisor/kinds/check.cue
+++ b/apps/advisor/kinds/check.cue
@@ -40,6 +40,8 @@ check: {
itemID: string
// Links to actions that can be taken to resolve the failure
links: [...#ErrorLink]
+ // More information about the failure, not meant to be displayed to the user. Used for LLM suggestions.
+ moreInfo?: string
}
#Report: {
// Number of elements analyzed
diff --git a/apps/advisor/pkg/apis/advisor/v0alpha1/check_status_gen.go b/apps/advisor/pkg/apis/advisor/v0alpha1/check_status_gen.go
index 1658881108b..b77811fefc2 100644
--- a/apps/advisor/pkg/apis/advisor/v0alpha1/check_status_gen.go
+++ b/apps/advisor/pkg/apis/advisor/v0alpha1/check_status_gen.go
@@ -27,6 +27,8 @@ type CheckReportFailure struct {
ItemID string `json:"itemID"`
// Links to actions that can be taken to resolve the failure
Links []CheckErrorLink `json:"links"`
+ // More information about the failure, not meant to be displayed to the user. Used for LLM suggestions.
+ MoreInfo *string `json:"moreInfo,omitempty"`
}
// NewCheckReportFailure creates a new CheckReportFailure object.
diff --git a/apps/advisor/pkg/apis/advisor/v0alpha1/zz_openapi_gen.go b/apps/advisor/pkg/apis/advisor/v0alpha1/zz_openapi_gen.go
index bf1119a40e6..84e85e7f5ba 100644
--- a/apps/advisor/pkg/apis/advisor/v0alpha1/zz_openapi_gen.go
+++ b/apps/advisor/pkg/apis/advisor/v0alpha1/zz_openapi_gen.go
@@ -205,6 +205,13 @@ func schema_pkg_apis_advisor_v0alpha1_CheckReportFailure(ref common.ReferenceCal
},
},
},
+ "moreInfo": {
+ SchemaProps: spec.SchemaProps{
+ Description: "More information about the failure, not meant to be displayed to the user. Used for LLM suggestions.",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
},
Required: []string{"severity", "stepID", "item", "itemID", "links"},
},
diff --git a/apps/advisor/pkg/apis/advisor_manifest.go b/apps/advisor/pkg/apis/advisor_manifest.go
index 73246227712..6f5d472dc54 100644
--- a/apps/advisor/pkg/apis/advisor_manifest.go
+++ b/apps/advisor/pkg/apis/advisor_manifest.go
@@ -12,7 +12,7 @@ import (
)
var (
- rawSchemaCheckv0alpha1 = []byte(`{"spec":{"properties":{"data":{"additionalProperties":{"type":"string"},"description":"Generic data input that a check can receive","type":"object"}},"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"},"report":{"properties":{"count":{"description":"Number of elements analyzed","type":"integer"},"failures":{"description":"List of failures","items":{"properties":{"item":{"description":"Human readable identifier of the item that failed","type":"string"},"itemID":{"description":"ID of the item that failed","type":"string"},"links":{"description":"Links to actions that can be taken to resolve the failure","items":{"properties":{"message":{"description":"Human readable error message","type":"string"},"url":{"description":"URL to a page with more information about the error","type":"string"}},"required":["url","message"],"type":"object"},"type":"array"},"severity":{"description":"Severity of the failure","enum":["high","low"],"type":"string"},"stepID":{"description":"Step ID that the failure is associated with","type":"string"}},"required":["severity","stepID","item","itemID","links"],"type":"object"},"type":"array"}},"required":["count","failures"],"type":"object"}},"required":["report"],"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
+ rawSchemaCheckv0alpha1 = []byte(`{"spec":{"properties":{"data":{"additionalProperties":{"type":"string"},"description":"Generic data input that a check can receive","type":"object"}},"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"},"report":{"properties":{"count":{"description":"Number of elements analyzed","type":"integer"},"failures":{"description":"List of failures","items":{"properties":{"item":{"description":"Human readable identifier of the item that failed","type":"string"},"itemID":{"description":"ID of the item that failed","type":"string"},"links":{"description":"Links to actions that can be taken to resolve the failure","items":{"properties":{"message":{"description":"Human readable error message","type":"string"},"url":{"description":"URL to a page with more information about the error","type":"string"}},"required":["url","message"],"type":"object"},"type":"array"},"moreInfo":{"description":"More information about the failure, not meant to be displayed to the user. Used for LLM suggestions.","type":"string"},"severity":{"description":"Severity of the failure","enum":["high","low"],"type":"string"},"stepID":{"description":"Step ID that the failure is associated with","type":"string"}},"required":["severity","stepID","item","itemID","links"],"type":"object"},"type":"array"}},"required":["count","failures"],"type":"object"}},"required":["report"],"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
versionSchemaCheckv0alpha1 app.VersionSchema
_ = json.Unmarshal(rawSchemaCheckv0alpha1, &versionSchemaCheckv0alpha1)
rawSchemaCheckTypev0alpha1 = []byte(`{"spec":{"properties":{"name":{"type":"string"},"steps":{"items":{"properties":{"description":{"type":"string"},"resolution":{"type":"string"},"stepID":{"type":"string"},"title":{"type":"string"}},"required":["title","description","stepID","resolution"],"type":"object"},"type":"array"}},"required":["name","steps"],"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
diff --git a/apps/advisor/pkg/app/checks/datasourcecheck/check.go b/apps/advisor/pkg/app/checks/datasourcecheck/check.go
index e5bdc4c4e2e..38846740814 100644
--- a/apps/advisor/pkg/app/checks/datasourcecheck/check.go
+++ b/apps/advisor/pkg/app/checks/datasourcecheck/check.go
@@ -3,19 +3,14 @@ package datasourcecheck
import (
"context"
"errors"
- "fmt"
- sysruntime "runtime"
- "github.com/grafana/grafana-app-sdk/logging"
"github.com/grafana/grafana-plugin-sdk-go/backend"
- advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/repo"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
- "github.com/grafana/grafana/pkg/util"
)
const (
@@ -110,179 +105,6 @@ func (c *check) Steps() []checks.Step {
}
}
-type uidValidationStep struct{}
-
-func (s *uidValidationStep) ID() string {
- return UIDValidationStepID
-}
-
-func (s *uidValidationStep) Title() string {
- return "UID validation"
-}
-
-func (s *uidValidationStep) Description() string {
- return "Checks if the UID of a data source is valid."
-}
-
-func (s *uidValidationStep) Resolution() string {
- return "Check the documentation for more information or delete the data source and create a new one."
-}
-
-func (s *uidValidationStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
- ds, ok := i.(*datasources.DataSource)
- if !ok {
- return nil, fmt.Errorf("invalid item type %T", i)
- }
- // Data source UID validation
- err := util.ValidateUID(ds.UID)
- if err != nil {
- return []advisor.CheckReportFailure{checks.NewCheckReportFailure(
- advisor.CheckReportFailureSeverityLow,
- s.ID(),
- fmt.Sprintf("%s (%s)", ds.Name, ds.UID),
- ds.UID,
- []advisor.CheckErrorLink{},
- )}, nil
- }
- return nil, nil
-}
-
-type healthCheckStep struct {
- PluginContextProvider pluginContextProvider
- PluginClient plugins.Client
-}
-
-func (s *healthCheckStep) Title() string {
- return "Health check"
-}
-
-func (s *healthCheckStep) Description() string {
- return "Checks if a data source is healthy."
-}
-
-func (s *healthCheckStep) Resolution() string {
- return "Go to the data source configuration page and address the issues reported."
-}
-
-func (s *healthCheckStep) ID() string {
- return HealthCheckStepID
-}
-
-func (s *healthCheckStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
- ds, ok := i.(*datasources.DataSource)
- if !ok {
- return nil, fmt.Errorf("invalid item type %T", i)
- }
-
- // Health check execution
- requester, err := identity.GetRequester(ctx)
- if err != nil {
- return nil, err
- }
- pCtx, err := s.PluginContextProvider.GetWithDataSource(ctx, ds.Type, requester, ds)
- if err != nil {
- if errors.Is(err, plugins.ErrPluginNotRegistered) {
- // The plugin is not installed, handle this in the missing plugin step
- return nil, nil
- }
- // Unable to check health check
- log.Error("Failed to get plugin context", "datasource_uid", ds.UID, "error", err)
- return nil, nil
- }
- req := &backend.CheckHealthRequest{
- PluginContext: pCtx,
- Headers: map[string]string{},
- }
- resp, err := s.PluginClient.CheckHealth(ctx, req)
- if err != nil || resp.Status != backend.HealthStatusOk {
- if err != nil {
- log.Debug("Failed to check health", "datasource_uid", ds.UID, "error", err)
- if errors.Is(err, plugins.ErrMethodNotImplemented) || errors.Is(err, plugins.ErrPluginUnavailable) {
- // The plugin does not support backend health checks
- return nil, nil
- }
- } else {
- log.Debug("Failed to check health", "datasource_uid", ds.UID, "status", resp.Status, "message", resp.Message)
- }
- return []advisor.CheckReportFailure{checks.NewCheckReportFailure(
- advisor.CheckReportFailureSeverityHigh,
- s.ID(),
- ds.Name,
- ds.UID,
- []advisor.CheckErrorLink{
- {
- Message: "Fix me",
- Url: fmt.Sprintf("/connections/datasources/edit/%s", ds.UID),
- },
- },
- )}, nil
- }
- return nil, nil
-}
-
-type missingPluginStep struct {
- PluginStore pluginstore.Store
- PluginRepo repo.Service
- GrafanaVersion string
-}
-
-func (s *missingPluginStep) Title() string {
- return "Missing plugin check"
-}
-
-func (s *missingPluginStep) Description() string {
- return "Checks if the plugin associated with the data source is installed and available."
-}
-
-func (s *missingPluginStep) Resolution() string {
- return "Delete the datasource or install the plugin."
-}
-
-func (s *missingPluginStep) ID() string {
- return MissingPluginStepID
-}
-
-func (s *missingPluginStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
- ds, ok := i.(*datasources.DataSource)
- if !ok {
- return nil, fmt.Errorf("invalid item type %T", i)
- }
-
- _, exists := s.PluginStore.Plugin(ctx, ds.Type)
- if !exists {
- links := []advisor.CheckErrorLink{
- {
- Message: "Delete data source",
- Url: fmt.Sprintf("/connections/datasources/edit/%s", ds.UID),
- },
- }
- plugins, err := s.PluginRepo.GetPluginsInfo(ctx, repo.GetPluginsInfoOptions{
- IncludeDeprecated: true,
- Plugins: []string{ds.Type},
- }, repo.NewCompatOpts(s.GrafanaVersion, sysruntime.GOOS, sysruntime.GOARCH))
- if err != nil {
- return nil, err
- }
- if len(plugins) > 0 {
- // Plugin is available in the repo
- links = append(links, advisor.CheckErrorLink{
- Message: "View plugin",
- Url: fmt.Sprintf("/plugins/%s", ds.Type),
- })
- }
- // The plugin is not installed
- return []advisor.CheckReportFailure{checks.NewCheckReportFailure(
- advisor.CheckReportFailureSeverityHigh,
- s.ID(),
- ds.Name,
- ds.UID,
- links,
- )}, nil
- }
- return nil, nil
-}
-
type pluginContextProvider interface {
GetWithDataSource(ctx context.Context, pluginID string, user identity.Requester, ds *datasources.DataSource) (backend.PluginContext, error)
}
diff --git a/apps/advisor/pkg/app/checks/datasourcecheck/check_test.go b/apps/advisor/pkg/app/checks/datasourcecheck/check_test.go
index d9cb532b9d5..fb02a8892ad 100644
--- a/apps/advisor/pkg/app/checks/datasourcecheck/check_test.go
+++ b/apps/advisor/pkg/app/checks/datasourcecheck/check_test.go
@@ -107,7 +107,7 @@ func TestCheck_Run(t *testing.T) {
mockDatasourceSvc := &MockDatasourceSvc{dss: datasources}
mockPluginContextProvider := &MockPluginContextProvider{pCtx: backend.PluginContext{}}
- mockPluginClient := &MockPluginClient{res: &backend.CheckHealthResult{Status: backend.HealthStatusError}}
+ mockPluginClient := &MockPluginClient{res: &backend.CheckHealthResult{Status: backend.HealthStatusError, Message: "test message"}}
mockPluginRepo := &MockPluginRepo{plugins: []repo.PluginInfo{
{ID: 1, Slug: "prometheus", Status: "active"},
}}
@@ -125,6 +125,7 @@ func TestCheck_Run(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, failures, 1)
assert.Equal(t, "health-check", failures[0].StepID)
+ assert.Contains(t, *failures[0].MoreInfo, "test message")
})
t.Run("should skip health check when plugin does not support backend health checks", func(t *testing.T) {
diff --git a/apps/advisor/pkg/app/checks/datasourcecheck/health_check_step.go b/apps/advisor/pkg/app/checks/datasourcecheck/health_check_step.go
new file mode 100644
index 00000000000..c020d0ba82a
--- /dev/null
+++ b/apps/advisor/pkg/app/checks/datasourcecheck/health_check_step.go
@@ -0,0 +1,93 @@
+package datasourcecheck
+
+import (
+ "context"
+ "errors"
+ "fmt"
+
+ "github.com/grafana/grafana-app-sdk/logging"
+ "github.com/grafana/grafana-plugin-sdk-go/backend"
+ advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
+ "github.com/grafana/grafana/apps/advisor/pkg/app/checks"
+ "github.com/grafana/grafana/pkg/apimachinery/identity"
+ "github.com/grafana/grafana/pkg/plugins"
+ "github.com/grafana/grafana/pkg/services/datasources"
+)
+
+type healthCheckStep struct {
+ PluginContextProvider pluginContextProvider
+ PluginClient plugins.Client
+}
+
+func (s *healthCheckStep) Title() string {
+ return "Health check"
+}
+
+func (s *healthCheckStep) Description() string {
+ return "Checks if a data source is healthy."
+}
+
+func (s *healthCheckStep) Resolution() string {
+ return "Go to the data source configuration page and address the issues reported."
+}
+
+func (s *healthCheckStep) ID() string {
+ return HealthCheckStepID
+}
+
+func (s *healthCheckStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
+ ds, ok := i.(*datasources.DataSource)
+ if !ok {
+ return nil, fmt.Errorf("invalid item type %T", i)
+ }
+
+ // Health check execution
+ requester, err := identity.GetRequester(ctx)
+ if err != nil {
+ return nil, err
+ }
+ pCtx, err := s.PluginContextProvider.GetWithDataSource(ctx, ds.Type, requester, ds)
+ if err != nil {
+ if errors.Is(err, plugins.ErrPluginNotRegistered) {
+ // The plugin is not installed, handle this in the missing plugin step
+ return nil, nil
+ }
+ // Unable to check health check
+ log.Error("Failed to get plugin context", "datasource_uid", ds.UID, "error", err)
+ return nil, nil
+ }
+ req := &backend.CheckHealthRequest{
+ PluginContext: pCtx,
+ Headers: map[string]string{},
+ }
+ resp, err := s.PluginClient.CheckHealth(ctx, req)
+ if err != nil || (resp != nil && resp.Status != backend.HealthStatusOk) {
+ if err != nil {
+ log.Debug("Failed to check health", "datasource_uid", ds.UID, "error", err)
+ if errors.Is(err, plugins.ErrMethodNotImplemented) || errors.Is(err, plugins.ErrPluginUnavailable) {
+ // The plugin does not support backend health checks
+ return nil, nil
+ }
+ } else {
+ log.Debug("Failed to check health", "datasource_uid", ds.UID, "status", resp.Status, "message", resp.Message)
+ }
+ moreInfo := ""
+ if resp != nil {
+ moreInfo = fmt.Sprintf("Status: %s\nMessage: %s\nJSONDetails: %s", resp.Status, resp.Message, resp.JSONDetails)
+ }
+ return []advisor.CheckReportFailure{checks.NewCheckReportFailureWithMoreInfo(
+ advisor.CheckReportFailureSeverityHigh,
+ s.ID(),
+ ds.Name,
+ ds.UID,
+ []advisor.CheckErrorLink{
+ {
+ Message: "Fix me",
+ Url: fmt.Sprintf("/connections/datasources/edit/%s", ds.UID),
+ },
+ },
+ moreInfo,
+ )}, nil
+ }
+ return nil, nil
+}
diff --git a/apps/advisor/pkg/app/checks/datasourcecheck/missing_plugin_step.go b/apps/advisor/pkg/app/checks/datasourcecheck/missing_plugin_step.go
new file mode 100644
index 00000000000..1d784f0a544
--- /dev/null
+++ b/apps/advisor/pkg/app/checks/datasourcecheck/missing_plugin_step.go
@@ -0,0 +1,77 @@
+package datasourcecheck
+
+import (
+ "context"
+ "fmt"
+ sysruntime "runtime"
+
+ "github.com/grafana/grafana-app-sdk/logging"
+ advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
+ "github.com/grafana/grafana/apps/advisor/pkg/app/checks"
+ "github.com/grafana/grafana/pkg/plugins/repo"
+ "github.com/grafana/grafana/pkg/services/datasources"
+ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
+)
+
+type missingPluginStep struct {
+ PluginStore pluginstore.Store
+ PluginRepo repo.Service
+ GrafanaVersion string
+}
+
+func (s *missingPluginStep) Title() string {
+ return "Missing plugin check"
+}
+
+func (s *missingPluginStep) Description() string {
+ return "Checks if the plugin associated with the data source is installed and available."
+}
+
+func (s *missingPluginStep) Resolution() string {
+ return "Delete the datasource or install the plugin."
+}
+
+func (s *missingPluginStep) ID() string {
+ return MissingPluginStepID
+}
+
+func (s *missingPluginStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
+ ds, ok := i.(*datasources.DataSource)
+ if !ok {
+ return nil, fmt.Errorf("invalid item type %T", i)
+ }
+
+ _, exists := s.PluginStore.Plugin(ctx, ds.Type)
+ if !exists {
+ links := []advisor.CheckErrorLink{
+ {
+ Message: "Delete data source",
+ Url: fmt.Sprintf("/connections/datasources/edit/%s", ds.UID),
+ },
+ }
+ plugins, err := s.PluginRepo.GetPluginsInfo(ctx, repo.GetPluginsInfoOptions{
+ IncludeDeprecated: true,
+ Plugins: []string{ds.Type},
+ }, repo.NewCompatOpts(s.GrafanaVersion, sysruntime.GOOS, sysruntime.GOARCH))
+ if err != nil {
+ return nil, err
+ }
+ if len(plugins) > 0 {
+ // Plugin is available in the repo
+ links = append(links, advisor.CheckErrorLink{
+ Message: "View plugin",
+ Url: fmt.Sprintf("/plugins/%s", ds.Type),
+ })
+ }
+ // The plugin is not installed
+ return []advisor.CheckReportFailure{checks.NewCheckReportFailureWithMoreInfo(
+ advisor.CheckReportFailureSeverityHigh,
+ s.ID(),
+ ds.Name,
+ ds.UID,
+ links,
+ fmt.Sprintf("Plugin: %s", ds.Type),
+ )}, nil
+ }
+ return nil, nil
+}
diff --git a/apps/advisor/pkg/app/checks/datasourcecheck/uid_validation_step.go b/apps/advisor/pkg/app/checks/datasourcecheck/uid_validation_step.go
new file mode 100644
index 00000000000..0f183339aba
--- /dev/null
+++ b/apps/advisor/pkg/app/checks/datasourcecheck/uid_validation_step.go
@@ -0,0 +1,50 @@
+package datasourcecheck
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/grafana/grafana-app-sdk/logging"
+ advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
+ "github.com/grafana/grafana/apps/advisor/pkg/app/checks"
+ "github.com/grafana/grafana/pkg/services/datasources"
+ "github.com/grafana/grafana/pkg/util"
+)
+
+type uidValidationStep struct{}
+
+func (s *uidValidationStep) ID() string {
+ return UIDValidationStepID
+}
+
+func (s *uidValidationStep) Title() string {
+ return "UID validation"
+}
+
+func (s *uidValidationStep) Description() string {
+ return "Checks if the UID of a data source is valid."
+}
+
+func (s *uidValidationStep) Resolution() string {
+ return "Check the documentation for more information or delete the data source and create a new one."
+}
+
+func (s *uidValidationStep) Run(ctx context.Context, log logging.Logger, obj *advisor.CheckSpec, i any) ([]advisor.CheckReportFailure, error) {
+ ds, ok := i.(*datasources.DataSource)
+ if !ok {
+ return nil, fmt.Errorf("invalid item type %T", i)
+ }
+ // Data source UID validation
+ err := util.ValidateUID(ds.UID)
+ if err != nil {
+ return []advisor.CheckReportFailure{checks.NewCheckReportFailure(
+ advisor.CheckReportFailureSeverityLow,
+ s.ID(),
+ fmt.Sprintf("%s (%s)", ds.Name, ds.UID),
+ ds.UID,
+ []advisor.CheckErrorLink{},
+ )}, nil
+ }
+ return nil, nil
+}
diff --git a/apps/advisor/pkg/app/checks/utils.go b/apps/advisor/pkg/app/checks/utils.go
index 7ca9cc473b4..0abcb8a603b 100644
--- a/apps/advisor/pkg/app/checks/utils.go
+++ b/apps/advisor/pkg/app/checks/utils.go
@@ -39,6 +39,24 @@ func NewCheckReportFailure(
}
}
+func NewCheckReportFailureWithMoreInfo(
+ severity advisor.CheckReportFailureSeverity,
+ stepID string,
+ item string,
+ itemID string,
+ links []advisor.CheckErrorLink,
+ moreInfo string,
+) advisor.CheckReportFailure {
+ return advisor.CheckReportFailure{
+ Severity: severity,
+ StepID: stepID,
+ Item: item,
+ ItemID: itemID,
+ Links: links,
+ MoreInfo: &moreInfo,
+ }
+}
+
func GetNamespace(stackID string) (string, error) {
if stackID == "" {
return metav1.NamespaceDefault, nil
diff --git a/pkg/tests/apis/openapi_snapshots/advisor.grafana.app-v0alpha1.json b/pkg/tests/apis/openapi_snapshots/advisor.grafana.app-v0alpha1.json
index 7b2fad7ec8f..1fb2aa6d751 100644
--- a/pkg/tests/apis/openapi_snapshots/advisor.grafana.app-v0alpha1.json
+++ b/pkg/tests/apis/openapi_snapshots/advisor.grafana.app-v0alpha1.json
@@ -1851,6 +1851,10 @@
]
}
},
+ "moreInfo": {
+ "description": "More information about the failure, not meant to be displayed to the user. Used for LLM suggestions.",
+ "type": "string"
+ },
"severity": {
"description": "Severity of the failure",
"type": "string",
diff --git a/public/app/api/clients/advisor/v0alpha1/endpoints.gen.ts b/public/app/api/clients/advisor/v0alpha1/endpoints.gen.ts
index afadfbb5bf3..86ca7fa2a38 100644
--- a/public/app/api/clients/advisor/v0alpha1/endpoints.gen.ts
+++ b/public/app/api/clients/advisor/v0alpha1/endpoints.gen.ts
@@ -1,11 +1,15 @@
import { api } from './baseAPI';
-export const addTagTypes = ['Check', 'CheckType'] as const;
+export const addTagTypes = ['API Discovery', 'Check', 'CheckType'] as const;
const injectedRtkApi = api
.enhanceEndpoints({
addTagTypes,
})
.injectEndpoints({
endpoints: (build) => ({
+ getApiResources: build.query({
+ query: () => ({ url: `/apis/advisor.grafana.app/v0alpha1/` }),
+ providesTags: ['API Discovery'],
+ }),
listCheck: build.query({
query: (queryArg) => ({
url: `/checks`,
@@ -39,6 +43,29 @@ const injectedRtkApi = api
}),
invalidatesTags: ['Check'],
}),
+ deletecollectionCheck: build.mutation({
+ query: (queryArg) => ({
+ url: `/checks`,
+ method: 'DELETE',
+ params: {
+ pretty: queryArg.pretty,
+ continue: queryArg['continue'],
+ dryRun: queryArg.dryRun,
+ fieldSelector: queryArg.fieldSelector,
+ gracePeriodSeconds: queryArg.gracePeriodSeconds,
+ ignoreStoreReadErrorWithClusterBreakingPotential: queryArg.ignoreStoreReadErrorWithClusterBreakingPotential,
+ labelSelector: queryArg.labelSelector,
+ limit: queryArg.limit,
+ orphanDependents: queryArg.orphanDependents,
+ propagationPolicy: queryArg.propagationPolicy,
+ resourceVersion: queryArg.resourceVersion,
+ resourceVersionMatch: queryArg.resourceVersionMatch,
+ sendInitialEvents: queryArg.sendInitialEvents,
+ timeoutSeconds: queryArg.timeoutSeconds,
+ },
+ }),
+ invalidatesTags: ['Check'],
+ }),
getCheck: build.query({
query: (queryArg) => ({
url: `/checks/${queryArg.name}`,
@@ -48,6 +75,20 @@ const injectedRtkApi = api
}),
providesTags: ['Check'],
}),
+ replaceCheck: build.mutation({
+ query: (queryArg) => ({
+ url: `/checks/${queryArg.name}`,
+ method: 'PUT',
+ body: queryArg.check,
+ params: {
+ pretty: queryArg.pretty,
+ dryRun: queryArg.dryRun,
+ fieldManager: queryArg.fieldManager,
+ fieldValidation: queryArg.fieldValidation,
+ },
+ }),
+ invalidatesTags: ['Check'],
+ }),
deleteCheck: build.mutation({
query: (queryArg) => ({
url: `/checks/${queryArg.name}`,
@@ -97,6 +138,81 @@ const injectedRtkApi = api
}),
providesTags: ['CheckType'],
}),
+ createCheckType: build.mutation({
+ query: (queryArg) => ({
+ url: `/checktypes`,
+ method: 'POST',
+ body: queryArg.checkType,
+ params: {
+ pretty: queryArg.pretty,
+ dryRun: queryArg.dryRun,
+ fieldManager: queryArg.fieldManager,
+ fieldValidation: queryArg.fieldValidation,
+ },
+ }),
+ invalidatesTags: ['CheckType'],
+ }),
+ deletecollectionCheckType: build.mutation({
+ query: (queryArg) => ({
+ url: `/checktypes`,
+ method: 'DELETE',
+ params: {
+ pretty: queryArg.pretty,
+ continue: queryArg['continue'],
+ dryRun: queryArg.dryRun,
+ fieldSelector: queryArg.fieldSelector,
+ gracePeriodSeconds: queryArg.gracePeriodSeconds,
+ ignoreStoreReadErrorWithClusterBreakingPotential: queryArg.ignoreStoreReadErrorWithClusterBreakingPotential,
+ labelSelector: queryArg.labelSelector,
+ limit: queryArg.limit,
+ orphanDependents: queryArg.orphanDependents,
+ propagationPolicy: queryArg.propagationPolicy,
+ resourceVersion: queryArg.resourceVersion,
+ resourceVersionMatch: queryArg.resourceVersionMatch,
+ sendInitialEvents: queryArg.sendInitialEvents,
+ timeoutSeconds: queryArg.timeoutSeconds,
+ },
+ }),
+ invalidatesTags: ['CheckType'],
+ }),
+ getCheckType: build.query({
+ query: (queryArg) => ({
+ url: `/checktypes/${queryArg.name}`,
+ params: {
+ pretty: queryArg.pretty,
+ },
+ }),
+ providesTags: ['CheckType'],
+ }),
+ replaceCheckType: build.mutation({
+ query: (queryArg) => ({
+ url: `/checktypes/${queryArg.name}`,
+ method: 'PUT',
+ body: queryArg.checkType,
+ params: {
+ pretty: queryArg.pretty,
+ dryRun: queryArg.dryRun,
+ fieldManager: queryArg.fieldManager,
+ fieldValidation: queryArg.fieldValidation,
+ },
+ }),
+ invalidatesTags: ['CheckType'],
+ }),
+ deleteCheckType: build.mutation({
+ query: (queryArg) => ({
+ url: `/checktypes/${queryArg.name}`,
+ method: 'DELETE',
+ params: {
+ pretty: queryArg.pretty,
+ dryRun: queryArg.dryRun,
+ gracePeriodSeconds: queryArg.gracePeriodSeconds,
+ ignoreStoreReadErrorWithClusterBreakingPotential: queryArg.ignoreStoreReadErrorWithClusterBreakingPotential,
+ orphanDependents: queryArg.orphanDependents,
+ propagationPolicy: queryArg.propagationPolicy,
+ },
+ }),
+ invalidatesTags: ['CheckType'],
+ }),
updateCheckType: build.mutation({
query: (queryArg) => ({
url: `/checktypes/${queryArg.name}`,
@@ -116,6 +232,8 @@ const injectedRtkApi = api
overrideExisting: false,
});
export { injectedRtkApi as generatedAPI };
+export type GetApiResourcesApiResponse = /** status 200 OK */ ApiResourceList;
+export type GetApiResourcesApiArg = void;
export type ListCheckApiResponse = /** status 200 OK */ CheckList;
export type ListCheckApiArg = {
/** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
@@ -176,6 +294,57 @@ export type CreateCheckApiArg = {
fieldValidation?: string;
check: Check;
};
+export type DeletecollectionCheckApiResponse = /** status 200 OK */ Status;
+export type DeletecollectionCheckApiArg = {
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key".
+
+ This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. */
+ continue?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** A selector to restrict the list of returned objects by their fields. Defaults to everything. */
+ fieldSelector?: string;
+ /** The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. */
+ gracePeriodSeconds?: number;
+ /** if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it */
+ ignoreStoreReadErrorWithClusterBreakingPotential?: boolean;
+ /** A selector to restrict the list of returned objects by their labels. Defaults to everything. */
+ labelSelector?: string;
+ /** limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.
+
+ The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. */
+ limit?: number;
+ /** Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. */
+ orphanDependents?: boolean;
+ /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */
+ propagationPolicy?: string;
+ /** resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
+
+ Defaults to unset */
+ resourceVersion?: string;
+ /** resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
+
+ Defaults to unset */
+ resourceVersionMatch?: string;
+ /** `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic "Bookmark" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.
+
+ When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan
+ is interpreted as "data at least as new as the provided `resourceVersion`"
+ and the bookmark event is send when the state is synced
+ to a `resourceVersion` at least as fresh as the one provided by the ListOptions.
+ If `resourceVersion` is unset, this is interpreted as "consistent read" and the
+ bookmark event is send when the state is synced at least to the moment
+ when request started being processed.
+ - `resourceVersionMatch` set to any other value or unset
+ Invalid error is returned.
+
+ Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward compatibility reasons) and to false otherwise. */
+ sendInitialEvents?: boolean;
+ /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */
+ timeoutSeconds?: number;
+};
export type GetCheckApiResponse = /** status 200 OK */ Check;
export type GetCheckApiArg = {
/** name of the Check */
@@ -183,6 +352,20 @@ export type GetCheckApiArg = {
/** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
pretty?: string;
};
+export type ReplaceCheckApiResponse = /** status 200 OK */ Check | /** status 201 Created */ Check;
+export type ReplaceCheckApiArg = {
+ /** name of the Check */
+ name: string;
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */
+ fieldManager?: string;
+ /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */
+ fieldValidation?: string;
+ check: Check;
+};
export type DeleteCheckApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status;
export type DeleteCheckApiArg = {
/** name of the Check */
@@ -261,6 +444,110 @@ export type ListCheckTypeApiArg = {
/** Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */
watch?: boolean;
};
+export type CreateCheckTypeApiResponse = /** status 200 OK */
+ | CheckType
+ | /** status 201 Created */ CheckType
+ | /** status 202 Accepted */ CheckType;
+export type CreateCheckTypeApiArg = {
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */
+ fieldManager?: string;
+ /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */
+ fieldValidation?: string;
+ checkType: CheckType;
+};
+export type DeletecollectionCheckTypeApiResponse = /** status 200 OK */ Status;
+export type DeletecollectionCheckTypeApiArg = {
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key".
+
+ This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. */
+ continue?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** A selector to restrict the list of returned objects by their fields. Defaults to everything. */
+ fieldSelector?: string;
+ /** The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. */
+ gracePeriodSeconds?: number;
+ /** if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it */
+ ignoreStoreReadErrorWithClusterBreakingPotential?: boolean;
+ /** A selector to restrict the list of returned objects by their labels. Defaults to everything. */
+ labelSelector?: string;
+ /** limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.
+
+ The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. */
+ limit?: number;
+ /** Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. */
+ orphanDependents?: boolean;
+ /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */
+ propagationPolicy?: string;
+ /** resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
+
+ Defaults to unset */
+ resourceVersion?: string;
+ /** resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
+
+ Defaults to unset */
+ resourceVersionMatch?: string;
+ /** `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic "Bookmark" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.
+
+ When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan
+ is interpreted as "data at least as new as the provided `resourceVersion`"
+ and the bookmark event is send when the state is synced
+ to a `resourceVersion` at least as fresh as the one provided by the ListOptions.
+ If `resourceVersion` is unset, this is interpreted as "consistent read" and the
+ bookmark event is send when the state is synced at least to the moment
+ when request started being processed.
+ - `resourceVersionMatch` set to any other value or unset
+ Invalid error is returned.
+
+ Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward compatibility reasons) and to false otherwise. */
+ sendInitialEvents?: boolean;
+ /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */
+ timeoutSeconds?: number;
+};
+export type GetCheckTypeApiResponse = /** status 200 OK */ CheckType;
+export type GetCheckTypeApiArg = {
+ /** name of the CheckType */
+ name: string;
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+};
+export type ReplaceCheckTypeApiResponse = /** status 200 OK */ CheckType | /** status 201 Created */ CheckType;
+export type ReplaceCheckTypeApiArg = {
+ /** name of the CheckType */
+ name: string;
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */
+ fieldManager?: string;
+ /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */
+ fieldValidation?: string;
+ checkType: CheckType;
+};
+export type DeleteCheckTypeApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status;
+export type DeleteCheckTypeApiArg = {
+ /** name of the CheckType */
+ name: string;
+ /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */
+ pretty?: string;
+ /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */
+ dryRun?: string;
+ /** The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. */
+ gracePeriodSeconds?: number;
+ /** if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it */
+ ignoreStoreReadErrorWithClusterBreakingPotential?: boolean;
+ /** Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. */
+ orphanDependents?: boolean;
+ /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */
+ propagationPolicy?: string;
+};
export type UpdateCheckTypeApiResponse = /** status 200 OK */ CheckType | /** status 201 Created */ CheckType;
export type UpdateCheckTypeApiArg = {
/** name of the CheckType */
@@ -277,6 +564,38 @@ export type UpdateCheckTypeApiArg = {
force?: boolean;
patch: Patch;
};
+export type ApiResource = {
+ /** categories is a list of the grouped resources this resource belongs to (e.g. 'all') */
+ categories?: string[];
+ /** group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale". */
+ group?: string;
+ /** kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') */
+ kind: string;
+ /** name is the plural name of the resource. */
+ name: string;
+ /** namespaced indicates if a resource is namespaced or not. */
+ namespaced: boolean;
+ /** shortNames is a list of suggested short names of the resource. */
+ shortNames?: string[];
+ /** singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. */
+ singularName: string;
+ /** The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates. */
+ storageVersionHash?: string;
+ /** verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) */
+ verbs: string[];
+ /** version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)". */
+ version?: string;
+};
+export type ApiResourceList = {
+ /** 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 */
+ apiVersion?: string;
+ /** groupVersion is the group and version this APIResourceList is for. */
+ groupVersion: string;
+ /** 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 */
+ kind?: string;
+ /** resources contains the name of the resources and if they are namespaced. */
+ resources: ApiResource[];
+};
export type Time = string;
export type FieldsV1 = object;
export type ManagedFieldsEntry = {
@@ -390,6 +709,8 @@ export type CheckReportFailure = {
itemID: string;
/** Links to actions that can be taken to resolve the failure */
links: CheckErrorLink[];
+ /** More information about the failure */
+ moreInfo?: string;
/** Severity of the failure */
severity: string;
/** Step ID that the failure is associated with */