Skip to content

Commit

Permalink
Remove references to plugin V1 protocol (#233)
Browse files Browse the repository at this point in the history
* Remove references to plugin V1 protocol

* grafanaVersion -> grafanaDependency

* move timezone set up
  • Loading branch information
AgnesToulet authored May 25, 2021
1 parent 1d6e373 commit 2e721c1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 108 deletions.
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

0 comments on commit 2e721c1

Please sign in to comment.