disable annotations by default
This commit is contained in:
@@ -10,6 +10,7 @@ manifest: {
|
||||
|
||||
v0alpha1: {
|
||||
kinds: [annotationv0alpha1]
|
||||
served: false
|
||||
routes: {
|
||||
namespaced: {
|
||||
"/tags": {
|
||||
|
||||
@@ -25,6 +25,13 @@ type Annotation struct {
|
||||
Status AnnotationStatus `json:"status" yaml:"status"`
|
||||
}
|
||||
|
||||
func NewAnnotation() *Annotation {
|
||||
return &Annotation{
|
||||
Spec: *NewAnnotationSpec(),
|
||||
Status: *NewAnnotationStatus(),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) GetSpec() any {
|
||||
return o.Spec
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// schema is unexported to prevent accidental overwrites
|
||||
var (
|
||||
schemaAnnotation = resource.NewSimpleSchema("annotation.grafana.app", "v0alpha1", &Annotation{}, &AnnotationList{}, resource.WithKind("Annotation"),
|
||||
schemaAnnotation = resource.NewSimpleSchema("annotation.grafana.app", "v0alpha1", NewAnnotation(), &AnnotationList{}, resource.WithKind("Annotation"),
|
||||
resource.WithPlural("annotations"), resource.WithScope(resource.NamespacedScope))
|
||||
kindAnnotation = resource.Kind{
|
||||
Schema: schemaAnnotation,
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ var appManifestData = app.ManifestData{
|
||||
Versions: []app.ManifestVersion{
|
||||
{
|
||||
Name: "v0alpha1",
|
||||
Served: true,
|
||||
Served: false,
|
||||
Kinds: []app.ManifestVersionKind{
|
||||
{
|
||||
Kind: "Annotation",
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/selection"
|
||||
"k8s.io/apiserver/pkg/authorization/authorizer"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
@@ -115,6 +116,15 @@ func (a *AnnotationAppInstaller) GetLegacyStorage(requested schema.GroupVersionR
|
||||
return a.legacy
|
||||
}
|
||||
|
||||
// GetAuthorizer Returns a dummy authorizer
|
||||
func (a *AnnotationAppInstaller) GetAuthorizer() authorizer.Authorizer {
|
||||
return authorizer.AuthorizerFunc(
|
||||
func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {
|
||||
return authorizer.DecisionAllow, "", nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
var (
|
||||
_ rest.Scoper = (*legacyStorage)(nil)
|
||||
_ rest.SingularNameProvider = (*legacyStorage)(nil)
|
||||
|
||||
@@ -76,10 +76,6 @@ func ProvideAppInstallers(
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesLogsDrilldown) {
|
||||
installers = append(installers, logsdrilldownAppInstaller)
|
||||
}
|
||||
//nolint:staticcheck
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesAnnotations) {
|
||||
installers = append(installers, annotationAppInstaller)
|
||||
}
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagGrafanaAdvisor) {
|
||||
installers = append(installers, advisorAppInstaller)
|
||||
@@ -88,6 +84,10 @@ func ProvideAppInstallers(
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesAlertingHistorian) && alertingHistorianAppInstaller != nil {
|
||||
installers = append(installers, alertingHistorianAppInstaller)
|
||||
}
|
||||
// Applications under active development should be disabled by default
|
||||
// and explicitly enabled by specifying it in `runtime_config`
|
||||
// under the `[grafana-apiserver]` section in settings.ini (see docs apps/example/README.md).
|
||||
installers = append(installers, annotationAppInstaller)
|
||||
|
||||
return installers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user