Remove everything except for plugins in preparation for import to plugins repo
This commit is contained in:
@ -1,71 +0,0 @@
|
||||
// Copyright 2016 CNI authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// debug supports tests that use the noop plugin
|
||||
package debug
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
)
|
||||
|
||||
const EmptyReportResultMessage = "set debug.ReportResult and call debug.WriteDebug() before calling this plugin"
|
||||
|
||||
// Debug is used to control and record the behavior of the noop plugin
|
||||
type Debug struct {
|
||||
// Report* fields allow the test to control the behavior of the no-op plugin
|
||||
ReportResult string
|
||||
ReportError string
|
||||
ReportStderr string
|
||||
ReportVersionSupport []string
|
||||
|
||||
// Command stores the CNI command that the plugin received
|
||||
Command string
|
||||
|
||||
// CmdArgs stores the CNI Args and Env Vars that the plugin recieved
|
||||
CmdArgs skel.CmdArgs
|
||||
}
|
||||
|
||||
// ReadDebug will return a debug file recorded by the noop plugin
|
||||
func ReadDebug(debugFilePath string) (*Debug, error) {
|
||||
debugBytes, err := ioutil.ReadFile(debugFilePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var debug Debug
|
||||
err = json.Unmarshal(debugBytes, &debug)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &debug, nil
|
||||
}
|
||||
|
||||
// WriteDebug will create a debug file to control the noop plugin
|
||||
func (debug *Debug) WriteDebug(debugFilePath string) error {
|
||||
debugBytes, err := json.Marshal(debug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(debugFilePath, debugBytes, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -1,206 +0,0 @@
|
||||
// Copyright 2016 CNI authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*
|
||||
Noop plugin is a CNI plugin designed for use as a test-double.
|
||||
|
||||
When calling, set the CNI_ARGS env var equal to the path of a file containing
|
||||
the JSON encoding of a Debug.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
"github.com/containernetworking/cni/pkg/types"
|
||||
"github.com/containernetworking/cni/pkg/types/current"
|
||||
"github.com/containernetworking/cni/pkg/version"
|
||||
noop_debug "github.com/containernetworking/cni/plugins/test/noop/debug"
|
||||
)
|
||||
|
||||
type NetConf struct {
|
||||
types.NetConf
|
||||
DebugFile string `json:"debugFile"`
|
||||
PrevResult *current.Result `json:"prevResult,omitempty"`
|
||||
}
|
||||
|
||||
func loadConf(bytes []byte) (*NetConf, error) {
|
||||
n := &NetConf{}
|
||||
if err := json.Unmarshal(bytes, n); err != nil {
|
||||
return nil, fmt.Errorf("failed to load netconf: %v %q", err, string(bytes))
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
|
||||
// parse extra args i.e. FOO=BAR;ABC=123
|
||||
func parseExtraArgs(args string) (map[string]string, error) {
|
||||
m := make(map[string]string)
|
||||
if len(args) == 0 {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
items := strings.Split(args, ";")
|
||||
for _, item := range items {
|
||||
kv := strings.Split(item, "=")
|
||||
if len(kv) != 2 {
|
||||
return nil, fmt.Errorf("CNI_ARGS invalid key/value pair: %s\n", kv)
|
||||
}
|
||||
m[kv[0]] = kv[1]
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func getConfig(stdinData []byte, args string) (string, *NetConf, error) {
|
||||
netConf, err := loadConf(stdinData)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
extraArgs, err := parseExtraArgs(args)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
debugFilePath, ok := extraArgs["DEBUG"]
|
||||
if !ok {
|
||||
debugFilePath = netConf.DebugFile
|
||||
}
|
||||
|
||||
return debugFilePath, netConf, nil
|
||||
}
|
||||
|
||||
func debugBehavior(args *skel.CmdArgs, command string) error {
|
||||
debugFilePath, netConf, err := getConfig(args.StdinData, args.Args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if debugFilePath == "" {
|
||||
fmt.Printf(`{}`)
|
||||
os.Stderr.WriteString("CNI_ARGS or config empty, no debug behavior\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
debug, err := noop_debug.ReadDebug(debugFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
debug.CmdArgs = *args
|
||||
debug.Command = command
|
||||
|
||||
if debug.ReportResult == "" {
|
||||
debug.ReportResult = fmt.Sprintf(` { "result": %q }`, noop_debug.EmptyReportResultMessage)
|
||||
}
|
||||
|
||||
err = debug.WriteDebug(debugFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
os.Stderr.WriteString(debug.ReportStderr)
|
||||
|
||||
if debug.ReportError != "" {
|
||||
return errors.New(debug.ReportError)
|
||||
} else if debug.ReportResult == "PASSTHROUGH" || debug.ReportResult == "INJECT-DNS" {
|
||||
if debug.ReportResult == "INJECT-DNS" {
|
||||
newResult, err := current.NewResultFromResult(netConf.PrevResult)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newResult.DNS.Nameservers = []string{"1.2.3.4"}
|
||||
netConf.PrevResult = newResult
|
||||
}
|
||||
newResult, err := json.Marshal(netConf.PrevResult)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal new result: %v", err)
|
||||
}
|
||||
os.Stdout.WriteString(string(newResult))
|
||||
} else {
|
||||
os.Stdout.WriteString(debug.ReportResult)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func debugGetSupportedVersions(stdinData []byte) []string {
|
||||
vers := []string{"0.-42.0", "0.1.0", "0.2.0", "0.3.0", "0.3.1"}
|
||||
cniArgs := os.Getenv("CNI_ARGS")
|
||||
if cniArgs == "" {
|
||||
return vers
|
||||
}
|
||||
|
||||
debugFilePath, _, err := getConfig(stdinData, cniArgs)
|
||||
if err != nil {
|
||||
panic("test setup error: unable to get debug file path: " + err.Error())
|
||||
}
|
||||
|
||||
debug, err := noop_debug.ReadDebug(debugFilePath)
|
||||
if err != nil {
|
||||
panic("test setup error: unable to read debug file: " + err.Error())
|
||||
}
|
||||
if debug.ReportVersionSupport == nil {
|
||||
return vers
|
||||
}
|
||||
return debug.ReportVersionSupport
|
||||
}
|
||||
|
||||
func cmdAdd(args *skel.CmdArgs) error {
|
||||
return debugBehavior(args, "ADD")
|
||||
}
|
||||
|
||||
func cmdDel(args *skel.CmdArgs) error {
|
||||
return debugBehavior(args, "DEL")
|
||||
}
|
||||
|
||||
func saveStdin() ([]byte, error) {
|
||||
// Read original stdin
|
||||
stdinData, err := ioutil.ReadAll(os.Stdin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Make a new pipe for stdin, and write original stdin data to it
|
||||
r, w, err := os.Pipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := w.Write(stdinData); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := w.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
os.Stdin = r
|
||||
return stdinData, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Grab and read stdin before pkg/skel gets it
|
||||
stdinData, err := saveStdin()
|
||||
if err != nil {
|
||||
panic("test setup error: unable to read stdin: " + err.Error())
|
||||
}
|
||||
|
||||
supportedVersions := debugGetSupportedVersions(stdinData)
|
||||
skel.PluginMain(cmdAdd, cmdDel, version.PluginSupports(supportedVersions...))
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
// Copyright 2016 CNI authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/onsi/gomega/gexec"
|
||||
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNoop(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "No-op plugin Suite")
|
||||
}
|
||||
|
||||
const packagePath = "github.com/containernetworking/cni/plugins/test/noop"
|
||||
|
||||
var pathToPlugin string
|
||||
|
||||
var _ = SynchronizedBeforeSuite(func() []byte {
|
||||
var err error
|
||||
pathToPlugin, err = gexec.Build(packagePath)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
return []byte(pathToPlugin)
|
||||
}, func(crossNodeData []byte) {
|
||||
pathToPlugin = string(crossNodeData)
|
||||
})
|
||||
|
||||
var _ = SynchronizedAfterSuite(func() {}, func() {
|
||||
gexec.CleanupBuildArtifacts()
|
||||
})
|
@ -1,244 +0,0 @@
|
||||
// Copyright 2016 CNI authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
"github.com/containernetworking/cni/pkg/version"
|
||||
noop_debug "github.com/containernetworking/cni/plugins/test/noop/debug"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/onsi/gomega/gexec"
|
||||
)
|
||||
|
||||
var _ = Describe("No-op plugin", func() {
|
||||
var (
|
||||
cmd *exec.Cmd
|
||||
debugFileName string
|
||||
debug *noop_debug.Debug
|
||||
expectedCmdArgs skel.CmdArgs
|
||||
)
|
||||
|
||||
const reportResult = `{ "ips": [{ "version": "4", "address": "10.1.2.3/24" }], "dns": {} }`
|
||||
|
||||
BeforeEach(func() {
|
||||
debug = &noop_debug.Debug{
|
||||
ReportResult: reportResult,
|
||||
ReportVersionSupport: []string{"0.1.0", "0.2.0", "0.3.0", "0.3.1"},
|
||||
}
|
||||
|
||||
debugFile, err := ioutil.TempFile("", "cni_debug")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(debugFile.Close()).To(Succeed())
|
||||
debugFileName = debugFile.Name()
|
||||
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
|
||||
cmd = exec.Command(pathToPlugin)
|
||||
|
||||
args := fmt.Sprintf("DEBUG=%s;FOO=BAR", debugFileName)
|
||||
cmd.Env = []string{
|
||||
"CNI_COMMAND=ADD",
|
||||
"CNI_CONTAINERID=some-container-id",
|
||||
"CNI_NETNS=/some/netns/path",
|
||||
"CNI_IFNAME=some-eth0",
|
||||
"CNI_PATH=/some/bin/path",
|
||||
// Keep this last
|
||||
"CNI_ARGS=" + args,
|
||||
}
|
||||
cmd.Stdin = strings.NewReader(`{"some":"stdin-json", "cniVersion": "0.3.1"}`)
|
||||
expectedCmdArgs = skel.CmdArgs{
|
||||
ContainerID: "some-container-id",
|
||||
Netns: "/some/netns/path",
|
||||
IfName: "some-eth0",
|
||||
Args: args,
|
||||
Path: "/some/bin/path",
|
||||
StdinData: []byte(`{"some":"stdin-json", "cniVersion": "0.3.1"}`),
|
||||
}
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
os.Remove(debugFileName)
|
||||
})
|
||||
|
||||
It("responds to ADD using the ReportResult debug field", func() {
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(reportResult))
|
||||
})
|
||||
|
||||
It("panics when no debug file is given", func() {
|
||||
// Remove the DEBUG option from CNI_ARGS and regular args
|
||||
cmd.Env[len(cmd.Env)-1] = "CNI_ARGS=FOO=BAR"
|
||||
expectedCmdArgs.Args = "FOO=BAR"
|
||||
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(2))
|
||||
})
|
||||
|
||||
It("pass previous result through when ReportResult is PASSTHROUGH", func() {
|
||||
debug = &noop_debug.Debug{ReportResult: "PASSTHROUGH"}
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
|
||||
cmd.Stdin = strings.NewReader(`{
|
||||
"some":"stdin-json",
|
||||
"cniVersion": "0.3.1",
|
||||
"prevResult": {
|
||||
"ips": [{"version": "4", "address": "10.1.2.15/24"}]
|
||||
}
|
||||
}`)
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(`{"ips": [{"version": "4", "address": "10.1.2.15/24"}], "dns": {}}`))
|
||||
})
|
||||
|
||||
It("injects DNS into previous result when ReportResult is INJECT-DNS", func() {
|
||||
debug = &noop_debug.Debug{ReportResult: "INJECT-DNS"}
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
|
||||
cmd.Stdin = strings.NewReader(`{
|
||||
"some":"stdin-json",
|
||||
"cniVersion": "0.3.1",
|
||||
"prevResult": {
|
||||
"ips": [{"version": "4", "address": "10.1.2.3/24"}],
|
||||
"dns": {}
|
||||
}
|
||||
}`)
|
||||
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(`{
|
||||
"cniVersion": "0.3.1",
|
||||
"ips": [{"version": "4", "address": "10.1.2.3/24"}],
|
||||
"dns": {"nameservers": ["1.2.3.4"]}
|
||||
}`))
|
||||
})
|
||||
|
||||
It("allows passing debug file in config JSON", func() {
|
||||
// Remove the DEBUG option from CNI_ARGS and regular args
|
||||
newArgs := "FOO=BAR"
|
||||
cmd.Env[len(cmd.Env)-1] = "CNI_ARGS=" + newArgs
|
||||
newStdin := fmt.Sprintf(`{"some":"stdin-json", "cniVersion": "0.3.1", "debugFile": "%s"}`, debugFileName)
|
||||
cmd.Stdin = strings.NewReader(newStdin)
|
||||
expectedCmdArgs.Args = newArgs
|
||||
expectedCmdArgs.StdinData = []byte(newStdin)
|
||||
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(reportResult))
|
||||
|
||||
debug, err := noop_debug.ReadDebug(debugFileName)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(debug.Command).To(Equal("ADD"))
|
||||
Expect(debug.CmdArgs).To(Equal(expectedCmdArgs))
|
||||
})
|
||||
|
||||
It("records all the args provided by skel.PluginMain", func() {
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
|
||||
debug, err := noop_debug.ReadDebug(debugFileName)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(debug.Command).To(Equal("ADD"))
|
||||
Expect(debug.CmdArgs).To(Equal(expectedCmdArgs))
|
||||
})
|
||||
|
||||
Context("when the ReportResult debug field is empty", func() {
|
||||
BeforeEach(func() {
|
||||
debug.ReportResult = ""
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
})
|
||||
|
||||
It("substitutes a helpful message for the test author", func() {
|
||||
expectedResultString := fmt.Sprintf(` { "result": %q }`, noop_debug.EmptyReportResultMessage)
|
||||
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(expectedResultString))
|
||||
|
||||
debug, err := noop_debug.ReadDebug(debugFileName)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(debug.ReportResult).To(MatchJSON(expectedResultString))
|
||||
})
|
||||
})
|
||||
|
||||
Context("when the ReportError debug field is set", func() {
|
||||
BeforeEach(func() {
|
||||
debug.ReportError = "banana"
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
})
|
||||
|
||||
It("returns an error to skel.PluginMain, causing the process to exit code 1", func() {
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(1))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(`{ "code": 100, "msg": "banana" }`))
|
||||
})
|
||||
})
|
||||
|
||||
Context("when the CNI_COMMAND is DEL", func() {
|
||||
BeforeEach(func() {
|
||||
cmd.Env[0] = "CNI_COMMAND=DEL"
|
||||
debug.ReportResult = `{ "some": "delete-data" }`
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
})
|
||||
|
||||
It("still does all the debug behavior", func() {
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
Expect(session.Out.Contents()).To(MatchJSON(`{
|
||||
"some": "delete-data"
|
||||
}`))
|
||||
debug, err := noop_debug.ReadDebug(debugFileName)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(debug.Command).To(Equal("DEL"))
|
||||
Expect(debug.CmdArgs).To(Equal(expectedCmdArgs))
|
||||
})
|
||||
})
|
||||
|
||||
Context("when the CNI_COMMAND is VERSION", func() {
|
||||
BeforeEach(func() {
|
||||
cmd.Env[0] = "CNI_COMMAND=VERSION"
|
||||
debug.ReportVersionSupport = []string{"0.123.0", "0.2.0"}
|
||||
|
||||
Expect(debug.WriteDebug(debugFileName)).To(Succeed())
|
||||
})
|
||||
|
||||
It("claims to support the specified versions", func() {
|
||||
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Eventually(session).Should(gexec.Exit(0))
|
||||
decoder := &version.PluginDecoder{}
|
||||
pluginInfo, err := decoder.Decode(session.Out.Contents())
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(pluginInfo.SupportedVersions()).To(ConsistOf(
|
||||
"0.123.0", "0.2.0"))
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user