Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropping Deprecated functionality #255

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 0 additions & 154 deletions cli/backup/alertnotifications.go

This file was deleted.

1 change: 0 additions & 1 deletion cli/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ limited to clear/delete, list, download and upload. Any other functionality wil
},
CommandsList: []simplecobra.Commander{
newDashboardCommand(),
newAlertNotificationsCommand(),
newConnectionsCommand(),
newFolderCommand(),
newLibraryElementsCommand(),
Expand Down
2 changes: 1 addition & 1 deletion cli/backup/connection_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func newConnectionsPermissionDownloadCmd() simplecobra.Commander {
cmd.Aliases = []string{"d"}
},
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *support.RootCommand, args []string) error {
slog.Info("import Connections for context",
slog.Info("Download Connections for context",
"context", config.Config().GetGDGConfig().GetContext())
rootCmd.TableObj.AppendHeader(table.Row{"filename"})
connectionFilter, _ := cd.CobraCommand.Flags().GetString("connection")
Expand Down
13 changes: 0 additions & 13 deletions internal/config/config_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"fmt"
"github.com/grafana/grafana-openapi-client-go/models"
"github.com/tidwall/gjson"
"log"
"log/slog"
"os"
"path"
"regexp"
)
Expand All @@ -19,7 +17,6 @@ const (
AlertNotificationResource = "alertnotifications"
ConnectionPermissionResource = "connections-permissions"
ConnectionResource = "connections"
LegacyConnections = "datasources"
DashboardResource = "dashboards"
FolderPermissionResource = "folders-permissions"
FolderResource = "folders"
Expand Down Expand Up @@ -192,16 +189,6 @@ func (s *GrafanaConfig) GetMonitoredFolders() []string {

// Validate will return terminate if any deprecated configuration is found.
func (s *GrafanaConfig) Validate() {
if len(s.LegacyConnectionSettings) > 0 {
log.Fatal("Using 'datasources' is now deprecated, please use 'connections' instead")
}
//Validate Connections
//TODO: remove code after next release
legacyCheck := s.GetPath(LegacyConnections)
if _, err := os.Stat(legacyCheck); !os.IsNotExist(err) {
log.Fatalf("Your export contains a datasource directry which is deprecated. Please remove or "+
"rename directory to '%s'", ConnectionResource)
}

}

Expand Down
6 changes: 2 additions & 4 deletions internal/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ type GrafanaConfig struct {
MonitoredFoldersOverride []MonitoredOrgFolders `mapstructure:"watched_folders_override" yaml:"watched_folders_override"`
MonitoredFolders []string `mapstructure:"watched" yaml:"watched"`
ConnectionSettings *ConnectionSettings `mapstructure:"connections" yaml:"connections"`
//Datasources are deprecated, please use Connections
LegacyConnectionSettings map[string]interface{} `mapstructure:"datasources" yaml:"datasources"`
FilterOverrides *FilterOverrides `mapstructure:"filter_override" yaml:"filter_override"`
OutputPath string `mapstructure:"output_path" yaml:"output_path"`
FilterOverrides *FilterOverrides `mapstructure:"filter_override" yaml:"filter_override"`
OutputPath string `mapstructure:"output_path" yaml:"output_path"`
}

type MonitoredOrgFolders struct {
Expand Down
121 changes: 0 additions & 121 deletions internal/service/alertnotifications.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/service/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type GrafanaService interface {
OrganizationsApi
DashboardsApi
ConnectionsApi
AlertNotificationsApi
UsersApi
FoldersApi
LibraryElementsApi
Expand Down