mirror of
https://github.com/rancher/plugins.git
synced 2025-09-20 15:52:55 +00:00
vendor: bump to libcni v1.0
Signed-off-by: Casey Callendrello <cdc@redhat.com>
This commit is contained in:
15
vendor/github.com/containernetworking/cni/pkg/version/conf.go
generated
vendored
15
vendor/github.com/containernetworking/cni/pkg/version/conf.go
generated
vendored
@@ -15,23 +15,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/containernetworking/cni/pkg/types/create"
|
||||
)
|
||||
|
||||
// ConfigDecoder can decode the CNI version available in network config data
|
||||
type ConfigDecoder struct{}
|
||||
|
||||
func (*ConfigDecoder) Decode(jsonBytes []byte) (string, error) {
|
||||
var conf struct {
|
||||
CNIVersion string `json:"cniVersion"`
|
||||
}
|
||||
err := json.Unmarshal(jsonBytes, &conf)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("decoding version from network config: %s", err)
|
||||
}
|
||||
if conf.CNIVersion == "" {
|
||||
return "0.1.0", nil
|
||||
}
|
||||
return conf.CNIVersion, nil
|
||||
return create.DecodeVersion(jsonBytes)
|
||||
}
|
||||
|
Reference in New Issue
Block a user