| •1 |
package current |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/containernetworking/cni/pkg/types" |
| 5 |
types020 "github.com/containernetworking/cni/pkg/types/020" |
| 6 |
types040 "github.com/containernetworking/cni/pkg/types/040" |
| 7 |
) |
| 8 |
|
| 9 |
const ImplementedSpecVersion = types040.ImplementedSpecVersion |
| 10 |
|
| 11 |
var ( |
| 12 |
NewResult = types040.NewResult |
| 13 |
GetResult = types040.GetResult |
| 14 |
Int = types040.Int |
| 15 |
) |
| 16 |
|
| 17 |
type ( |
| 18 |
Result = types040.Result |
| 19 |
Interface = types040.Interface |
| 20 |
IPConfig = types040.IPConfig |
| 21 |
) |
| 22 |
|
| 23 |
func NewResultFromResult(result types.Result) (*Result, error) { |
| 24 |
if result.Version() == "" { |
| 25 |
switch r := result.(type) { |
| 26 |
case *types020.Result: |
| 27 |
r.CNIVersion = "0.1.0" |
| 28 |
} |
| 29 |
} |
| 30 |
return types040.NewResultFromResult(result) |
| 31 |
} |