Upgrade Go Plugins On Tyk Cloud

Last updated: 2 minutes read.

This guide explains how to deploy your custom Go plugins on Tyk Cloud:

  1. Navigate into the plugins directory that contains your Go module
  2. Compile your custom Go plugins.
  3. Use the table below to follow the deployment process for the version of Tyk you are upgrading to:
Path Current Version Target Version
Path 1 < 4.1.0 < 4.1.0
Path 2 >= 4.1.0 >= 4.2.0

Path 1 - Current Version < 4.1.0 and Target Version < 4.1.0

  1. Create a plugin bundle that includes the newly compiled version

    Bundle ZIP example

    Your manifest.json will look something like this:

    {
      "file_list": [
          "CustomGoPlugin.so"
      ],
      "custom_middleware": {
        "pre": [
        {
          "name": "AddHeader",
          "path": "CustomGoPlugin.so",
          "require_session": false,
          "raw_body_only": false
        }],
        "driver": "goplugin",
        "id_extractor": {
        "extract_from": "",
        "extract_with": "", 
        "extractor_config": {}}
      },
      "checksum": "",
      "signature": ""
    }
    
  2. Upload this bundle to your configured S3 bucket if using Cloud SaaS. If you’re using Hybrid SaaS, upload this bundle to your bundle server.

Path 2 - Current Version >= 4.1.0 and Target Version >= 4.2.0

  1. Create a plugin bundle that includes both your current version’s plugin along with the newly compiled version

    Bundle ZIP example

    Your manifest.json will look something like this:

    {
      "file_list": [
          "CustomGoPlugin.so",
          "CustomGoPlugin_v4.3.3_linux_amd64.so"
      ],
      "custom_middleware": {
        "pre": [
        {
          "name": "AddHeader",
          "path": "CustomGoPlugin.so",
          "require_session": false,
          "raw_body_only": false
        }],
        "driver": "goplugin",
        "id_extractor": {
          "extract_from": "",
          "extract_with": "", 
          "extractor_config": {}
        }
      },
      "checksum": "",
      "signature": ""
    }
    

    In this example -

    • the CustomGoPlugin.so in the file list would be the filename of the plugin you’re using with your current version. You will already have this file available as this is what has been running in your environment.
    • The CustomGoPlugin_v4.3.3_linux_amd64.so file represents the plugin compiled for the target version.
    • “_v4.3.3_linux_amd64” postfix is generated automatically by the compiler. If your target version was 5.2.0, then “_v5.2.0_linux_amd64” would be appended to the shared object filename that the compiler creates
    • Your bundle zip file should include both the current version and target versions of the plugin.
  2. Upload this bundle to your configured S3 bucket if using Cloud SaaS. If you’re using Hybrid SaaS, upload this bundle to your bundle server.