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

Remove references to plugin V1 protocol #233

Merged
merged 3 commits into from
May 25, 2021
Merged
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
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"updated": "2021-05-19"
},
"dependencies": {
"grafanaVersion": "5.x.x 6.x.x 7.x.x 8.x.x"
"grafanaDependency": ">=7.0.0"
}
}
25 changes: 0 additions & 25 deletions proto/renderer.proto

This file was deleted.

29 changes: 1 addition & 28 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as path from 'path';
import * as puppeteer from 'puppeteer';
import * as _ from 'lodash';
import { RenderGRPCPluginV1 } from './plugin/v1/grpc_plugin';
import { RenderGRPCPluginV2 } from './plugin/v2/grpc_plugin';
import { HttpServer } from './service/http-server';
import { ConsoleLogger, PluginLogger } from './logger';
Expand Down Expand Up @@ -36,9 +35,6 @@ async function main() {
magicCookieValue: 'datasource',
},
versionedPlugins: {
1: {
'grafana-image-renderer': new RenderGRPCPluginV1(config, logger),
},
2: {
renderer: new RenderGRPCPluginV2(config, logger),
},
Expand Down Expand Up @@ -78,30 +74,7 @@ main().catch(err => {
});

function populatePluginConfigFromEnv(config: PluginConfig, env: NodeJS.ProcessEnv) {
// Plugin v1 legacy env variables
if (env['GF_RENDERER_PLUGIN_TZ']) {
config.rendering.timezone = env['GF_RENDERER_PLUGIN_TZ'];
} else {
config.rendering.timezone = env['TZ'];
}

if (env['GF_RENDERER_PLUGIN_GRPC_PORT']) {
config.plugin.grpc.port = parseInt(env['GF_RENDERER_PLUGIN_GRPC_PORT'] as string, 10);
}

if (env['GF_RENDERER_PLUGIN_IGNORE_HTTPS_ERRORS']) {
config.rendering.ignoresHttpsErrors = env['GF_RENDERER_PLUGIN_IGNORE_HTTPS_ERRORS'] === 'true';
}

if (env['GF_RENDERER_PLUGIN_CHROME_BIN']) {
config.rendering.chromeBin = env['GF_RENDERER_PLUGIN_CHROME_BIN'];
}

if (env['GF_RENDERER_PLUGIN_VERBOSE_LOGGING']) {
config.rendering.verboseLogging = env['GF_RENDERER_PLUGIN_VERBOSE_LOGGING'] === 'true';
}

// Plugin v2 env variables needs to be initiated early
// Plugin env variables that needs to be initiated early
if (env['GF_PLUGIN_GRPC_HOST']) {
config.plugin.grpc.host = env['GF_PLUGIN_GRPC_HOST'] as string;
}
Expand Down
54 changes: 0 additions & 54 deletions src/plugin/v1/grpc_plugin.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/plugin/v2/grpc_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ const populateConfigFromEnv = (config: PluginConfig) => {

if (env['GF_PLUGIN_RENDERING_TIMEZONE']) {
config.rendering.timezone = env['GF_PLUGIN_RENDERING_TIMEZONE'];
} else {
config.rendering.timezone = env['TZ'];
}

if (env['GF_PLUGIN_RENDERING_LANGUAGE']) {
Expand Down