From ec90c117d25f973f978755266c31fc15b438914c Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 16 Jun 2022 19:24:59 +0000 Subject: [PATCH 01/12] delegated azure-ipam --- azure-ipam/cnsutils.go | 94 +++++++ azure-ipam/const.go | 9 + azure-ipam/internal/buildinfo/buildinfo.go | 3 + azure-ipam/ipam.go | 162 ++++++++++++ azure-ipam/ipam_test.go | 294 +++++++++++++++++++++ azure-ipam/main.go | 62 +++++ azure-ipam/netconf.go | 22 ++ cns/NetworkContainerContract.go | 48 ++++ cns/api.go | 8 + go.mod | 5 +- go.sum | 7 + 11 files changed, 712 insertions(+), 2 deletions(-) create mode 100644 azure-ipam/cnsutils.go create mode 100644 azure-ipam/const.go create mode 100644 azure-ipam/internal/buildinfo/buildinfo.go create mode 100644 azure-ipam/ipam.go create mode 100644 azure-ipam/ipam_test.go create mode 100644 azure-ipam/main.go create mode 100644 azure-ipam/netconf.go diff --git a/azure-ipam/cnsutils.go b/azure-ipam/cnsutils.go new file mode 100644 index 0000000000..f503808946 --- /dev/null +++ b/azure-ipam/cnsutils.go @@ -0,0 +1,94 @@ +package main + +import ( + "encoding/json" + "fmt" + "net" + + "github.com/Azure/azure-container-networking/cns" + "github.com/Azure/azure-container-networking/log" + "github.com/pkg/errors" + + cniSkel "github.com/containernetworking/cni/pkg/skel" + cniTypes "github.com/containernetworking/cni/pkg/types" +) + +func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { + podConf, err := parsePodConf(args.Args) + if err != nil { + return cns.IPConfigRequest{}, errors.Wrapf(err, "Could not parse CNI args") + } + + podInfo := cns.KubernetesPodInfo{ + PodName: string(podConf.K8S_POD_NAME), + PodNamespace: string(podConf.K8S_POD_NAMESPACE), + } + + orchestratorContext, err := json.Marshal(podInfo) + if err != nil { + return cns.IPConfigRequest{}, errors.Wrapf(err, "Could not marshal podInfo to JSON") + } + + req := cns.IPConfigRequest{ + PodInterfaceID: getEndpointID(args.ContainerID, args.IfName), + InfraContainerID: args.ContainerID, + OrchestratorContext: orchestratorContext, + } + + return req, nil + +} + +func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) { + podCIDR := fmt.Sprintf( + "%s/%d", + resp.PodIpInfo.PodIPConfig.IPAddress, + resp.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, + ) + podIP, podIPNet, err := net.ParseCIDR(podCIDR) + if err != nil { + return nil, nil, errors.Wrapf(err, "CNS returned invalid pod CIDR %q", podCIDR) + } + + resultIPNet := &net.IPNet{ + IP: podIP, + Mask: podIPNet.Mask, + } + + ncGatewayIPAddress := resp.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress + gwIP := net.ParseIP(ncGatewayIPAddress) + if gwIP == nil { + return nil, nil, fmt.Errorf("CNS returned an invalid gateway address: %s", ncGatewayIPAddress) + } + + return resultIPNet, gwIP, nil +} + +type K8SPodEnvArgs struct { + cniTypes.CommonArgs + K8S_POD_NAMESPACE cniTypes.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` + K8S_POD_NAME cniTypes.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` + K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` +} + +func parsePodConf(args string) (*K8SPodEnvArgs, error) { + podCfg := K8SPodEnvArgs{} + err := cniTypes.LoadArgs(args, &podCfg) + if err != nil { + return nil, err + } + return &podCfg, nil +} + +func getEndpointID(containerID string, ifName string) string { + if len(containerID) > 8 { + containerID = containerID[:8] + } else { + log.Printf("Container ID length is not greater than 8: %v", containerID) + return "" + } + + infraEpName := containerID + "-" + ifName + + return infraEpName +} diff --git a/azure-ipam/const.go b/azure-ipam/const.go new file mode 100644 index 0000000000..f2179e2fec --- /dev/null +++ b/azure-ipam/const.go @@ -0,0 +1,9 @@ +package main + +import "time" + +const ( + PLUGIN_NAME = "azure-ipam" + CNS_BASE_URL = "" // fallback to default http://localhost:10090 + CNS_REQ_TIMEOUT = 15 * time.Second +) diff --git a/azure-ipam/internal/buildinfo/buildinfo.go b/azure-ipam/internal/buildinfo/buildinfo.go new file mode 100644 index 0000000000..77ffbb7fd2 --- /dev/null +++ b/azure-ipam/internal/buildinfo/buildinfo.go @@ -0,0 +1,3 @@ +package buildinfo + +var Version string diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go new file mode 100644 index 0000000000..1a7ba41e8a --- /dev/null +++ b/azure-ipam/ipam.go @@ -0,0 +1,162 @@ +package main + +import ( + "context" + + "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" + "github.com/Azure/azure-container-networking/cns" + "github.com/Azure/azure-container-networking/network" + cniSkel "github.com/containernetworking/cni/pkg/skel" + cniTypes "github.com/containernetworking/cni/pkg/types" + current "github.com/containernetworking/cni/pkg/types/100" + "github.com/pkg/errors" + "go.uber.org/zap" +) + +type ipamPlugin struct { + Name string + Version string + Options map[string]interface{} + logger *zap.Logger + cnsClient cnsClient +} + +type cnsClient interface { + RequestIPAddress(context.Context, cns.IPConfigRequest) (*cns.IPConfigResponse, error) + ReleaseIPAddress(context.Context, cns.IPConfigRequest) error +} + +// NewPlugin constructs a new IPAM plugin +func NewPlugin(logger *zap.Logger, c cnsClient) (*ipamPlugin, error) { + plugin := &ipamPlugin{ + Name: PLUGIN_NAME, + Version: buildinfo.Version, + logger: logger, + cnsClient: c, + } + return plugin, nil +} + +// +// CNI implementation +// https://github.com/containernetworking/cni/blob/master/SPEC.md +// + +// CmdAdd handles CNI add commands. +func (p *ipamPlugin) CmdAdd(args *cniSkel.CmdArgs) error { + p.logger.Info("ADD called") + // Create CNS request from args + req, err := createCNSRequest(args) + if err != nil { + p.logger.Error("Failed to create CNS IP config request", + zap.Error(err), + ) + return errors.Wrapf(err, "failed to create CNS IP config request") + } + p.logger.Info("Created CNS IP config request", + zap.Object("request", req), + ) + + // cnsClient sets a request timeout. + ctx := context.TODO() + p.logger.Info("Making request to CNS") + resp, err := p.cnsClient.RequestIPAddress(ctx, req) + if err != nil { + p.logger.Error("Failed to request IP address from CNS", + zap.Error(err), + zap.Object("request", req), + ) + return errors.Wrapf(err, "Failed to get IP address from CNS") + } + p.logger.Info("Received CNS IP config response", + zap.Object("response", resp), + ) + + // Get Pod IP and gateway IP from CNS response + podIPNet, gwIP, err := processCNSResponse(resp) + if err != nil { + p.logger.Error("Could not interpret CNS IPConfigResponse", + zap.Error(err), + zap.Object("response", resp), + ) + return errors.Wrapf(err, "Could not interpret CNS IPConfigResponse") + } + p.logger.Info("Parsed pod IP and gateway IP", + zap.String("podIPNet", podIPNet.String()), + zap.String("gwIP", gwIP.String()), + ) + + // Parsing network conf + nwCfg, err := ParseNetConf(args.StdinData) + if err != nil { + p.logger.Error("Could not parse CNI network config", + zap.Error(err), + zap.Any("argStdinData", args.StdinData), + ) + return errors.Wrapf(err, "Could not parse CNI network config") + } + p.logger.Info("Parsed network config", + zap.Any("nwCfg", nwCfg), + ) + + cniResult := ¤t.Result{ + IPs: []*current.IPConfig{ + { + Address: *podIPNet, + Gateway: gwIP, + }, + }, + Routes: []*cniTypes.Route{ + { + Dst: network.Ipv4DefaultRouteDstPrefix, + GW: gwIP, + }, + }, + } + + versionedCniResult, err := cniResult.GetAsVersion(nwCfg.CNIVersion) + if err != nil { + p.logger.Error("Could not interpret CNI result with netconf CNI version", + zap.Error(err), + zap.Any("cniVersion", nwCfg.CNIVersion), + ) + return errors.Wrapf(err, "Could not interpret CNI result as version %s", nwCfg.CNIVersion) + } + + versionedCniResult.Print() + + return nil +} + +// CmdDel handles CNI delete commands. +func (p *ipamPlugin) CmdDel(args *cniSkel.CmdArgs) error { + p.logger.Info("DEL called") + // Create CNS request from args + req, err := createCNSRequest(args) + if err != nil { + p.logger.Error("Failed to create CNS IP config request", + zap.Error(err), + ) + return errors.Wrapf(err, "Failed to create CNS IP config request") + } + p.logger.Info("Created CNS IP config request", + zap.Object("request", req), + ) + ctx := context.TODO() + p.logger.Info("Making request to CNS") + if err := p.cnsClient.ReleaseIPAddress(ctx, req); err != nil { + p.logger.Error("Failed to release IP address from CNS", + zap.Error(err), + zap.Object("request", req), + ) + return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "") + } + + return nil +} + +// CmdCheck handles CNI check command - not implemented +func (p *ipamPlugin) CmdCheck(args *cniSkel.CmdArgs) error { + p.logger.Info("CHECK called") + return nil +} diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go new file mode 100644 index 0000000000..61696b09e3 --- /dev/null +++ b/azure-ipam/ipam_test.go @@ -0,0 +1,294 @@ +package main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "testing" + + "github.com/Azure/azure-container-networking/cns" + cniSkel "github.com/containernetworking/cni/pkg/skel" + cniTypes "github.com/containernetworking/cni/pkg/types" + "github.com/stretchr/testify/require" + "go.uber.org/zap" +) + +type MockCNSClient struct{} + +func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error) { + switch ipconfig.InfraContainerID { + case "failRequestCNSArgs": + return nil, errors.New("err") + case "failProcessCNSResp": + result := &cns.IPConfigResponse{ + PodIpInfo: cns.PodIpInfo{ + PodIPConfig: cns.IPSubnet{ + IPAddress: "10.0.1.10.2", + PrefixLength: 24, + }, + NetworkContainerPrimaryIPConfig: cns.IPConfiguration{ + IPSubnet: cns.IPSubnet{ + IPAddress: "10.0.1.0", + PrefixLength: 24, + }, + DNSServers: nil, + GatewayIPAddress: "10.0.0.1", + }, + HostPrimaryIPInfo: cns.HostIPInfo{ + Gateway: "10.0.0.1", + PrimaryIP: "10.0.0.1", + Subnet: "10.0.0.0/24", + }, + }, + Response: cns.Response{ + ReturnCode: 0, + Message: "", + }, + } + return result, nil + default: + result := &cns.IPConfigResponse{ + PodIpInfo: cns.PodIpInfo{ + PodIPConfig: cns.IPSubnet{ + IPAddress: "10.0.1.10", + PrefixLength: 24, + }, + NetworkContainerPrimaryIPConfig: cns.IPConfiguration{ + IPSubnet: cns.IPSubnet{ + IPAddress: "10.0.1.0", + PrefixLength: 24, + }, + DNSServers: nil, + GatewayIPAddress: "10.0.0.1", + }, + HostPrimaryIPInfo: cns.HostIPInfo{ + Gateway: "10.0.0.1", + PrimaryIP: "10.0.0.1", + Subnet: "10.0.0.0/24", + }, + }, + Response: cns.Response{ + ReturnCode: 0, + Message: "", + }, + } + return result, nil + } +} + +func (c *MockCNSClient) ReleaseIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) error { + switch ipconfig.InfraContainerID { + case "failRequestCNSReleaseIPArgs": + return errors.New("err") + default: + return nil + } +} + +const ( + happyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid" + nothappyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid;break=break" +) + +type scenario struct { + name string + args *cniSkel.CmdArgs + wantErr bool +} + +func TestCmdAdd(t *testing.T) { + require := require.New(t) + + happyNetConf := &cniTypes.NetConf{ + CNIVersion: "0.1.0", + Name: "happynetconf", + } + + invalidVersionNetConf := &cniTypes.NetConf{ + CNIVersion: "0", + Name: "nothappynetconf", + } + + happyNetConfByteArr, _ := json.Marshal(happyNetConf) + invalidVersionNetConfByteArr, _ := json.Marshal(invalidVersionNetConf) + invalidNetConf := []byte("invalidNetConf") + + happyArgs := &cniSkel.CmdArgs{ + ContainerID: "happyArgs", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: happyNetConfByteArr, + } + + failCreateCNSReqArgs := &cniSkel.CmdArgs{ + ContainerID: "failCreateCNSReqArgs", + Netns: "testnetns", + IfName: "testifname", + Args: nothappyPodArgs, + StdinData: happyNetConfByteArr, + } + + failRequestCNSArgs := &cniSkel.CmdArgs{ + ContainerID: "failRequestCNSArgs", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: happyNetConfByteArr, + } + + failProcessCNSResp := &cniSkel.CmdArgs{ + ContainerID: "failProcessCNSResp", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: happyNetConfByteArr, + } + + failParseNetConf := &cniSkel.CmdArgs{ + ContainerID: "failParseNetConf", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: invalidNetConf, + } + + failGetVersionedResult := &cniSkel.CmdArgs{ + ContainerID: "failGetVersionedResult", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: invalidVersionNetConfByteArr, + } + + tests := []scenario{ + { + name: "Happy CNI add", + args: happyArgs, + wantErr: false, + }, + { + name: "Fail create CNS request during CmdAdd", + args: failCreateCNSReqArgs, + wantErr: true, + }, + { + name: "Fail request CNS ipconfig during CmdAdd", + args: failRequestCNSArgs, + wantErr: true, + }, + { + name: "Fail process CNS response during CmdAdd", + args: failProcessCNSResp, + wantErr: true, + }, + { + name: "Fail parse netconf during CmdAdd", + args: failParseNetConf, + wantErr: true, + }, + { + name: "Fail get versioned result during CmdAdd", + args: failGetVersionedResult, + wantErr: true, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + fmt.Printf("test : %v\n", tt.name) + mockCNSClient := &MockCNSClient{} + logger, err := zap.NewProduction() + defer logger.Sync() + if err != nil { + return + } + ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + err = ipamPlugin.CmdAdd(tt.args) + fmt.Println() + if tt.wantErr { + require.Error(err) + } else { + require.NoError(err) + } + }) + } +} + +func TestCmdDel(t *testing.T) { + require := require.New(t) + + happyNetConf := &cniTypes.NetConf{ + CNIVersion: "0.1.0", + Name: "happynetconf", + } + + happyNetConfByteArr, _ := json.Marshal(happyNetConf) + + happyArgs := &cniSkel.CmdArgs{ + ContainerID: "happyArgs", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: happyNetConfByteArr, + } + + failCreateCNSReqArgs := &cniSkel.CmdArgs{ + ContainerID: "failCreateCNSReqArgs", + Netns: "testnetns", + IfName: "testifname", + Args: nothappyPodArgs, + StdinData: happyNetConfByteArr, + } + + failRequestCNSReleaseIPArgs := &cniSkel.CmdArgs{ + ContainerID: "failRequestCNSReleaseIPArgs", + Netns: "testnetns", + IfName: "testifname", + Args: happyPodArgs, + StdinData: happyNetConfByteArr, + } + tests := []scenario{ + { + name: "Happy CNI del", + args: happyArgs, + wantErr: false, + }, + { + name: "Fail create CNS request during CmdDel", + args: failCreateCNSReqArgs, + wantErr: true, + }, + { + name: "Fail request CNS release IP during CmdDel", + args: failRequestCNSReleaseIPArgs, + wantErr: true, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + fmt.Printf("test : %v\n", tt.name) + mockCNSClient := &MockCNSClient{} + logger, err := zap.NewProduction() + defer logger.Sync() + if err != nil { + return + } + ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + err = ipamPlugin.CmdDel(tt.args) + fmt.Println() + if tt.wantErr { + require.Error(err) + } else { + require.NoError(err) + } + }) + } + +} + +func TestCmdCheck(t *testing.T) { + +} diff --git a/azure-ipam/main.go b/azure-ipam/main.go new file mode 100644 index 0000000000..1459f33153 --- /dev/null +++ b/azure-ipam/main.go @@ -0,0 +1,62 @@ +package main + +import ( + "encoding/json" + "log" + "os" + + cnsclient "github.com/Azure/azure-container-networking/cns/client" + "github.com/containernetworking/cni/pkg/skel" + "github.com/containernetworking/cni/pkg/version" + bv "github.com/containernetworking/plugins/pkg/utils/buildversion" + "github.com/pkg/errors" + "go.uber.org/zap" +) + +func main() { + if err := executePlugin(); err != nil { + log.Printf("[%s] Error executing CNS IPAM plugin: %s\n", PLUGIN_NAME, err) + os.Exit(1) + } +} + +func executePlugin() error { + + zapConfig := []byte(`{ + "level": "debug", + "encoding": "json", + "outputPaths": ["/tmp/logs"], + "errorOutputPaths": ["stderr"], + "encoderConfig": { + "messageKey": "msg", + "levelKey": "level", + "levelEncoder": "lowercase" + } + }`) + + var cfg zap.Config + if err := json.Unmarshal(zapConfig, &cfg); err != nil { + return errors.Wrapf(err, "failed to unmarshal zap config") + } + + logger, err := cfg.Build() + defer logger.Sync() + if err != nil { + return errors.Wrapf(err, "failed to setup IPAM logging") + } + logger.Info("logger construction succeeded") + + // Create IPAM plugin with logger and CNS client + client, err := cnsclient.New(CNS_BASE_URL, CNS_REQ_TIMEOUT) + if err != nil { + return errors.Wrapf(err, "failed to initialize CNS client") + } + plugin, err := NewPlugin(logger, client) + if err != nil { + logger.Info("Failed to create IPAM plugin") + return errors.Wrapf(err, "[%s] Failed to create IPAM plugin", PLUGIN_NAME) + } + + return skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(PLUGIN_NAME)) + +} diff --git a/azure-ipam/netconf.go b/azure-ipam/netconf.go new file mode 100644 index 0000000000..9c58877392 --- /dev/null +++ b/azure-ipam/netconf.go @@ -0,0 +1,22 @@ +package main + +import ( + "encoding/json" + + cniTypes "github.com/containernetworking/cni/pkg/types" +) + +// Parse network config from given byte array +func ParseNetConf(b []byte) (*cniTypes.NetConf, error) { + netConf := &cniTypes.NetConf{} + err := json.Unmarshal(b, netConf) + if err != nil { + return nil, err + } + + if netConf.CNIVersion == "" { + netConf.CNIVersion = "0.2.0" + } + + return netConf, nil +} diff --git a/cns/NetworkContainerContract.go b/cns/NetworkContainerContract.go index d2de05bfa4..9b5a997334 100644 --- a/cns/NetworkContainerContract.go +++ b/cns/NetworkContainerContract.go @@ -9,6 +9,7 @@ import ( "github.com/Azure/azure-container-networking/cns/types" "github.com/pkg/errors" + "go.uber.org/zap/zapcore" corev1 "k8s.io/api/core/v1" ) @@ -299,6 +300,14 @@ type IPConfiguration struct { GatewayIPAddress string } +// For zap logging +func (i IPConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddObject("ipSubnet", i.IPSubnet) + enc.AddReflected("dnsServer", i.DNSServers) + enc.AddString("gatewayIPAddress", i.GatewayIPAddress) + return nil +} + // SecondaryIPConfig contains IP info of SecondaryIP type SecondaryIPConfig struct { IPAddress string @@ -312,6 +321,13 @@ type IPSubnet struct { PrefixLength uint8 } +// For zap logging +func (i IPSubnet) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("ipAddress", i.IPAddress) + enc.AddUint8("prefixLength", i.PrefixLength) + return nil +} + // GetIPNet converts the IPSubnet to the standard net type func (ips *IPSubnet) GetIPNet() (net.IP, *net.IPNet, error) { prefix := strconv.Itoa(int(ips.PrefixLength)) @@ -377,6 +393,14 @@ type PodIpInfo struct { HostPrimaryIPInfo HostIPInfo } +// For zap logging +func (p PodIpInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddObject("podIPConfig", p.PodIPConfig) + enc.AddObject("networkContainerPrimaryIPConfig", p.NetworkContainerPrimaryIPConfig) + enc.AddObject("hostPrimaryIPInfo", p.HostPrimaryIPInfo) + return nil +} + // DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container. type HostIPInfo struct { Gateway string @@ -384,6 +408,14 @@ type HostIPInfo struct { Subnet string } +// For zap logging +func (h HostIPInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("gateway", h.Gateway) + enc.AddString("primaryIP", h.PrimaryIP) + enc.AddString("subnet", h.Subnet) + return nil +} + type IPConfigRequest struct { DesiredIPAddress string PodInterfaceID string @@ -396,12 +428,28 @@ func (i IPConfigRequest) String() string { i.DesiredIPAddress, i.PodInterfaceID, i.InfraContainerID, string(i.OrchestratorContext)) } +// For zap logging +func (i IPConfigRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("desiredIPAddress", i.DesiredIPAddress) + enc.AddString("podInterfaceID", i.PodInterfaceID) + enc.AddString("infraContainerID", i.InfraContainerID) + enc.AddByteString("orchestratorContext", i.OrchestratorContext) + return nil +} + // IPConfigResponse is used in CNS IPAM mode as a response to CNI ADD type IPConfigResponse struct { PodIpInfo PodIpInfo Response Response } +// For zap logging +func (i IPConfigResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddObject("podIpInfo", i.PodIpInfo) + enc.AddObject("response", i.Response) + return nil +} + // GetIPAddressesRequest is used in CNS IPAM mode to get the states of IPConfigs // The IPConfigStateFilter is a slice of IPs to fetch from CNS that match those states type GetIPAddressesRequest struct { diff --git a/cns/api.go b/cns/api.go index 1e2b8349db..4c068a2f61 100644 --- a/cns/api.go +++ b/cns/api.go @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-container-networking/cns/types" "github.com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha" "github.com/pkg/errors" + "go.uber.org/zap/zapcore" ) // Container Network Service remote API Contract @@ -289,6 +290,13 @@ type Response struct { Message string } +// For zap logging +func (r Response) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("returnCode", r.ReturnCode.String()) + enc.AddString("message", r.Message) + return nil +} + // NumOfCPUCoresResponse describes num of cpu cores present on host. type NumOfCPUCoresResponse struct { Response Response diff --git a/go.mod b/go.mod index fc2ce21381..488acd09ca 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Microsoft/hcsshim v0.8.23 github.com/avast/retry-go/v3 v3.1.1 github.com/billgraziano/dpapi v0.4.0 - github.com/containernetworking/cni v0.8.1 + github.com/containernetworking/cni v1.0.1 github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 @@ -56,6 +56,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/cgroups v1.0.1 // indirect + github.com/containernetworking/plugins v1.1.1 github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/docker v20.10.8+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect @@ -105,7 +106,7 @@ require ( github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.6.0 // indirect + go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect diff --git a/go.sum b/go.sum index 6bbc3f2c4c..7bdf277d0c 100644 --- a/go.sum +++ b/go.sum @@ -230,8 +230,12 @@ github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAbtH/JNLBo= +github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= +github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE= +github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= @@ -821,6 +825,7 @@ github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5 github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 h1:+UB2BJA852UkGH42H+Oee69djmxS3ANzl2b/JtT1YiA= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= @@ -889,6 +894,8 @@ go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= From ebb6a0317296ff8ba3c6e611113ae0741cddf971 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 16 Jun 2022 19:28:44 +0000 Subject: [PATCH 02/12] gofumpted --- azure-ipam/cnsutils.go | 1 - azure-ipam/ipam_test.go | 2 -- azure-ipam/main.go | 2 -- 3 files changed, 5 deletions(-) diff --git a/azure-ipam/cnsutils.go b/azure-ipam/cnsutils.go index f503808946..e3c291bcfd 100644 --- a/azure-ipam/cnsutils.go +++ b/azure-ipam/cnsutils.go @@ -36,7 +36,6 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { } return req, nil - } func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) { diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index 61696b09e3..636425a4b4 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -286,9 +286,7 @@ func TestCmdDel(t *testing.T) { } }) } - } func TestCmdCheck(t *testing.T) { - } diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 1459f33153..753a65feee 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -21,7 +21,6 @@ func main() { } func executePlugin() error { - zapConfig := []byte(`{ "level": "debug", "encoding": "json", @@ -58,5 +57,4 @@ func executePlugin() error { } return skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(PLUGIN_NAME)) - } From f9b89badce958585a699f58c2a3aa3e2d24cedc8 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 16 Jun 2022 23:09:33 +0000 Subject: [PATCH 03/12] addressed linter --- azure-ipam/cnsutils.go | 45 ++++++++++++++++++---------- azure-ipam/const.go | 6 ++-- azure-ipam/ipam.go | 17 ++++++----- azure-ipam/ipam_test.go | 45 +++++++++++++++++----------- azure-ipam/main.go | 10 +++---- azure-ipam/netconf.go | 22 -------------- cni/network/invoker_cns.go | 14 ++++----- cni/network/invoker_cns_test.go | 4 +-- cns/NetworkContainerContract.go | 24 +++++++-------- cns/client/client_test.go | 8 ++--- cns/restserver/ipam.go | 52 ++++++++++++++++----------------- cns/restserver/util.go | 2 +- 12 files changed, 127 insertions(+), 122 deletions(-) delete mode 100644 azure-ipam/netconf.go diff --git a/azure-ipam/cnsutils.go b/azure-ipam/cnsutils.go index e3c291bcfd..c477e49367 100644 --- a/azure-ipam/cnsutils.go +++ b/azure-ipam/cnsutils.go @@ -7,16 +7,15 @@ import ( "github.com/Azure/azure-container-networking/cns" "github.com/Azure/azure-container-networking/log" - "github.com/pkg/errors" - cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" + "github.com/pkg/errors" ) func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { podConf, err := parsePodConf(args.Args) if err != nil { - return cns.IPConfigRequest{}, errors.Wrapf(err, "Could not parse CNI args") + return cns.IPConfigRequest{}, errors.Wrapf(err, "failed to parse CNI args") } podInfo := cns.KubernetesPodInfo{ @@ -26,7 +25,7 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { orchestratorContext, err := json.Marshal(podInfo) if err != nil { - return cns.IPConfigRequest{}, errors.Wrapf(err, "Could not marshal podInfo to JSON") + return cns.IPConfigRequest{}, errors.Wrapf(err, "failed to marshal podInfo to JSON") } req := cns.IPConfigRequest{ @@ -41,12 +40,12 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) { podCIDR := fmt.Sprintf( "%s/%d", - resp.PodIpInfo.PodIPConfig.IPAddress, - resp.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, + resp.PodIPInfo.PodIPConfig.IPAddress, + resp.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, ) podIP, podIPNet, err := net.ParseCIDR(podCIDR) if err != nil { - return nil, nil, errors.Wrapf(err, "CNS returned invalid pod CIDR %q", podCIDR) + return nil, nil, errors.Wrapf(err, "cns returned invalid pod CIDR %q", podCIDR) } resultIPNet := &net.IPNet{ @@ -54,10 +53,10 @@ func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) Mask: podIPNet.Mask, } - ncGatewayIPAddress := resp.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress + ncGatewayIPAddress := resp.PodIPInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress gwIP := net.ParseIP(ncGatewayIPAddress) if gwIP == nil { - return nil, nil, fmt.Errorf("CNS returned an invalid gateway address: %s", ncGatewayIPAddress) + return nil, nil, errors.Wrapf(nil, "cns returned an invalid gateway address: %s", ncGatewayIPAddress) } return resultIPNet, gwIP, nil @@ -65,22 +64,23 @@ func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) type K8SPodEnvArgs struct { cniTypes.CommonArgs - K8S_POD_NAMESPACE cniTypes.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` - K8S_POD_NAME cniTypes.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` - K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` + K8S_POD_NAMESPACE cniTypes.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` // nolint + K8S_POD_NAME cniTypes.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` // nolint + K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` // nolint } func parsePodConf(args string) (*K8SPodEnvArgs, error) { podCfg := K8SPodEnvArgs{} err := cniTypes.LoadArgs(args, &podCfg) if err != nil { - return nil, err + return nil, errors.Wrapf(err, "failed to parse pod config from stdin") } return &podCfg, nil } -func getEndpointID(containerID string, ifName string) string { - if len(containerID) > 8 { +func getEndpointID(containerID, ifName string) string { + const minContainerLength = 8 + if len(containerID) > minContainerLength { containerID = containerID[:8] } else { log.Printf("Container ID length is not greater than 8: %v", containerID) @@ -91,3 +91,18 @@ func getEndpointID(containerID string, ifName string) string { return infraEpName } + +// Parse network config from given byte array +func parseNetConf(b []byte) (*cniTypes.NetConf, error) { + netConf := &cniTypes.NetConf{} + err := json.Unmarshal(b, netConf) + if err != nil { + return nil, errors.Wrapf(err, "failed to unmarshal net conf") + } + + if netConf.CNIVersion == "" { + netConf.CNIVersion = "0.2.0" + } + + return netConf, nil +} diff --git a/azure-ipam/const.go b/azure-ipam/const.go index f2179e2fec..557c47d0d0 100644 --- a/azure-ipam/const.go +++ b/azure-ipam/const.go @@ -3,7 +3,7 @@ package main import "time" const ( - PLUGIN_NAME = "azure-ipam" - CNS_BASE_URL = "" // fallback to default http://localhost:10090 - CNS_REQ_TIMEOUT = 15 * time.Second + pluginName = "azure-ipam" + cnsBaseURL = "" // fallback to default http://localhost:10090 + csnReqTimeout = 15 * time.Second ) diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index 1a7ba41e8a..ef1542e6a1 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -13,7 +13,8 @@ import ( "go.uber.org/zap" ) -type ipamPlugin struct { +// IPAMPlugin is the struct for the delegated azure-ipam plugin +type IPAMPlugin struct { Name string Version string Options map[string]interface{} @@ -27,9 +28,9 @@ type cnsClient interface { } // NewPlugin constructs a new IPAM plugin -func NewPlugin(logger *zap.Logger, c cnsClient) (*ipamPlugin, error) { - plugin := &ipamPlugin{ - Name: PLUGIN_NAME, +func NewPlugin(logger *zap.Logger, c cnsClient) (*IPAMPlugin, error) { + plugin := &IPAMPlugin{ + Name: pluginName, Version: buildinfo.Version, logger: logger, cnsClient: c, @@ -43,7 +44,7 @@ func NewPlugin(logger *zap.Logger, c cnsClient) (*ipamPlugin, error) { // // CmdAdd handles CNI add commands. -func (p *ipamPlugin) CmdAdd(args *cniSkel.CmdArgs) error { +func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { p.logger.Info("ADD called") // Create CNS request from args req, err := createCNSRequest(args) @@ -87,7 +88,7 @@ func (p *ipamPlugin) CmdAdd(args *cniSkel.CmdArgs) error { ) // Parsing network conf - nwCfg, err := ParseNetConf(args.StdinData) + nwCfg, err := parseNetConf(args.StdinData) if err != nil { p.logger.Error("Could not parse CNI network config", zap.Error(err), @@ -129,7 +130,7 @@ func (p *ipamPlugin) CmdAdd(args *cniSkel.CmdArgs) error { } // CmdDel handles CNI delete commands. -func (p *ipamPlugin) CmdDel(args *cniSkel.CmdArgs) error { +func (p *IPAMPlugin) CmdDel(args *cniSkel.CmdArgs) error { p.logger.Info("DEL called") // Create CNS request from args req, err := createCNSRequest(args) @@ -156,7 +157,7 @@ func (p *ipamPlugin) CmdDel(args *cniSkel.CmdArgs) error { } // CmdCheck handles CNI check command - not implemented -func (p *ipamPlugin) CmdCheck(args *cniSkel.CmdArgs) error { +func (p *IPAMPlugin) CmdCheck(args *cniSkel.CmdArgs) error { p.logger.Info("CHECK called") return nil } diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index 636425a4b4..ef8a232931 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -16,13 +16,15 @@ import ( type MockCNSClient struct{} +var errFoo = errors.New("err") + func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error) { switch ipconfig.InfraContainerID { case "failRequestCNSArgs": - return nil, errors.New("err") + return nil, errFoo case "failProcessCNSResp": result := &cns.IPConfigResponse{ - PodIpInfo: cns.PodIpInfo{ + PodIPInfo: &cns.PodIPInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10.2", PrefixLength: 24, @@ -41,7 +43,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon Subnet: "10.0.0.0/24", }, }, - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: 0, Message: "", }, @@ -49,7 +51,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon return result, nil default: result := &cns.IPConfigResponse{ - PodIpInfo: cns.PodIpInfo{ + PodIPInfo: &cns.PodIPInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10", PrefixLength: 24, @@ -68,7 +70,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon Subnet: "10.0.0.0/24", }, }, - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: 0, Message: "", }, @@ -80,7 +82,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon func (c *MockCNSClient) ReleaseIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) error { switch ipconfig.InfraContainerID { case "failRequestCNSReleaseIPArgs": - return errors.New("err") + return errFoo default: return nil } @@ -98,7 +100,7 @@ type scenario struct { } func TestCmdAdd(t *testing.T) { - require := require.New(t) + req := require.New(t) happyNetConf := &cniTypes.NetConf{ CNIVersion: "0.1.0", @@ -110,8 +112,14 @@ func TestCmdAdd(t *testing.T) { Name: "nothappynetconf", } - happyNetConfByteArr, _ := json.Marshal(happyNetConf) - invalidVersionNetConfByteArr, _ := json.Marshal(invalidVersionNetConf) + happyNetConfByteArr, err := json.Marshal(happyNetConf) + if err != nil { + panic(err) + } + invalidVersionNetConfByteArr, err := json.Marshal(invalidVersionNetConf) + if err != nil { + panic(err) + } invalidNetConf := []byte("invalidNetConf") happyArgs := &cniSkel.CmdArgs{ @@ -200,7 +208,7 @@ func TestCmdAdd(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} logger, err := zap.NewProduction() - defer logger.Sync() + defer logger.Sync() // nolint if err != nil { return } @@ -208,23 +216,26 @@ func TestCmdAdd(t *testing.T) { err = ipamPlugin.CmdAdd(tt.args) fmt.Println() if tt.wantErr { - require.Error(err) + req.Error(err) } else { - require.NoError(err) + req.NoError(err) } }) } } func TestCmdDel(t *testing.T) { - require := require.New(t) + req := require.New(t) happyNetConf := &cniTypes.NetConf{ CNIVersion: "0.1.0", Name: "happynetconf", } - happyNetConfByteArr, _ := json.Marshal(happyNetConf) + happyNetConfByteArr, err := json.Marshal(happyNetConf) + if err != nil { + panic(err) + } happyArgs := &cniSkel.CmdArgs{ ContainerID: "happyArgs", @@ -272,7 +283,7 @@ func TestCmdDel(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} logger, err := zap.NewProduction() - defer logger.Sync() + defer logger.Sync() // nolint if err != nil { return } @@ -280,9 +291,9 @@ func TestCmdDel(t *testing.T) { err = ipamPlugin.CmdDel(tt.args) fmt.Println() if tt.wantErr { - require.Error(err) + req.Error(err) } else { - require.NoError(err) + req.NoError(err) } }) } diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 753a65feee..cdf14b226e 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,7 +15,7 @@ import ( func main() { if err := executePlugin(); err != nil { - log.Printf("[%s] Error executing CNS IPAM plugin: %s\n", PLUGIN_NAME, err) + log.Printf("error executing azure-ipam plugin: %v\n", err) os.Exit(1) } } @@ -39,22 +39,22 @@ func executePlugin() error { } logger, err := cfg.Build() - defer logger.Sync() + defer logger.Sync() // nolint if err != nil { return errors.Wrapf(err, "failed to setup IPAM logging") } logger.Info("logger construction succeeded") // Create IPAM plugin with logger and CNS client - client, err := cnsclient.New(CNS_BASE_URL, CNS_REQ_TIMEOUT) + client, err := cnsclient.New(cnsBaseURL, csnReqTimeout) if err != nil { return errors.Wrapf(err, "failed to initialize CNS client") } plugin, err := NewPlugin(logger, client) if err != nil { logger.Info("Failed to create IPAM plugin") - return errors.Wrapf(err, "[%s] Failed to create IPAM plugin", PLUGIN_NAME) + return errors.Wrapf(err, "failed to create IPAM plugin") } - return skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(PLUGIN_NAME)) + return skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(pluginName)) } diff --git a/azure-ipam/netconf.go b/azure-ipam/netconf.go deleted file mode 100644 index 9c58877392..0000000000 --- a/azure-ipam/netconf.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "encoding/json" - - cniTypes "github.com/containernetworking/cni/pkg/types" -) - -// Parse network config from given byte array -func ParseNetConf(b []byte) (*cniTypes.NetConf, error) { - netConf := &cniTypes.NetConf{} - err := json.Unmarshal(b, netConf) - if err != nil { - return nil, err - } - - if netConf.CNIVersion == "" { - netConf.CNIVersion = "0.2.0" - } - - return netConf, nil -} diff --git a/cni/network/invoker_cns.go b/cni/network/invoker_cns.go index 5b80f13885..046e629c4b 100644 --- a/cni/network/invoker_cns.go +++ b/cni/network/invoker_cns.go @@ -84,13 +84,13 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro } info := IPv4ResultInfo{ - podIPAddress: response.PodIpInfo.PodIPConfig.IPAddress, - ncSubnetPrefix: response.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, - ncPrimaryIP: response.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, - ncGatewayIPAddress: response.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress, - hostSubnet: response.PodIpInfo.HostPrimaryIPInfo.Subnet, - hostPrimaryIP: response.PodIpInfo.HostPrimaryIPInfo.PrimaryIP, - hostGateway: response.PodIpInfo.HostPrimaryIPInfo.Gateway, + podIPAddress: response.PodIPInfo.PodIPConfig.IPAddress, + ncSubnetPrefix: response.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, + ncPrimaryIP: response.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, + ncGatewayIPAddress: response.PodIPInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress, + hostSubnet: response.PodIPInfo.HostPrimaryIPInfo.Subnet, + hostPrimaryIP: response.PodIPInfo.HostPrimaryIPInfo.PrimaryIP, + hostGateway: response.PodIPInfo.HostPrimaryIPInfo.Gateway, } // set the NC Primary IP in options diff --git a/cni/network/invoker_cns_test.go b/cni/network/invoker_cns_test.go index c2cda2970a..6fb32b7c33 100644 --- a/cni/network/invoker_cns_test.go +++ b/cni/network/invoker_cns_test.go @@ -56,7 +56,7 @@ func TestCNSIPAMInvoker_Add(t *testing.T) { request: requestIPAddressHandler{ ipconfigArgument: getTestIPConfigRequest(), result: &cns.IPConfigResponse{ - PodIpInfo: cns.PodIpInfo{ + PodIPInfo: &cns.PodIPInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10", PrefixLength: 24, @@ -75,7 +75,7 @@ func TestCNSIPAMInvoker_Add(t *testing.T) { Subnet: "10.0.0.0/24", }, }, - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: 0, Message: "", }, diff --git a/cns/NetworkContainerContract.go b/cns/NetworkContainerContract.go index 9b5a997334..a20b6bf71d 100644 --- a/cns/NetworkContainerContract.go +++ b/cns/NetworkContainerContract.go @@ -302,8 +302,8 @@ type IPConfiguration struct { // For zap logging func (i IPConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddObject("ipSubnet", i.IPSubnet) - enc.AddReflected("dnsServer", i.DNSServers) + _ = enc.AddObject("ipSubnet", i.IPSubnet) + _ = enc.AddReflected("dnsServer", i.DNSServers) enc.AddString("gatewayIPAddress", i.GatewayIPAddress) return nil } @@ -387,17 +387,17 @@ type GetNetworkContainerResponse struct { } // DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container. -type PodIpInfo struct { +type PodIPInfo struct { PodIPConfig IPSubnet NetworkContainerPrimaryIPConfig IPConfiguration HostPrimaryIPInfo HostIPInfo } // For zap logging -func (p PodIpInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddObject("podIPConfig", p.PodIPConfig) - enc.AddObject("networkContainerPrimaryIPConfig", p.NetworkContainerPrimaryIPConfig) - enc.AddObject("hostPrimaryIPInfo", p.HostPrimaryIPInfo) +func (p *PodIPInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + _ = enc.AddObject("podIPConfig", p.PodIPConfig) + _ = enc.AddObject("networkContainerPrimaryIPConfig", p.NetworkContainerPrimaryIPConfig) + _ = enc.AddObject("hostPrimaryIPInfo", p.HostPrimaryIPInfo) return nil } @@ -439,14 +439,14 @@ func (i IPConfigRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error { // IPConfigResponse is used in CNS IPAM mode as a response to CNI ADD type IPConfigResponse struct { - PodIpInfo PodIpInfo - Response Response + PodIPInfo *PodIPInfo + Response *Response } // For zap logging -func (i IPConfigResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddObject("podIpInfo", i.PodIpInfo) - enc.AddObject("response", i.Response) +func (i *IPConfigResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error { + _ = enc.AddObject("podIpInfo", i.PodIPInfo) + _ = enc.AddObject("response", i.Response) return nil } diff --git a/cns/client/client_test.go b/cns/client/client_test.go index ab4cace1ce..2be97ab94a 100644 --- a/cns/client/client_test.go +++ b/cns/client/client_test.go @@ -123,8 +123,8 @@ func getIPNetFromResponse(resp *cns.IPConfigResponse) (net.IPNet, error) { ) // set result ipconfig from CNS Response Body - prefix := strconv.Itoa(int(resp.PodIpInfo.PodIPConfig.PrefixLength)) - ip, ipnet, err := net.ParseCIDR(resp.PodIpInfo.PodIPConfig.IPAddress + "/" + prefix) + prefix := strconv.Itoa(int(resp.PodIPInfo.PodIPConfig.PrefixLength)) + ip, ipnet, err := net.ParseCIDR(resp.PodIPInfo.PodIPConfig.IPAddress + "/" + prefix) if err != nil { return resultIPnet, err } @@ -271,7 +271,7 @@ func TestCNSClientRequestAndRelease(t *testing.T) { resp, err := cnsClient.RequestIPAddress(context.TODO(), cns.IPConfigRequest{OrchestratorContext: orchestratorContext}) assert.NoError(t, err, "get IP from CNS failed") - podIPInfo := resp.PodIpInfo + podIPInfo := resp.PodIPInfo assert.Equal(t, primaryIp, podIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, "PrimaryIP is not added as epected ipConfig") assert.EqualValues(t, podIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, subnetPrfixLength, "Primary IP Prefix length is not added as expected ipConfig") @@ -943,7 +943,7 @@ func TestRequestIPAddress(t *testing.T) { mockdo: &mockdo{ errToReturn: nil, objToReturn: &cns.IPConfigResponse{ - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: types.UnsupportedNetworkType, }, }, diff --git a/cns/restserver/ipam.go b/cns/restserver/ipam.go index e7696095ea..6c926d2673 100644 --- a/cns/restserver/ipam.go +++ b/cns/restserver/ipam.go @@ -29,7 +29,7 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r podInfo, returnCode, returnMessage := service.validateIPConfigRequest(ipconfigRequest) if returnCode != types.Success { reserveResp := &cns.IPConfigResponse{ - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: returnCode, Message: returnMessage, }, @@ -46,11 +46,11 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r podIPInfo, err := requestIPConfigHelper(service, ipconfigRequest) if err != nil { reserveResp := &cns.IPConfigResponse{ - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: types.FailedToAllocateIPConfig, Message: fmt.Sprintf("AllocateIPConfig failed: %v, IP config request is %s", err, ipconfigRequest), }, - PodIpInfo: podIPInfo, + PodIPInfo: &podIPInfo, } w.Header().Set(cnsReturnCode, reserveResp.Response.ReturnCode.String()) err = service.Listener.Encode(w, &reserveResp) @@ -66,10 +66,10 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r } }() reserveResp := &cns.IPConfigResponse{ - Response: cns.Response{ + Response: &cns.Response{ ReturnCode: types.Success, }, - PodIpInfo: podIPInfo, + PodIPInfo: &podIPInfo, } w.Header().Set(cnsReturnCode, reserveResp.Response.ReturnCode.String()) err = service.Listener.Encode(w, &reserveResp) @@ -356,9 +356,9 @@ func (service *HTTPRestService) MarkExistingIPsAsPendingRelease(pendingIPIDs []s return nil } -func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.PodIpInfo, bool, error) { +func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.PodIPInfo, bool, error) { var ( - podIpInfo cns.PodIpInfo + podIPInfo cns.PodIPInfo isExist bool ) @@ -368,19 +368,19 @@ func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.Po ipID := service.PodIPIDByPodInterfaceKey[podInfo.Key()] if ipID != "" { if ipState, isExist := service.PodIPConfigState[ipID]; isExist { - err := service.populateIPConfigInfoUntransacted(ipState, &podIpInfo) - return podIpInfo, isExist, err + err := service.populateIPConfigInfoUntransacted(ipState, &podIPInfo) + return podIPInfo, isExist, err } logger.Errorf("Failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") - return podIpInfo, isExist, fmt.Errorf("Failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") + return podIPInfo, isExist, errors.Wrapf(nil, "failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") } - return podIpInfo, isExist, nil + return podIPInfo, isExist, nil } -func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desiredIPAddress string) (cns.PodIpInfo, error) { - var podIpInfo cns.PodIpInfo +func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desiredIPAddress string) (cns.PodIPInfo, error) { + var podIPInfo cns.PodIPInfo service.Lock() defer service.Unlock() @@ -393,53 +393,53 @@ func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desir if ipConfig.PodInfo.Key() == podInfo.Key() { logger.Printf("[AssignDesiredIPConfig]: IP Config [%+v] is already assigned to this Pod [%+v]", ipConfig, podInfo) } else { - return podIpInfo, errors.Errorf("[AssignDesiredIPConfig] Desired IP is already assigned %+v, requested for pod %+v", ipConfig, podInfo) + return podIPInfo, errors.Errorf("[AssignDesiredIPConfig] Desired IP is already assigned %+v, requested for pod %+v", ipConfig, podInfo) } case types.Available, types.PendingProgramming: // This race can happen during restart, where CNS state is lost and thus we have lost the NC programmed version // As part of reconcile, we mark IPs as Assigned which are already assigned to Pods (listed from APIServer) if err := service.assignIPConfig(ipConfig, podInfo); err != nil { - return podIpInfo, err + return podIPInfo, err } default: - return podIpInfo, errors.Errorf("[AllocateDesiredIPConfig] Desired IP is not available %+v", ipConfig) + return podIPInfo, errors.Errorf("[AllocateDesiredIPConfig] Desired IP is not available %+v", ipConfig) } - err := service.populateIPConfigInfoUntransacted(ipConfig, &podIpInfo) - return podIpInfo, err + err := service.populateIPConfigInfoUntransacted(ipConfig, &podIPInfo) + return podIPInfo, err } } - return podIpInfo, fmt.Errorf("Requested IP not found in pool") + return podIPInfo, errors.Wrapf(nil, "requested IP not found in pool") } -func (service *HTTPRestService) AssignAnyAvailableIPConfig(podInfo cns.PodInfo) (cns.PodIpInfo, error) { +func (service *HTTPRestService) AssignAnyAvailableIPConfig(podInfo cns.PodInfo) (cns.PodIPInfo, error) { service.Lock() defer service.Unlock() for _, ipState := range service.PodIPConfigState { if ipState.GetState() == types.Available { if err := service.assignIPConfig(ipState, podInfo); err != nil { - return cns.PodIpInfo{}, err + return cns.PodIPInfo{}, err } - podIPInfo := cns.PodIpInfo{} + podIPInfo := cns.PodIPInfo{} if err := service.populateIPConfigInfoUntransacted(ipState, &podIPInfo); err != nil { - return cns.PodIpInfo{}, err + return cns.PodIPInfo{}, err } return podIPInfo, nil } } //nolint:goerr113 - return cns.PodIpInfo{}, fmt.Errorf("no IPs available, waiting on Azure CNS to allocate more") + return cns.PodIPInfo{}, fmt.Errorf("no IPs available, waiting on Azure CNS to allocate more") } // If IPConfig is already assigned to pod, it returns that else it returns one of the available ipconfigs. -func requestIPConfigHelper(service *HTTPRestService, req cns.IPConfigRequest) (cns.PodIpInfo, error) { +func requestIPConfigHelper(service *HTTPRestService, req cns.IPConfigRequest) (cns.PodIPInfo, error) { // check if ipconfig already assigned tothis pod and return if exists or error // if error, ipstate is nil, if exists, ipstate is not nil and error is nil podInfo, err := cns.NewPodInfoFromIPConfigRequest(req) if err != nil { - return cns.PodIpInfo{}, errors.Wrapf(err, "failed to parse IPConfigRequest %v", req) + return cns.PodIPInfo{}, errors.Wrapf(err, "failed to parse IPConfigRequest %v", req) } if podIPInfo, isExist, err := service.GetExistingIPConfig(podInfo); err != nil || isExist { diff --git a/cns/restserver/util.go b/cns/restserver/util.go index 7711272f3b..9b52c1f1ff 100644 --- a/cns/restserver/util.go +++ b/cns/restserver/util.go @@ -731,7 +731,7 @@ func (service *HTTPRestService) getPrimaryHostInterface(ctx context.Context) (*w } //nolint:gocritic // ignore hugeParam pls -func (service *HTTPRestService) populateIPConfigInfoUntransacted(ipConfigStatus cns.IPConfigurationStatus, podIPInfo *cns.PodIpInfo) error { +func (service *HTTPRestService) populateIPConfigInfoUntransacted(ipConfigStatus cns.IPConfigurationStatus, podIPInfo *cns.PodIPInfo) error { ncStatus, exists := service.state.ContainerStatus[ipConfigStatus.NCID] if !exists { return fmt.Errorf("Failed to get NC Configuration for NcId: %s", ipConfigStatus.NCID) From a6986a57e9ebe45bb020395044eaaa32fc64eeca Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 16 Jun 2022 23:20:09 +0000 Subject: [PATCH 04/12] minor formatting --- azure-ipam/ipam.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index ef1542e6a1..fbba128902 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -67,7 +67,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { zap.Error(err), zap.Object("request", req), ) - return errors.Wrapf(err, "Failed to get IP address from CNS") + return errors.Wrapf(err, "failed to get IP address from CNS") } p.logger.Info("Received CNS IP config response", zap.Object("response", resp), @@ -76,11 +76,11 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { // Get Pod IP and gateway IP from CNS response podIPNet, gwIP, err := processCNSResponse(resp) if err != nil { - p.logger.Error("Could not interpret CNS IPConfigResponse", + p.logger.Error("Failed to interpret CNS IPConfigResponse", zap.Error(err), zap.Object("response", resp), ) - return errors.Wrapf(err, "Could not interpret CNS IPConfigResponse") + return errors.Wrapf(err, "failed to interpret CNS IPConfigResponse") } p.logger.Info("Parsed pod IP and gateway IP", zap.String("podIPNet", podIPNet.String()), @@ -90,11 +90,11 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { // Parsing network conf nwCfg, err := parseNetConf(args.StdinData) if err != nil { - p.logger.Error("Could not parse CNI network config", + p.logger.Error("Failed to parse CNI network config", zap.Error(err), zap.Any("argStdinData", args.StdinData), ) - return errors.Wrapf(err, "Could not parse CNI network config") + return errors.Wrapf(err, "failed to parse CNI network config") } p.logger.Info("Parsed network config", zap.Any("nwCfg", nwCfg), @@ -117,11 +117,11 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { versionedCniResult, err := cniResult.GetAsVersion(nwCfg.CNIVersion) if err != nil { - p.logger.Error("Could not interpret CNI result with netconf CNI version", + p.logger.Error("Failed to interpret CNI result with netconf CNI version", zap.Error(err), zap.Any("cniVersion", nwCfg.CNIVersion), ) - return errors.Wrapf(err, "Could not interpret CNI result as version %s", nwCfg.CNIVersion) + return errors.Wrapf(err, "failed to interpret CNI result as version %s", nwCfg.CNIVersion) } versionedCniResult.Print() @@ -138,7 +138,7 @@ func (p *IPAMPlugin) CmdDel(args *cniSkel.CmdArgs) error { p.logger.Error("Failed to create CNS IP config request", zap.Error(err), ) - return errors.Wrapf(err, "Failed to create CNS IP config request") + return errors.Wrapf(err, "failed to create CNS IP config request") } p.logger.Info("Created CNS IP config request", zap.Object("request", req), From 75a3425ebcab5a477fcc2b662e58da6a3b55626a Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 17 Jun 2022 00:19:34 +0000 Subject: [PATCH 05/12] revert changes and make azure-ipam a separated module --- azure-ipam/cnsutils.go | 8 +- azure-ipam/go.mod | 79 +++ azure-ipam/go.sum | 857 ++++++++++++++++++++++++++++++++ azure-ipam/ipam.go | 18 +- azure-ipam/ipam_test.go | 8 +- cni/network/invoker_cns.go | 14 +- cni/network/invoker_cns_test.go | 4 +- cns/NetworkContainerContract.go | 54 +- cns/api.go | 8 - cns/client/client_test.go | 8 +- cns/restserver/ipam.go | 52 +- cns/restserver/util.go | 2 +- go.mod | 4 +- 13 files changed, 998 insertions(+), 118 deletions(-) create mode 100644 azure-ipam/go.mod create mode 100644 azure-ipam/go.sum diff --git a/azure-ipam/cnsutils.go b/azure-ipam/cnsutils.go index c477e49367..9302c12378 100644 --- a/azure-ipam/cnsutils.go +++ b/azure-ipam/cnsutils.go @@ -3,10 +3,10 @@ package main import ( "encoding/json" "fmt" + "log" "net" "github.com/Azure/azure-container-networking/cns" - "github.com/Azure/azure-container-networking/log" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" "github.com/pkg/errors" @@ -40,8 +40,8 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) { podCIDR := fmt.Sprintf( "%s/%d", - resp.PodIPInfo.PodIPConfig.IPAddress, - resp.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, + resp.PodIpInfo.PodIPConfig.IPAddress, + resp.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, ) podIP, podIPNet, err := net.ParseCIDR(podCIDR) if err != nil { @@ -53,7 +53,7 @@ func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) Mask: podIPNet.Mask, } - ncGatewayIPAddress := resp.PodIPInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress + ncGatewayIPAddress := resp.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress gwIP := net.ParseIP(ncGatewayIPAddress) if gwIP == nil { return nil, nil, errors.Wrapf(nil, "cns returned an invalid gateway address: %s", ncGatewayIPAddress) diff --git a/azure-ipam/go.mod b/azure-ipam/go.mod new file mode 100644 index 0000000000..2f8f8e4c95 --- /dev/null +++ b/azure-ipam/go.mod @@ -0,0 +1,79 @@ +module github.com/Azure/azure-container-networking/azure-ipam + +go 1.18 + +require go.uber.org/zap v1.21.0 + +require ( + code.cloudfoundry.org/clock v1.0.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Microsoft/go-winio v0.4.17 // indirect + github.com/Microsoft/hcsshim v0.8.23 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/billgraziano/dpapi v0.4.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/containerd/cgroups v1.0.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful v2.9.5+incompatible // indirect + github.com/go-logr/logr v1.2.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/swag v0.19.14 // indirect + github.com/gofrs/uuid v3.3.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/go-cmp v0.5.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.12.2 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.7.1 // indirect + go.opencensus.io v0.23.0 // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect + k8s.io/api v0.24.1 // indirect + k8s.io/apimachinery v0.24.1 // indirect + k8s.io/client-go v0.24.1 // indirect + k8s.io/klog/v2 v2.60.1 // indirect + k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect + k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect + sigs.k8s.io/controller-runtime v0.12.1 // indirect + sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) + +require ( + github.com/Azure/azure-container-networking v1.4.27 + github.com/containernetworking/cni v1.1.1 // indirect + github.com/containernetworking/plugins v1.1.1 + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect +) diff --git a/azure-ipam/go.sum b/azure-ipam/go.sum new file mode 100644 index 0000000000..c8d59db9af --- /dev/null +++ b/azure-ipam/go.sum @@ -0,0 +1,857 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= +code.cloudfoundry.org/clock v1.0.0 h1:kFXWQM4bxYvdBw2X8BbBeXwQNgfoWv1vqAk2ZZyBN2o= +code.cloudfoundry.org/clock v1.0.0/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-container-networking v1.4.27 h1:FtcHxDYMUwtk0fkNix52TSJPjLS40MAsNKZ23zDal5o= +github.com/Azure/azure-container-networking v1.4.27/go.mod h1:bdKLmteB7WXZAX2zFBjlifQ+Ewu0joxAOTfzY5uwry8= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= +github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/hcsshim v0.8.23 h1:47MSwtKGXet80aIn+7h4YI6fwPmwIghAnsx2aOUrG2M= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/billgraziano/dpapi v0.4.0 h1:t39THI1Ld1hkkLVrhkOX6u5TUxwzRddOffq4jcwh2AE= +github.com/billgraziano/dpapi v0.4.0/go.mod h1:gi1Lin0jvovT53j0EXITkY6UPb3hTfI92POaZgj9JBA= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/containerd/cgroups v1.0.1 h1:iJnMvco9XGvKUvNQkv88bE4uJXxRQH18efbKo9w5vHQ= +github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.1.1 h1:ky20T7c0MvKvbMOwS/FrlbNwjEoqJEUUYfsL4b0mc4k= +github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE= +github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/microsoft/ApplicationInsights-Go v0.4.4 h1:G4+H9WNs6ygSCe6sUyxRc2U81TI5Es90b2t/MwX5KqY= +github.com/microsoft/ApplicationInsights-Go v0.4.4/go.mod h1:fKRUseBqkw6bDiXTs3ESTiU/4YTIHsQS4W3fP2ieF4U= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828161417-c663848e9a16/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= +k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= +k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= +k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= +k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/controller-runtime v0.12.1 h1:4BJY01xe9zKQti8oRjj/NeHKRXthf1YkYJAgLONFFoI= +sigs.k8s.io/controller-runtime v0.12.1/go.mod h1:BKhxlA4l7FPK4AQcsuL4X6vZeWnKDXez/vp1Y8dxTU0= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index fbba128902..5f2a5bdecd 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -8,7 +8,7 @@ import ( "github.com/Azure/azure-container-networking/network" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" - current "github.com/containernetworking/cni/pkg/types/100" + types100 "github.com/containernetworking/cni/pkg/types/100" "github.com/pkg/errors" "go.uber.org/zap" ) @@ -55,7 +55,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { return errors.Wrapf(err, "failed to create CNS IP config request") } p.logger.Info("Created CNS IP config request", - zap.Object("request", req), + zap.Any("request", req), ) // cnsClient sets a request timeout. @@ -65,12 +65,12 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { if err != nil { p.logger.Error("Failed to request IP address from CNS", zap.Error(err), - zap.Object("request", req), + zap.Any("request", req), ) return errors.Wrapf(err, "failed to get IP address from CNS") } p.logger.Info("Received CNS IP config response", - zap.Object("response", resp), + zap.Any("response", resp), ) // Get Pod IP and gateway IP from CNS response @@ -78,7 +78,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { if err != nil { p.logger.Error("Failed to interpret CNS IPConfigResponse", zap.Error(err), - zap.Object("response", resp), + zap.Any("response", resp), ) return errors.Wrapf(err, "failed to interpret CNS IPConfigResponse") } @@ -100,8 +100,8 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { zap.Any("nwCfg", nwCfg), ) - cniResult := ¤t.Result{ - IPs: []*current.IPConfig{ + cniResult := &types100.Result{ + IPs: []*types100.IPConfig{ { Address: *podIPNet, Gateway: gwIP, @@ -141,14 +141,14 @@ func (p *IPAMPlugin) CmdDel(args *cniSkel.CmdArgs) error { return errors.Wrapf(err, "failed to create CNS IP config request") } p.logger.Info("Created CNS IP config request", - zap.Object("request", req), + zap.Any("request", req), ) ctx := context.TODO() p.logger.Info("Making request to CNS") if err := p.cnsClient.ReleaseIPAddress(ctx, req); err != nil { p.logger.Error("Failed to release IP address from CNS", zap.Error(err), - zap.Object("request", req), + zap.Any("request", req), ) return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "") } diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index ef8a232931..d61703ccea 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -24,7 +24,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon return nil, errFoo case "failProcessCNSResp": result := &cns.IPConfigResponse{ - PodIPInfo: &cns.PodIPInfo{ + PodIpInfo: cns.PodIpInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10.2", PrefixLength: 24, @@ -43,7 +43,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon Subnet: "10.0.0.0/24", }, }, - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: 0, Message: "", }, @@ -51,7 +51,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon return result, nil default: result := &cns.IPConfigResponse{ - PodIPInfo: &cns.PodIPInfo{ + PodIpInfo: cns.PodIpInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10", PrefixLength: 24, @@ -70,7 +70,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon Subnet: "10.0.0.0/24", }, }, - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: 0, Message: "", }, diff --git a/cni/network/invoker_cns.go b/cni/network/invoker_cns.go index 046e629c4b..5b80f13885 100644 --- a/cni/network/invoker_cns.go +++ b/cni/network/invoker_cns.go @@ -84,13 +84,13 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro } info := IPv4ResultInfo{ - podIPAddress: response.PodIPInfo.PodIPConfig.IPAddress, - ncSubnetPrefix: response.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, - ncPrimaryIP: response.PodIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, - ncGatewayIPAddress: response.PodIPInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress, - hostSubnet: response.PodIPInfo.HostPrimaryIPInfo.Subnet, - hostPrimaryIP: response.PodIPInfo.HostPrimaryIPInfo.PrimaryIP, - hostGateway: response.PodIPInfo.HostPrimaryIPInfo.Gateway, + podIPAddress: response.PodIpInfo.PodIPConfig.IPAddress, + ncSubnetPrefix: response.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, + ncPrimaryIP: response.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, + ncGatewayIPAddress: response.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress, + hostSubnet: response.PodIpInfo.HostPrimaryIPInfo.Subnet, + hostPrimaryIP: response.PodIpInfo.HostPrimaryIPInfo.PrimaryIP, + hostGateway: response.PodIpInfo.HostPrimaryIPInfo.Gateway, } // set the NC Primary IP in options diff --git a/cni/network/invoker_cns_test.go b/cni/network/invoker_cns_test.go index 6fb32b7c33..c2cda2970a 100644 --- a/cni/network/invoker_cns_test.go +++ b/cni/network/invoker_cns_test.go @@ -56,7 +56,7 @@ func TestCNSIPAMInvoker_Add(t *testing.T) { request: requestIPAddressHandler{ ipconfigArgument: getTestIPConfigRequest(), result: &cns.IPConfigResponse{ - PodIPInfo: &cns.PodIPInfo{ + PodIpInfo: cns.PodIpInfo{ PodIPConfig: cns.IPSubnet{ IPAddress: "10.0.1.10", PrefixLength: 24, @@ -75,7 +75,7 @@ func TestCNSIPAMInvoker_Add(t *testing.T) { Subnet: "10.0.0.0/24", }, }, - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: 0, Message: "", }, diff --git a/cns/NetworkContainerContract.go b/cns/NetworkContainerContract.go index a20b6bf71d..d2de05bfa4 100644 --- a/cns/NetworkContainerContract.go +++ b/cns/NetworkContainerContract.go @@ -9,7 +9,6 @@ import ( "github.com/Azure/azure-container-networking/cns/types" "github.com/pkg/errors" - "go.uber.org/zap/zapcore" corev1 "k8s.io/api/core/v1" ) @@ -300,14 +299,6 @@ type IPConfiguration struct { GatewayIPAddress string } -// For zap logging -func (i IPConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) error { - _ = enc.AddObject("ipSubnet", i.IPSubnet) - _ = enc.AddReflected("dnsServer", i.DNSServers) - enc.AddString("gatewayIPAddress", i.GatewayIPAddress) - return nil -} - // SecondaryIPConfig contains IP info of SecondaryIP type SecondaryIPConfig struct { IPAddress string @@ -321,13 +312,6 @@ type IPSubnet struct { PrefixLength uint8 } -// For zap logging -func (i IPSubnet) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddString("ipAddress", i.IPAddress) - enc.AddUint8("prefixLength", i.PrefixLength) - return nil -} - // GetIPNet converts the IPSubnet to the standard net type func (ips *IPSubnet) GetIPNet() (net.IP, *net.IPNet, error) { prefix := strconv.Itoa(int(ips.PrefixLength)) @@ -387,20 +371,12 @@ type GetNetworkContainerResponse struct { } // DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container. -type PodIPInfo struct { +type PodIpInfo struct { PodIPConfig IPSubnet NetworkContainerPrimaryIPConfig IPConfiguration HostPrimaryIPInfo HostIPInfo } -// For zap logging -func (p *PodIPInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { - _ = enc.AddObject("podIPConfig", p.PodIPConfig) - _ = enc.AddObject("networkContainerPrimaryIPConfig", p.NetworkContainerPrimaryIPConfig) - _ = enc.AddObject("hostPrimaryIPInfo", p.HostPrimaryIPInfo) - return nil -} - // DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container. type HostIPInfo struct { Gateway string @@ -408,14 +384,6 @@ type HostIPInfo struct { Subnet string } -// For zap logging -func (h HostIPInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddString("gateway", h.Gateway) - enc.AddString("primaryIP", h.PrimaryIP) - enc.AddString("subnet", h.Subnet) - return nil -} - type IPConfigRequest struct { DesiredIPAddress string PodInterfaceID string @@ -428,26 +396,10 @@ func (i IPConfigRequest) String() string { i.DesiredIPAddress, i.PodInterfaceID, i.InfraContainerID, string(i.OrchestratorContext)) } -// For zap logging -func (i IPConfigRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddString("desiredIPAddress", i.DesiredIPAddress) - enc.AddString("podInterfaceID", i.PodInterfaceID) - enc.AddString("infraContainerID", i.InfraContainerID) - enc.AddByteString("orchestratorContext", i.OrchestratorContext) - return nil -} - // IPConfigResponse is used in CNS IPAM mode as a response to CNI ADD type IPConfigResponse struct { - PodIPInfo *PodIPInfo - Response *Response -} - -// For zap logging -func (i *IPConfigResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error { - _ = enc.AddObject("podIpInfo", i.PodIPInfo) - _ = enc.AddObject("response", i.Response) - return nil + PodIpInfo PodIpInfo + Response Response } // GetIPAddressesRequest is used in CNS IPAM mode to get the states of IPConfigs diff --git a/cns/api.go b/cns/api.go index 4c068a2f61..1e2b8349db 100644 --- a/cns/api.go +++ b/cns/api.go @@ -13,7 +13,6 @@ import ( "github.com/Azure/azure-container-networking/cns/types" "github.com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha" "github.com/pkg/errors" - "go.uber.org/zap/zapcore" ) // Container Network Service remote API Contract @@ -290,13 +289,6 @@ type Response struct { Message string } -// For zap logging -func (r Response) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddString("returnCode", r.ReturnCode.String()) - enc.AddString("message", r.Message) - return nil -} - // NumOfCPUCoresResponse describes num of cpu cores present on host. type NumOfCPUCoresResponse struct { Response Response diff --git a/cns/client/client_test.go b/cns/client/client_test.go index 2be97ab94a..ab4cace1ce 100644 --- a/cns/client/client_test.go +++ b/cns/client/client_test.go @@ -123,8 +123,8 @@ func getIPNetFromResponse(resp *cns.IPConfigResponse) (net.IPNet, error) { ) // set result ipconfig from CNS Response Body - prefix := strconv.Itoa(int(resp.PodIPInfo.PodIPConfig.PrefixLength)) - ip, ipnet, err := net.ParseCIDR(resp.PodIPInfo.PodIPConfig.IPAddress + "/" + prefix) + prefix := strconv.Itoa(int(resp.PodIpInfo.PodIPConfig.PrefixLength)) + ip, ipnet, err := net.ParseCIDR(resp.PodIpInfo.PodIPConfig.IPAddress + "/" + prefix) if err != nil { return resultIPnet, err } @@ -271,7 +271,7 @@ func TestCNSClientRequestAndRelease(t *testing.T) { resp, err := cnsClient.RequestIPAddress(context.TODO(), cns.IPConfigRequest{OrchestratorContext: orchestratorContext}) assert.NoError(t, err, "get IP from CNS failed") - podIPInfo := resp.PodIPInfo + podIPInfo := resp.PodIpInfo assert.Equal(t, primaryIp, podIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.IPAddress, "PrimaryIP is not added as epected ipConfig") assert.EqualValues(t, podIPInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, subnetPrfixLength, "Primary IP Prefix length is not added as expected ipConfig") @@ -943,7 +943,7 @@ func TestRequestIPAddress(t *testing.T) { mockdo: &mockdo{ errToReturn: nil, objToReturn: &cns.IPConfigResponse{ - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: types.UnsupportedNetworkType, }, }, diff --git a/cns/restserver/ipam.go b/cns/restserver/ipam.go index 6c926d2673..e7696095ea 100644 --- a/cns/restserver/ipam.go +++ b/cns/restserver/ipam.go @@ -29,7 +29,7 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r podInfo, returnCode, returnMessage := service.validateIPConfigRequest(ipconfigRequest) if returnCode != types.Success { reserveResp := &cns.IPConfigResponse{ - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: returnCode, Message: returnMessage, }, @@ -46,11 +46,11 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r podIPInfo, err := requestIPConfigHelper(service, ipconfigRequest) if err != nil { reserveResp := &cns.IPConfigResponse{ - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: types.FailedToAllocateIPConfig, Message: fmt.Sprintf("AllocateIPConfig failed: %v, IP config request is %s", err, ipconfigRequest), }, - PodIPInfo: &podIPInfo, + PodIpInfo: podIPInfo, } w.Header().Set(cnsReturnCode, reserveResp.Response.ReturnCode.String()) err = service.Listener.Encode(w, &reserveResp) @@ -66,10 +66,10 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r } }() reserveResp := &cns.IPConfigResponse{ - Response: &cns.Response{ + Response: cns.Response{ ReturnCode: types.Success, }, - PodIPInfo: &podIPInfo, + PodIpInfo: podIPInfo, } w.Header().Set(cnsReturnCode, reserveResp.Response.ReturnCode.String()) err = service.Listener.Encode(w, &reserveResp) @@ -356,9 +356,9 @@ func (service *HTTPRestService) MarkExistingIPsAsPendingRelease(pendingIPIDs []s return nil } -func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.PodIPInfo, bool, error) { +func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.PodIpInfo, bool, error) { var ( - podIPInfo cns.PodIPInfo + podIpInfo cns.PodIpInfo isExist bool ) @@ -368,19 +368,19 @@ func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) (cns.Po ipID := service.PodIPIDByPodInterfaceKey[podInfo.Key()] if ipID != "" { if ipState, isExist := service.PodIPConfigState[ipID]; isExist { - err := service.populateIPConfigInfoUntransacted(ipState, &podIPInfo) - return podIPInfo, isExist, err + err := service.populateIPConfigInfoUntransacted(ipState, &podIpInfo) + return podIpInfo, isExist, err } logger.Errorf("Failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") - return podIPInfo, isExist, errors.Wrapf(nil, "failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") + return podIpInfo, isExist, fmt.Errorf("Failed to get existing ipconfig. Pod to IPID exists, but IPID to IPConfig doesn't exist, CNS State potentially corrupt") } - return podIPInfo, isExist, nil + return podIpInfo, isExist, nil } -func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desiredIPAddress string) (cns.PodIPInfo, error) { - var podIPInfo cns.PodIPInfo +func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desiredIPAddress string) (cns.PodIpInfo, error) { + var podIpInfo cns.PodIpInfo service.Lock() defer service.Unlock() @@ -393,53 +393,53 @@ func (service *HTTPRestService) AssignDesiredIPConfig(podInfo cns.PodInfo, desir if ipConfig.PodInfo.Key() == podInfo.Key() { logger.Printf("[AssignDesiredIPConfig]: IP Config [%+v] is already assigned to this Pod [%+v]", ipConfig, podInfo) } else { - return podIPInfo, errors.Errorf("[AssignDesiredIPConfig] Desired IP is already assigned %+v, requested for pod %+v", ipConfig, podInfo) + return podIpInfo, errors.Errorf("[AssignDesiredIPConfig] Desired IP is already assigned %+v, requested for pod %+v", ipConfig, podInfo) } case types.Available, types.PendingProgramming: // This race can happen during restart, where CNS state is lost and thus we have lost the NC programmed version // As part of reconcile, we mark IPs as Assigned which are already assigned to Pods (listed from APIServer) if err := service.assignIPConfig(ipConfig, podInfo); err != nil { - return podIPInfo, err + return podIpInfo, err } default: - return podIPInfo, errors.Errorf("[AllocateDesiredIPConfig] Desired IP is not available %+v", ipConfig) + return podIpInfo, errors.Errorf("[AllocateDesiredIPConfig] Desired IP is not available %+v", ipConfig) } - err := service.populateIPConfigInfoUntransacted(ipConfig, &podIPInfo) - return podIPInfo, err + err := service.populateIPConfigInfoUntransacted(ipConfig, &podIpInfo) + return podIpInfo, err } } - return podIPInfo, errors.Wrapf(nil, "requested IP not found in pool") + return podIpInfo, fmt.Errorf("Requested IP not found in pool") } -func (service *HTTPRestService) AssignAnyAvailableIPConfig(podInfo cns.PodInfo) (cns.PodIPInfo, error) { +func (service *HTTPRestService) AssignAnyAvailableIPConfig(podInfo cns.PodInfo) (cns.PodIpInfo, error) { service.Lock() defer service.Unlock() for _, ipState := range service.PodIPConfigState { if ipState.GetState() == types.Available { if err := service.assignIPConfig(ipState, podInfo); err != nil { - return cns.PodIPInfo{}, err + return cns.PodIpInfo{}, err } - podIPInfo := cns.PodIPInfo{} + podIPInfo := cns.PodIpInfo{} if err := service.populateIPConfigInfoUntransacted(ipState, &podIPInfo); err != nil { - return cns.PodIPInfo{}, err + return cns.PodIpInfo{}, err } return podIPInfo, nil } } //nolint:goerr113 - return cns.PodIPInfo{}, fmt.Errorf("no IPs available, waiting on Azure CNS to allocate more") + return cns.PodIpInfo{}, fmt.Errorf("no IPs available, waiting on Azure CNS to allocate more") } // If IPConfig is already assigned to pod, it returns that else it returns one of the available ipconfigs. -func requestIPConfigHelper(service *HTTPRestService, req cns.IPConfigRequest) (cns.PodIPInfo, error) { +func requestIPConfigHelper(service *HTTPRestService, req cns.IPConfigRequest) (cns.PodIpInfo, error) { // check if ipconfig already assigned tothis pod and return if exists or error // if error, ipstate is nil, if exists, ipstate is not nil and error is nil podInfo, err := cns.NewPodInfoFromIPConfigRequest(req) if err != nil { - return cns.PodIPInfo{}, errors.Wrapf(err, "failed to parse IPConfigRequest %v", req) + return cns.PodIpInfo{}, errors.Wrapf(err, "failed to parse IPConfigRequest %v", req) } if podIPInfo, isExist, err := service.GetExistingIPConfig(podInfo); err != nil || isExist { diff --git a/cns/restserver/util.go b/cns/restserver/util.go index 9b52c1f1ff..7711272f3b 100644 --- a/cns/restserver/util.go +++ b/cns/restserver/util.go @@ -731,7 +731,7 @@ func (service *HTTPRestService) getPrimaryHostInterface(ctx context.Context) (*w } //nolint:gocritic // ignore hugeParam pls -func (service *HTTPRestService) populateIPConfigInfoUntransacted(ipConfigStatus cns.IPConfigurationStatus, podIPInfo *cns.PodIPInfo) error { +func (service *HTTPRestService) populateIPConfigInfoUntransacted(ipConfigStatus cns.IPConfigurationStatus, podIPInfo *cns.PodIpInfo) error { ncStatus, exists := service.state.ContainerStatus[ipConfigStatus.NCID] if !exists { return fmt.Errorf("Failed to get NC Configuration for NcId: %s", ipConfigStatus.NCID) diff --git a/go.mod b/go.mod index 488acd09ca..3700bc5455 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Microsoft/hcsshim v0.8.23 github.com/avast/retry-go/v3 v3.1.1 github.com/billgraziano/dpapi v0.4.0 - github.com/containernetworking/cni v1.0.1 + github.com/containernetworking/cni v0.8.1 github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 @@ -56,7 +56,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/cgroups v1.0.1 // indirect - github.com/containernetworking/plugins v1.1.1 + github.com/containernetworking/plugins v0.9.1 github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/docker v20.10.8+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect From feb49515c055b8bb2ea78901ff44703917a60ed2 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 17 Jun 2022 03:34:52 +0000 Subject: [PATCH 06/12] revert go.mod and go.sum --- go.mod | 3 +-- go.sum | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 3700bc5455..fc2ce21381 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/cgroups v1.0.1 // indirect - github.com/containernetworking/plugins v0.9.1 github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/docker v20.10.8+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect @@ -106,7 +105,7 @@ require ( github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.8.0 // indirect + go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect diff --git a/go.sum b/go.sum index 7bdf277d0c..6bbc3f2c4c 100644 --- a/go.sum +++ b/go.sum @@ -230,12 +230,8 @@ github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAbtH/JNLBo= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE= -github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= @@ -825,7 +821,6 @@ github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5 github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 h1:+UB2BJA852UkGH42H+Oee69djmxS3ANzl2b/JtT1YiA= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= @@ -894,8 +889,6 @@ go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= From 924f842771387670ff52d296c839c409c03d671e Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 23 Jun 2022 20:12:40 +0000 Subject: [PATCH 07/12] addressed several comments --- azure-ipam/cnsutils.go | 53 ++------ azure-ipam/const.go | 12 +- azure-ipam/go.mod | 13 +- azure-ipam/go.sum | 21 +++- azure-ipam/internal/buildinfo/buildinfo.go | 4 + azure-ipam/ipam.go | 90 +++++++++---- azure-ipam/ipam_test.go | 140 +++++++-------------- azure-ipam/logger.go | 75 +++++++++++ azure-ipam/main.go | 28 +---- 9 files changed, 234 insertions(+), 202 deletions(-) create mode 100644 azure-ipam/logger.go diff --git a/azure-ipam/cnsutils.go b/azure-ipam/cnsutils.go index 9302c12378..a0ea305710 100644 --- a/azure-ipam/cnsutils.go +++ b/azure-ipam/cnsutils.go @@ -3,8 +3,7 @@ package main import ( "encoding/json" "fmt" - "log" - "net" + "net/netip" "github.com/Azure/azure-container-networking/cns" cniSkel "github.com/containernetworking/cni/pkg/skel" @@ -15,7 +14,7 @@ import ( func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { podConf, err := parsePodConf(args.Args) if err != nil { - return cns.IPConfigRequest{}, errors.Wrapf(err, "failed to parse CNI args") + return cns.IPConfigRequest{}, errors.Wrapf(err, "failed to parse pod config from CNI args") } podInfo := cns.KubernetesPodInfo{ @@ -29,7 +28,7 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { } req := cns.IPConfigRequest{ - PodInterfaceID: getEndpointID(args.ContainerID, args.IfName), + PodInterfaceID: args.ContainerID, InfraContainerID: args.ContainerID, OrchestratorContext: orchestratorContext, } @@ -37,29 +36,24 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { return req, nil } -func processCNSResponse(resp *cns.IPConfigResponse) (*net.IPNet, net.IP, error) { +func processCNSResponse(resp *cns.IPConfigResponse) (*netip.Prefix, *netip.Addr, error) { podCIDR := fmt.Sprintf( "%s/%d", resp.PodIpInfo.PodIPConfig.IPAddress, resp.PodIpInfo.NetworkContainerPrimaryIPConfig.IPSubnet.PrefixLength, ) - podIP, podIPNet, err := net.ParseCIDR(podCIDR) + podIPNet, err := netip.ParsePrefix(podCIDR) if err != nil { return nil, nil, errors.Wrapf(err, "cns returned invalid pod CIDR %q", podCIDR) } - resultIPNet := &net.IPNet{ - IP: podIP, - Mask: podIPNet.Mask, - } - ncGatewayIPAddress := resp.PodIpInfo.NetworkContainerPrimaryIPConfig.GatewayIPAddress - gwIP := net.ParseIP(ncGatewayIPAddress) - if gwIP == nil { - return nil, nil, errors.Wrapf(nil, "cns returned an invalid gateway address: %s", ncGatewayIPAddress) + gwIP, err := netip.ParseAddr(ncGatewayIPAddress) + if err != nil { + return nil, nil, errors.Wrapf(err, "cns returned an invalid gateway address %q", ncGatewayIPAddress) } - return resultIPNet, gwIP, nil + return &podIPNet, &gwIP, nil } type K8SPodEnvArgs struct { @@ -77,32 +71,3 @@ func parsePodConf(args string) (*K8SPodEnvArgs, error) { } return &podCfg, nil } - -func getEndpointID(containerID, ifName string) string { - const minContainerLength = 8 - if len(containerID) > minContainerLength { - containerID = containerID[:8] - } else { - log.Printf("Container ID length is not greater than 8: %v", containerID) - return "" - } - - infraEpName := containerID + "-" + ifName - - return infraEpName -} - -// Parse network config from given byte array -func parseNetConf(b []byte) (*cniTypes.NetConf, error) { - netConf := &cniTypes.NetConf{} - err := json.Unmarshal(b, netConf) - if err != nil { - return nil, errors.Wrapf(err, "failed to unmarshal net conf") - } - - if netConf.CNIVersion == "" { - netConf.CNIVersion = "0.2.0" - } - - return netConf, nil -} diff --git a/azure-ipam/const.go b/azure-ipam/const.go index 557c47d0d0..cf1e89e36a 100644 --- a/azure-ipam/const.go +++ b/azure-ipam/const.go @@ -1,9 +1,19 @@ package main -import "time" +import ( + "time" +) const ( pluginName = "azure-ipam" cnsBaseURL = "" // fallback to default http://localhost:10090 csnReqTimeout = 15 * time.Second ) + +type Env int8 + +const ( + Prod Env = iota + Dev + Test +) diff --git a/azure-ipam/go.mod b/azure-ipam/go.mod index 2f8f8e4c95..9a1c40b247 100644 --- a/azure-ipam/go.mod +++ b/azure-ipam/go.mod @@ -2,7 +2,11 @@ module github.com/Azure/azure-container-networking/azure-ipam go 1.18 -require go.uber.org/zap v1.21.0 +require ( + github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.7.1 + go.uber.org/zap v1.21.0 +) require ( code.cloudfoundry.org/clock v1.0.0 // indirect @@ -21,13 +25,14 @@ require ( github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/swag v0.19.14 // indirect - github.com/gofrs/uuid v3.3.0+incompatible // indirect + github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.8 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -37,7 +42,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.12.2 // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -45,7 +49,6 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.7.1 // indirect go.opencensus.io v0.23.0 // indirect golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect @@ -72,7 +75,7 @@ require ( require ( github.com/Azure/azure-container-networking v1.4.27 - github.com/containernetworking/cni v1.1.1 // indirect + github.com/containernetworking/cni v1.1.1 github.com/containernetworking/plugins v1.1.1 go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect diff --git a/azure-ipam/go.sum b/azure-ipam/go.sum index c8d59db9af..ee2765ae3f 100644 --- a/azure-ipam/go.sum +++ b/azure-ipam/go.sum @@ -71,6 +71,7 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -102,8 +103,6 @@ github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O1 github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v1.1.1 h1:ky20T7c0MvKvbMOwS/FrlbNwjEoqJEUUYfsL4b0mc4k= github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE= @@ -135,12 +134,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -168,8 +169,9 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -246,6 +248,7 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -289,6 +292,7 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -316,8 +320,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -326,12 +332,15 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -423,13 +432,12 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= @@ -796,12 +804,14 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -832,7 +842,6 @@ k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2U k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= diff --git a/azure-ipam/internal/buildinfo/buildinfo.go b/azure-ipam/internal/buildinfo/buildinfo.go index 77ffbb7fd2..46b0a89851 100644 --- a/azure-ipam/internal/buildinfo/buildinfo.go +++ b/azure-ipam/internal/buildinfo/buildinfo.go @@ -1,3 +1,7 @@ package buildinfo +// this will be populate by the Go compiler via +// the -ldflags, which insert dynamic information +// into the binary at build time var Version string +var BuildEnv = 0 // 0 - prod; 1 - dev; 2 - test diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index 5f2a5bdecd..8d1aad25e2 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -2,6 +2,8 @@ package main import ( "context" + "encoding/json" + "net" "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/Azure/azure-container-networking/cns" @@ -14,6 +16,7 @@ import ( ) // IPAMPlugin is the struct for the delegated azure-ipam plugin +// https://www.cni.dev/docs/spec/#section-4-plugin-delegation type IPAMPlugin struct { Name string Version string @@ -45,7 +48,23 @@ func NewPlugin(logger *zap.Logger, c cnsClient) (*IPAMPlugin, error) { // CmdAdd handles CNI add commands. func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { - p.logger.Info("ADD called") + p.logger.Info("ADD called", + zap.Any("args", args), + ) + + // Parsing network conf + nwCfg, err := parseNetConf(args.StdinData) + if err != nil { + p.logger.Error("Failed to parse CNI network config from stdin", + zap.Error(err), + zap.Any("argStdinData", args.StdinData), + ) + return errors.Wrapf(err, "failed to parse CNI network config from stdin") + } + p.logger.Debug("Parsed network config", + zap.Any("netconf", nwCfg), + ) + // Create CNS request from args req, err := createCNSRequest(args) if err != nil { @@ -54,13 +73,15 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { ) return errors.Wrapf(err, "failed to create CNS IP config request") } - p.logger.Info("Created CNS IP config request", + p.logger.Debug("Created CNS IP config request", zap.Any("request", req), ) - // cnsClient sets a request timeout. + // cnsClient enforces it own timeout ctx := context.TODO() - p.logger.Info("Making request to CNS") + p.logger.Debug("Making request to CNS") + // if this fails, the caller plugin should execute again with cmdDel before returning error. + // https://www.cni.dev/docs/spec/#delegated-plugin-execution-procedure resp, err := p.cnsClient.RequestIPAddress(ctx, req) if err != nil { p.logger.Error("Failed to request IP address from CNS", @@ -69,7 +90,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { ) return errors.Wrapf(err, "failed to get IP address from CNS") } - p.logger.Info("Received CNS IP config response", + p.logger.Debug("Received CNS IP config response", zap.Any("response", resp), ) @@ -82,35 +103,25 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { ) return errors.Wrapf(err, "failed to interpret CNS IPConfigResponse") } - p.logger.Info("Parsed pod IP and gateway IP", + p.logger.Debug("Parsed pod IP and gateway IP", zap.String("podIPNet", podIPNet.String()), zap.String("gwIP", gwIP.String()), ) - // Parsing network conf - nwCfg, err := parseNetConf(args.StdinData) - if err != nil { - p.logger.Error("Failed to parse CNI network config", - zap.Error(err), - zap.Any("argStdinData", args.StdinData), - ) - return errors.Wrapf(err, "failed to parse CNI network config") - } - p.logger.Info("Parsed network config", - zap.Any("nwCfg", nwCfg), - ) - cniResult := &types100.Result{ IPs: []*types100.IPConfig{ { - Address: *podIPNet, - Gateway: gwIP, + Address: net.IPNet{ + IP: net.ParseIP(podIPNet.Addr().String()), + Mask: net.CIDRMask(podIPNet.Bits(), 32), // nolint + }, + Gateway: net.ParseIP(gwIP.String()), }, }, Routes: []*cniTypes.Route{ { Dst: network.Ipv4DefaultRouteDstPrefix, - GW: gwIP, + GW: net.ParseIP(gwIP.String()), }, }, } @@ -124,6 +135,10 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { return errors.Wrapf(err, "failed to interpret CNI result as version %s", nwCfg.CNIVersion) } + p.logger.Info("ADD success", + zap.Any("result", versionedCniResult), + ) + versionedCniResult.Print() return nil @@ -131,28 +146,34 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { // CmdDel handles CNI delete commands. func (p *IPAMPlugin) CmdDel(args *cniSkel.CmdArgs) error { - p.logger.Info("DEL called") + p.logger.Info("DEL called", + zap.Any("args", args), + ) + // Create CNS request from args req, err := createCNSRequest(args) if err != nil { p.logger.Error("Failed to create CNS IP config request", zap.Error(err), ) - return errors.Wrapf(err, "failed to create CNS IP config request") + return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "failed to create CNS IP config request") } - p.logger.Info("Created CNS IP config request", + p.logger.Debug("Created CNS IP config request", zap.Any("request", req), ) + // cnsClient enforces it own timeout ctx := context.TODO() - p.logger.Info("Making request to CNS") + p.logger.Debug("Making request to CNS") if err := p.cnsClient.ReleaseIPAddress(ctx, req); err != nil { p.logger.Error("Failed to release IP address from CNS", zap.Error(err), zap.Any("request", req), ) - return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "") + return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "failed to release IP address from CNS") } + p.logger.Info("DEL success") + return nil } @@ -161,3 +182,18 @@ func (p *IPAMPlugin) CmdCheck(args *cniSkel.CmdArgs) error { p.logger.Info("CHECK called") return nil } + +// Parse network config from given byte array +func parseNetConf(b []byte) (*cniTypes.NetConf, error) { + netConf := &cniTypes.NetConf{} + err := json.Unmarshal(b, netConf) + if err != nil { + return nil, errors.Wrapf(err, "failed to unmarshal net conf") + } + + if netConf.CNIVersion == "" { + netConf.CNIVersion = "0.2.0" + } + + return netConf, nil +} diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index d61703ccea..e88a2032aa 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -7,11 +7,11 @@ import ( "fmt" "testing" + "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/Azure/azure-container-networking/cns" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" "github.com/stretchr/testify/require" - "go.uber.org/zap" ) type MockCNSClient struct{} @@ -90,7 +90,7 @@ func (c *MockCNSClient) ReleaseIPAddress(ctx context.Context, ipconfig cns.IPCon const ( happyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid" - nothappyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid;break=break" + nothappyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid;break=break" // this will break the pod config parsing ) type scenario struct { @@ -99,9 +99,18 @@ type scenario struct { wantErr bool } -func TestCmdAdd(t *testing.T) { - req := require.New(t) +// build args for tests +func buildArgs(containerID, args string, stdin []byte) *cniSkel.CmdArgs { + return &cniSkel.CmdArgs{ + ContainerID: containerID, + Netns: "testnetns", + IfName: "testifname", + Args: args, + StdinData: stdin, + } +} +func TestCmdAdd(t *testing.T) { happyNetConf := &cniTypes.NetConf{ CNIVersion: "0.1.0", Name: "happynetconf", @@ -122,83 +131,35 @@ func TestCmdAdd(t *testing.T) { } invalidNetConf := []byte("invalidNetConf") - happyArgs := &cniSkel.CmdArgs{ - ContainerID: "happyArgs", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: happyNetConfByteArr, - } - - failCreateCNSReqArgs := &cniSkel.CmdArgs{ - ContainerID: "failCreateCNSReqArgs", - Netns: "testnetns", - IfName: "testifname", - Args: nothappyPodArgs, - StdinData: happyNetConfByteArr, - } - - failRequestCNSArgs := &cniSkel.CmdArgs{ - ContainerID: "failRequestCNSArgs", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: happyNetConfByteArr, - } - - failProcessCNSResp := &cniSkel.CmdArgs{ - ContainerID: "failProcessCNSResp", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: happyNetConfByteArr, - } - - failParseNetConf := &cniSkel.CmdArgs{ - ContainerID: "failParseNetConf", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: invalidNetConf, - } - - failGetVersionedResult := &cniSkel.CmdArgs{ - ContainerID: "failGetVersionedResult", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: invalidVersionNetConfByteArr, - } - tests := []scenario{ { name: "Happy CNI add", - args: happyArgs, + args: buildArgs("happyArgs", happyPodArgs, happyNetConfByteArr), wantErr: false, }, { name: "Fail create CNS request during CmdAdd", - args: failCreateCNSReqArgs, + args: buildArgs("failCreateCNSReqArgs", nothappyPodArgs, happyNetConfByteArr), wantErr: true, }, { name: "Fail request CNS ipconfig during CmdAdd", - args: failRequestCNSArgs, + args: buildArgs("failRequestCNSArgs", happyPodArgs, happyNetConfByteArr), wantErr: true, }, { name: "Fail process CNS response during CmdAdd", - args: failProcessCNSResp, + args: buildArgs("failProcessCNSResp", happyPodArgs, happyNetConfByteArr), wantErr: true, }, { name: "Fail parse netconf during CmdAdd", - args: failParseNetConf, + args: buildArgs("failParseNetConf", happyPodArgs, invalidNetConf), wantErr: true, }, { name: "Fail get versioned result during CmdAdd", - args: failGetVersionedResult, + args: buildArgs("failGetVersionedResult", happyPodArgs, invalidVersionNetConfByteArr), wantErr: true, }, } @@ -207,26 +168,25 @@ func TestCmdAdd(t *testing.T) { t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - logger, err := zap.NewProduction() - defer logger.Sync() // nolint + buildinfo.BuildEnv = 2 // test env flag + logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) if err != nil { + fmt.Println(err) return } + defer cleanup(logger) // nolint ipamPlugin, _ := NewPlugin(logger, mockCNSClient) err = ipamPlugin.CmdAdd(tt.args) - fmt.Println() if tt.wantErr { - req.Error(err) + require.Error(t, err) } else { - req.NoError(err) + require.NoError(t, err) } }) } } func TestCmdDel(t *testing.T) { - req := require.New(t) - happyNetConf := &cniTypes.NetConf{ CNIVersion: "0.1.0", Name: "happynetconf", @@ -237,43 +197,20 @@ func TestCmdDel(t *testing.T) { panic(err) } - happyArgs := &cniSkel.CmdArgs{ - ContainerID: "happyArgs", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: happyNetConfByteArr, - } - - failCreateCNSReqArgs := &cniSkel.CmdArgs{ - ContainerID: "failCreateCNSReqArgs", - Netns: "testnetns", - IfName: "testifname", - Args: nothappyPodArgs, - StdinData: happyNetConfByteArr, - } - - failRequestCNSReleaseIPArgs := &cniSkel.CmdArgs{ - ContainerID: "failRequestCNSReleaseIPArgs", - Netns: "testnetns", - IfName: "testifname", - Args: happyPodArgs, - StdinData: happyNetConfByteArr, - } tests := []scenario{ { name: "Happy CNI del", - args: happyArgs, + args: buildArgs("happyArgs", happyPodArgs, happyNetConfByteArr), wantErr: false, }, { name: "Fail create CNS request during CmdDel", - args: failCreateCNSReqArgs, + args: buildArgs("failCreateCNSReqArgs", nothappyPodArgs, happyNetConfByteArr), wantErr: true, }, { name: "Fail request CNS release IP during CmdDel", - args: failRequestCNSReleaseIPArgs, + args: buildArgs("failRequestCNSReleaseIPArgs", happyPodArgs, happyNetConfByteArr), wantErr: true, }, } @@ -282,22 +219,33 @@ func TestCmdDel(t *testing.T) { t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - logger, err := zap.NewProduction() - defer logger.Sync() // nolint + buildinfo.BuildEnv = 2 + logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) if err != nil { return } + defer cleanup(logger) // nolint ipamPlugin, _ := NewPlugin(logger, mockCNSClient) err = ipamPlugin.CmdDel(tt.args) - fmt.Println() if tt.wantErr { - req.Error(err) + require.Error(t, err) } else { - req.NoError(err) + require.NoError(t, err) } }) } } func TestCmdCheck(t *testing.T) { + fmt.Println("test : cmdCheck") + mockCNSClient := &MockCNSClient{} + buildinfo.BuildEnv = 2 + logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) + if err != nil { + return + } + defer cleanup(logger) // nolint + ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + err = ipamPlugin.CmdCheck(nil) + require.NoError(t, err) } diff --git a/azure-ipam/logger.go b/azure-ipam/logger.go new file mode 100644 index 0000000000..0ae7d28fcd --- /dev/null +++ b/azure-ipam/logger.go @@ -0,0 +1,75 @@ +package main + +import ( + "github.com/pkg/errors" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// NewLogger creates and returns a zap logger and a clean up function +func NewLogger(buildEnv Env) (*zap.Logger, func(_ *zap.Logger) error, error) { + loggerCfg := &zap.Config{} + loggerCfg.Level = zap.NewAtomicLevelAt(getLogLevel(buildEnv)) + loggerCfg.Encoding = "json" + loggerCfg.OutputPaths = getLogOutputPath(buildEnv) + loggerCfg.ErrorOutputPaths = getErrOutputPath(buildEnv) + loggerCfg.EncoderConfig = zapcore.EncoderConfig{ + MessageKey: "msg", + LevelKey: "level", + EncodeLevel: zapcore.LowercaseLevelEncoder, + } + + logger, err := loggerCfg.Build() + if err != nil { + return nil, nil, errors.Wrapf(err, "failed to build zap logger") + } + return logger, CleanUpLog, nil +} + +// CleanUpLog flushes the given logger's buffered log entries +func CleanUpLog(logger *zap.Logger) error { + err := logger.Sync() + return errors.Wrapf(err, "failed to flush log") +} + +// getLogLevel return zap's log level based on the env the ipam is built in +func getLogLevel(buildEnv Env) zapcore.Level { + switch buildEnv { + case Prod: + return zapcore.InfoLevel + case Dev: + return zapcore.DebugLevel + case Test: + return zapcore.DebugLevel + default: + return zapcore.DebugLevel + } +} + +// getLogLevel return logs output paths based on the env the ipam is built in +func getLogOutputPath(buildEnv Env) []string { + switch buildEnv { + case Prod: + return []string{"var/logs"} + case Dev: + return []string{"stdout"} + case Test: + return []string{} + default: + return []string{} + } +} + +// getErrOutputPath return logs output paths based on the env the ipam is built in +func getErrOutputPath(buildEnv Env) []string { + switch buildEnv { + case Prod: + return []string{"var/logs"} + case Dev: + return []string{"stderr"} + case Test: + return []string{} + default: + return []string{} + } +} diff --git a/azure-ipam/main.go b/azure-ipam/main.go index cdf14b226e..6772f6a0a2 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -1,16 +1,15 @@ package main import ( - "encoding/json" "log" "os" + "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" cnsclient "github.com/Azure/azure-container-networking/cns/client" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/version" bv "github.com/containernetworking/plugins/pkg/utils/buildversion" "github.com/pkg/errors" - "go.uber.org/zap" ) func main() { @@ -21,29 +20,12 @@ func main() { } func executePlugin() error { - zapConfig := []byte(`{ - "level": "debug", - "encoding": "json", - "outputPaths": ["/tmp/logs"], - "errorOutputPaths": ["stderr"], - "encoderConfig": { - "messageKey": "msg", - "levelKey": "level", - "levelEncoder": "lowercase" - } - }`) - - var cfg zap.Config - if err := json.Unmarshal(zapConfig, &cfg); err != nil { - return errors.Wrapf(err, "failed to unmarshal zap config") - } - - logger, err := cfg.Build() - defer logger.Sync() // nolint + logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) if err != nil { return errors.Wrapf(err, "failed to setup IPAM logging") } - logger.Info("logger construction succeeded") + logger.Debug("logger construction succeeded") + defer cleanup(logger) // nolint // Create IPAM plugin with logger and CNS client client, err := cnsclient.New(cnsBaseURL, csnReqTimeout) @@ -52,7 +34,7 @@ func executePlugin() error { } plugin, err := NewPlugin(logger, client) if err != nil { - logger.Info("Failed to create IPAM plugin") + logger.Error("Failed to create IPAM plugin") return errors.Wrapf(err, "failed to create IPAM plugin") } From 197a99da5268de14b21277a21645b028e4eb9a45 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 24 Jun 2022 21:23:08 +0000 Subject: [PATCH 08/12] remove env cases --- azure-ipam/const.go | 8 --- azure-ipam/internal/buildinfo/buildinfo.go | 7 ++- azure-ipam/ipam.go | 18 +++++- azure-ipam/ipam_test.go | 64 ++++++++++++++++++---- azure-ipam/logger.go | 61 +++++++-------------- azure-ipam/main.go | 3 +- 6 files changed, 96 insertions(+), 65 deletions(-) diff --git a/azure-ipam/const.go b/azure-ipam/const.go index cf1e89e36a..3351b1445c 100644 --- a/azure-ipam/const.go +++ b/azure-ipam/const.go @@ -9,11 +9,3 @@ const ( cnsBaseURL = "" // fallback to default http://localhost:10090 csnReqTimeout = 15 * time.Second ) - -type Env int8 - -const ( - Prod Env = iota - Dev - Test -) diff --git a/azure-ipam/internal/buildinfo/buildinfo.go b/azure-ipam/internal/buildinfo/buildinfo.go index 46b0a89851..9b3ff490c9 100644 --- a/azure-ipam/internal/buildinfo/buildinfo.go +++ b/azure-ipam/internal/buildinfo/buildinfo.go @@ -4,4 +4,9 @@ package buildinfo // the -ldflags, which insert dynamic information // into the binary at build time var Version string -var BuildEnv = 0 // 0 - prod; 1 - dev; 2 - test + +var ( + LogLevel string + OutputPaths string // comma separated list of paths + ErrorOutputPaths string // comma separated list of paths +) diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index 8d1aad25e2..e59d7949bf 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -3,7 +3,9 @@ package main import ( "context" "encoding/json" + "io" "net" + "os" "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/Azure/azure-container-networking/cns" @@ -30,7 +32,10 @@ type cnsClient interface { ReleaseIPAddress(context.Context, cns.IPConfigRequest) error } -// NewPlugin constructs a new IPAM plugin +// Out indicate the output channel for the plugin +var Out io.Writer = os.Stdout + +// NewPlugin constructs a new IPAM plugin instance with given logger and CNS client func NewPlugin(logger *zap.Logger, c cnsClient) (*IPAMPlugin, error) { plugin := &IPAMPlugin{ Name: pluginName, @@ -126,6 +131,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { }, } + // Get versioned result versionedCniResult, err := cniResult.GetAsVersion(nwCfg.CNIVersion) if err != nil { p.logger.Error("Failed to interpret CNI result with netconf CNI version", @@ -139,7 +145,15 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { zap.Any("result", versionedCniResult), ) - versionedCniResult.Print() + // Write result to output channel + err = versionedCniResult.PrintTo(Out) + if err != nil { + p.logger.Error("Failed to output CNI result", + zap.Error(err), + zap.Any("result", versionedCniResult), + ) + return errors.Wrapf(err, "failed to output CNI result") + } return nil } diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index e88a2032aa..a602f0366c 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -3,19 +3,34 @@ package main import ( "context" "encoding/json" - "errors" "fmt" + "net" "testing" - "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/Azure/azure-container-networking/cns" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" + types100 "github.com/containernetworking/cni/pkg/types/100" + "github.com/pkg/errors" "github.com/stretchr/testify/require" ) +// MOckCNSClient is a mock implementation of the CNSClient interface type MockCNSClient struct{} +// cniResultsWriter is a helper struct to write CNI results to a byte array +type cniResultsWriter struct { + result *types100.Result +} + +func (w *cniResultsWriter) Write(data []byte) (int, error) { + err := json.Unmarshal(data, &w.result) + if err != nil { + return 0, errors.Wrapf(err, "failed to unmarshal CNI result") + } + return len(data), nil +} + var errFoo = errors.New("err") func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error) { @@ -26,7 +41,7 @@ func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPCon result := &cns.IPConfigResponse{ PodIpInfo: cns.PodIpInfo{ PodIPConfig: cns.IPSubnet{ - IPAddress: "10.0.1.10.2", + IPAddress: "10.0.1.10.2", // invalid ip address PrefixLength: 24, }, NetworkContainerPrimaryIPConfig: cns.IPConfiguration{ @@ -96,6 +111,7 @@ const ( type scenario struct { name string args *cniSkel.CmdArgs + want *types100.Result wantErr bool } @@ -112,7 +128,7 @@ func buildArgs(containerID, args string, stdin []byte) *cniSkel.CmdArgs { func TestCmdAdd(t *testing.T) { happyNetConf := &cniTypes.NetConf{ - CNIVersion: "0.1.0", + CNIVersion: "1.0.0", Name: "happynetconf", } @@ -133,8 +149,30 @@ func TestCmdAdd(t *testing.T) { tests := []scenario{ { - name: "Happy CNI add", - args: buildArgs("happyArgs", happyPodArgs, happyNetConfByteArr), + name: "Happy CNI add", + args: buildArgs("happyArgs", happyPodArgs, happyNetConfByteArr), + want: &types100.Result{ + CNIVersion: "1.0.0", + IPs: []*types100.IPConfig{ + { + Address: net.IPNet{ + IP: net.IPv4(10, 0, 1, 10), + Mask: net.CIDRMask(24, 32), + }, + Gateway: net.IPv4(10, 0, 0, 1), + }, + }, + Routes: []*cniTypes.Route{ + { + Dst: net.IPNet{ + IP: net.IPv4(0, 0, 0, 0), + Mask: net.CIDRMask(0, 32), + }, + GW: net.IPv4(10, 0, 0, 1), + }, + }, + DNS: cniTypes.DNS{}, + }, wantErr: false, }, { @@ -165,11 +203,12 @@ func TestCmdAdd(t *testing.T) { } for _, tt := range tests { tt := tt + writer := &cniResultsWriter{} + Out = writer t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - buildinfo.BuildEnv = 2 // test env flag - logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) + logger, cleanup, err := NewLogger() if err != nil { fmt.Println(err) return @@ -182,6 +221,9 @@ func TestCmdAdd(t *testing.T) { } else { require.NoError(t, err) } + if tt.want != nil { + require.Equal(t, tt.want, writer.result) + } }) } } @@ -219,8 +261,7 @@ func TestCmdDel(t *testing.T) { t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - buildinfo.BuildEnv = 2 - logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) + logger, cleanup, err := NewLogger() if err != nil { return } @@ -239,8 +280,7 @@ func TestCmdDel(t *testing.T) { func TestCmdCheck(t *testing.T) { fmt.Println("test : cmdCheck") mockCNSClient := &MockCNSClient{} - buildinfo.BuildEnv = 2 - logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) + logger, cleanup, err := NewLogger() if err != nil { return } diff --git a/azure-ipam/logger.go b/azure-ipam/logger.go index 0ae7d28fcd..cc79e33650 100644 --- a/azure-ipam/logger.go +++ b/azure-ipam/logger.go @@ -1,18 +1,27 @@ package main import ( + "strings" + + "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/pkg/errors" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) // NewLogger creates and returns a zap logger and a clean up function -func NewLogger(buildEnv Env) (*zap.Logger, func(_ *zap.Logger) error, error) { +func NewLogger() (*zap.Logger, func(_ *zap.Logger) error, error) { loggerCfg := &zap.Config{} - loggerCfg.Level = zap.NewAtomicLevelAt(getLogLevel(buildEnv)) + + level, err := zapcore.ParseLevel(buildinfo.LogLevel) + if err != nil { + return nil, nil, errors.Wrapf(err, "failed to parse log level") + } + loggerCfg.Level = zap.NewAtomicLevelAt(level) + loggerCfg.Encoding = "json" - loggerCfg.OutputPaths = getLogOutputPath(buildEnv) - loggerCfg.ErrorOutputPaths = getErrOutputPath(buildEnv) + loggerCfg.OutputPaths = getLogOutputPath(buildinfo.OutputPaths) + loggerCfg.ErrorOutputPaths = getErrOutputPath(buildinfo.ErrorOutputPaths) loggerCfg.EncoderConfig = zapcore.EncoderConfig{ MessageKey: "msg", LevelKey: "level", @@ -32,44 +41,16 @@ func CleanUpLog(logger *zap.Logger) error { return errors.Wrapf(err, "failed to flush log") } -// getLogLevel return zap's log level based on the env the ipam is built in -func getLogLevel(buildEnv Env) zapcore.Level { - switch buildEnv { - case Prod: - return zapcore.InfoLevel - case Dev: - return zapcore.DebugLevel - case Test: - return zapcore.DebugLevel - default: - return zapcore.DebugLevel - } -} - -// getLogLevel return logs output paths based on the env the ipam is built in -func getLogOutputPath(buildEnv Env) []string { - switch buildEnv { - case Prod: - return []string{"var/logs"} - case Dev: - return []string{"stdout"} - case Test: - return []string{} - default: - return []string{} +func getLogOutputPath(paths string) []string { + if paths == "" { + return nil } + return strings.Split(paths, ",") } -// getErrOutputPath return logs output paths based on the env the ipam is built in -func getErrOutputPath(buildEnv Env) []string { - switch buildEnv { - case Prod: - return []string{"var/logs"} - case Dev: - return []string{"stderr"} - case Test: - return []string{} - default: - return []string{} +func getErrOutputPath(paths string) []string { + if paths == "" { + return nil } + return strings.Split(paths, ",") } diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 6772f6a0a2..e49d776486 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -4,7 +4,6 @@ import ( "log" "os" - "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" cnsclient "github.com/Azure/azure-container-networking/cns/client" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/version" @@ -20,7 +19,7 @@ func main() { } func executePlugin() error { - logger, cleanup, err := NewLogger(Env(buildinfo.BuildEnv)) + logger, cleanup, err := NewLogger() if err != nil { return errors.Wrapf(err, "failed to setup IPAM logging") } From 208da93d13871ee620a2df98817652532d8c0cc3 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Mon, 27 Jun 2022 21:19:34 +0000 Subject: [PATCH 09/12] cleaner logging setup --- azure-ipam/ipam_test.go | 8 ++++---- azure-ipam/logger.go | 12 +++++------- azure-ipam/main.go | 8 ++++++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index a602f0366c..d8823b5062 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -213,7 +213,7 @@ func TestCmdAdd(t *testing.T) { fmt.Println(err) return } - defer cleanup(logger) // nolint + defer cleanup() ipamPlugin, _ := NewPlugin(logger, mockCNSClient) err = ipamPlugin.CmdAdd(tt.args) if tt.wantErr { @@ -230,7 +230,7 @@ func TestCmdAdd(t *testing.T) { func TestCmdDel(t *testing.T) { happyNetConf := &cniTypes.NetConf{ - CNIVersion: "0.1.0", + CNIVersion: "1.0.0", Name: "happynetconf", } @@ -265,7 +265,7 @@ func TestCmdDel(t *testing.T) { if err != nil { return } - defer cleanup(logger) // nolint + defer cleanup() ipamPlugin, _ := NewPlugin(logger, mockCNSClient) err = ipamPlugin.CmdDel(tt.args) if tt.wantErr { @@ -284,7 +284,7 @@ func TestCmdCheck(t *testing.T) { if err != nil { return } - defer cleanup(logger) // nolint + defer cleanup() ipamPlugin, _ := NewPlugin(logger, mockCNSClient) err = ipamPlugin.CmdCheck(nil) require.NoError(t, err) diff --git a/azure-ipam/logger.go b/azure-ipam/logger.go index cc79e33650..74d99e3cfa 100644 --- a/azure-ipam/logger.go +++ b/azure-ipam/logger.go @@ -10,7 +10,7 @@ import ( ) // NewLogger creates and returns a zap logger and a clean up function -func NewLogger() (*zap.Logger, func(_ *zap.Logger) error, error) { +func NewLogger() (*zap.Logger, func(), error) { loggerCfg := &zap.Config{} level, err := zapcore.ParseLevel(buildinfo.LogLevel) @@ -32,13 +32,11 @@ func NewLogger() (*zap.Logger, func(_ *zap.Logger) error, error) { if err != nil { return nil, nil, errors.Wrapf(err, "failed to build zap logger") } - return logger, CleanUpLog, nil -} -// CleanUpLog flushes the given logger's buffered log entries -func CleanUpLog(logger *zap.Logger) error { - err := logger.Sync() - return errors.Wrapf(err, "failed to flush log") + cleanup := func() { + logger.Sync() + } + return logger, cleanup, nil } func getLogOutputPath(paths string) []string { diff --git a/azure-ipam/main.go b/azure-ipam/main.go index e49d776486..e3bb90ff30 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -19,23 +19,27 @@ func main() { } func executePlugin() error { + // Create logger logger, cleanup, err := NewLogger() if err != nil { return errors.Wrapf(err, "failed to setup IPAM logging") } logger.Debug("logger construction succeeded") - defer cleanup(logger) // nolint + defer cleanup() - // Create IPAM plugin with logger and CNS client + // Create CNS client client, err := cnsclient.New(cnsBaseURL, csnReqTimeout) if err != nil { return errors.Wrapf(err, "failed to initialize CNS client") } + + // Create IPAM plugin plugin, err := NewPlugin(logger, client) if err != nil { logger.Error("Failed to create IPAM plugin") return errors.Wrapf(err, "failed to create IPAM plugin") } + // Execute CNI plugin return skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(pluginName)) } From 690951bfe9333bab7963bd16c4649a9581a0c3cb Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Mon, 27 Jun 2022 21:20:10 +0000 Subject: [PATCH 10/12] cleaner logging setup --- azure-ipam/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-ipam/logger.go b/azure-ipam/logger.go index 74d99e3cfa..078d8264c9 100644 --- a/azure-ipam/logger.go +++ b/azure-ipam/logger.go @@ -34,7 +34,7 @@ func NewLogger() (*zap.Logger, func(), error) { } cleanup := func() { - logger.Sync() + logger.Sync() // nolint } return logger, cleanup, nil } From e0ff9f4353a2416dda3a1415d173234f2f7e2070 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Tue, 28 Jun 2022 21:42:26 +0000 Subject: [PATCH 11/12] addressed more comments + conformed error type for return --- azure-ipam/const.go | 10 +- azure-ipam/internal/buildinfo/buildinfo.go | 6 - azure-ipam/ipam.go | 126 ++++++------------ azure-ipam/ipam_test.go | 60 ++++----- .../{cnsutils.go => ipconfig/ipconfig.go} | 17 ++- azure-ipam/{ => logger}/logger.go | 19 ++- azure-ipam/main.go | 17 ++- 7 files changed, 112 insertions(+), 143 deletions(-) rename azure-ipam/{cnsutils.go => ipconfig/ipconfig.go} (80%) rename azure-ipam/{ => logger}/logger.go (68%) diff --git a/azure-ipam/const.go b/azure-ipam/const.go index 3351b1445c..23591ce679 100644 --- a/azure-ipam/const.go +++ b/azure-ipam/const.go @@ -7,5 +7,13 @@ import ( const ( pluginName = "azure-ipam" cnsBaseURL = "" // fallback to default http://localhost:10090 - csnReqTimeout = 15 * time.Second + cnsReqTimeout = 15 * time.Second +) + +// plugin specific error codes +// https://www.cni.dev/docs/spec/#error +const ( + ErrCreateIPConfigRequest uint = iota + 100 + ErrRequestIPConfigFromCNS + ErrProcessIPConfigResponse ) diff --git a/azure-ipam/internal/buildinfo/buildinfo.go b/azure-ipam/internal/buildinfo/buildinfo.go index 9b3ff490c9..e26b8d2f8e 100644 --- a/azure-ipam/internal/buildinfo/buildinfo.go +++ b/azure-ipam/internal/buildinfo/buildinfo.go @@ -4,9 +4,3 @@ package buildinfo // the -ldflags, which insert dynamic information // into the binary at build time var Version string - -var ( - LogLevel string - OutputPaths string // comma separated list of paths - ErrorOutputPaths string // comma separated list of paths -) diff --git a/azure-ipam/ipam.go b/azure-ipam/ipam.go index e59d7949bf..a0042e0193 100644 --- a/azure-ipam/ipam.go +++ b/azure-ipam/ipam.go @@ -5,11 +5,10 @@ import ( "encoding/json" "io" "net" - "os" "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" + "github.com/Azure/azure-container-networking/azure-ipam/ipconfig" "github.com/Azure/azure-container-networking/cns" - "github.com/Azure/azure-container-networking/network" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" types100 "github.com/containernetworking/cni/pkg/types/100" @@ -25,6 +24,7 @@ type IPAMPlugin struct { Options map[string]interface{} logger *zap.Logger cnsClient cnsClient + out io.Writer // indicate the output channel for the plugin } type cnsClient interface { @@ -32,15 +32,13 @@ type cnsClient interface { ReleaseIPAddress(context.Context, cns.IPConfigRequest) error } -// Out indicate the output channel for the plugin -var Out io.Writer = os.Stdout - // NewPlugin constructs a new IPAM plugin instance with given logger and CNS client -func NewPlugin(logger *zap.Logger, c cnsClient) (*IPAMPlugin, error) { +func NewPlugin(logger *zap.Logger, c cnsClient, out io.Writer) (*IPAMPlugin, error) { plugin := &IPAMPlugin{ Name: pluginName, Version: buildinfo.Version, logger: logger, + out: out, cnsClient: c, } return plugin, nil @@ -53,65 +51,41 @@ func NewPlugin(logger *zap.Logger, c cnsClient) (*IPAMPlugin, error) { // CmdAdd handles CNI add commands. func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { - p.logger.Info("ADD called", - zap.Any("args", args), - ) + p.logger.Info("ADD called", zap.Any("args", args)) // Parsing network conf nwCfg, err := parseNetConf(args.StdinData) if err != nil { - p.logger.Error("Failed to parse CNI network config from stdin", - zap.Error(err), - zap.Any("argStdinData", args.StdinData), - ) - return errors.Wrapf(err, "failed to parse CNI network config from stdin") + p.logger.Error("Failed to parse CNI network config from stdin", zap.Error(err), zap.Any("argStdinData", args.StdinData)) + return cniTypes.NewError(cniTypes.ErrDecodingFailure, err.Error(), "failed to parse CNI network config from stdin") } - p.logger.Debug("Parsed network config", - zap.Any("netconf", nwCfg), - ) + p.logger.Debug("Parsed network config", zap.Any("netconf", nwCfg)) - // Create CNS request from args - req, err := createCNSRequest(args) + // Create ip config request from args + req, err := ipconfig.CreateIPConfigReq(args) if err != nil { - p.logger.Error("Failed to create CNS IP config request", - zap.Error(err), - ) - return errors.Wrapf(err, "failed to create CNS IP config request") + p.logger.Error("Failed to create CNS IP config request", zap.Error(err)) + return cniTypes.NewError(ErrCreateIPConfigRequest, err.Error(), "failed to create CNS IP config request") } - p.logger.Debug("Created CNS IP config request", - zap.Any("request", req), - ) + p.logger.Debug("Created CNS IP config request", zap.Any("request", req)) - // cnsClient enforces it own timeout - ctx := context.TODO() p.logger.Debug("Making request to CNS") // if this fails, the caller plugin should execute again with cmdDel before returning error. // https://www.cni.dev/docs/spec/#delegated-plugin-execution-procedure - resp, err := p.cnsClient.RequestIPAddress(ctx, req) + resp, err := p.cnsClient.RequestIPAddress(context.TODO(), req) if err != nil { - p.logger.Error("Failed to request IP address from CNS", - zap.Error(err), - zap.Any("request", req), - ) - return errors.Wrapf(err, "failed to get IP address from CNS") + p.logger.Error("Failed to request IP address from CNS", zap.Error(err), zap.Any("request", req)) + return cniTypes.NewError(ErrRequestIPConfigFromCNS, err.Error(), "failed to request IP address from CNS") } - p.logger.Debug("Received CNS IP config response", - zap.Any("response", resp), - ) + p.logger.Debug("Received CNS IP config response", zap.Any("response", resp)) - // Get Pod IP and gateway IP from CNS response - podIPNet, gwIP, err := processCNSResponse(resp) + // Get Pod IP and gateway IP from ip config response + podIPNet, gwIP, err := ipconfig.ProcessIPConfigResp(resp) if err != nil { - p.logger.Error("Failed to interpret CNS IPConfigResponse", - zap.Error(err), - zap.Any("response", resp), - ) - return errors.Wrapf(err, "failed to interpret CNS IPConfigResponse") + p.logger.Error("Failed to interpret CNS IPConfigResponse", zap.Error(err), zap.Any("response", resp)) + return cniTypes.NewError(ErrProcessIPConfigResponse, err.Error(), "failed to interpret CNS IPConfigResponse") } - p.logger.Debug("Parsed pod IP and gateway IP", - zap.String("podIPNet", podIPNet.String()), - zap.String("gwIP", gwIP.String()), - ) + p.logger.Debug("Parsed pod IP and gateway IP", zap.String("podIPNet", podIPNet.String()), zap.String("gwIP", gwIP.String())) cniResult := &types100.Result{ IPs: []*types100.IPConfig{ @@ -125,8 +99,11 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { }, Routes: []*cniTypes.Route{ { - Dst: network.Ipv4DefaultRouteDstPrefix, - GW: net.ParseIP(gwIP.String()), + Dst: net.IPNet{ + IP: net.IPv4zero, + Mask: net.IPv4Mask(0, 0, 0, 0), + }, + GW: net.ParseIP(gwIP.String()), }, }, } @@ -134,25 +111,17 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { // Get versioned result versionedCniResult, err := cniResult.GetAsVersion(nwCfg.CNIVersion) if err != nil { - p.logger.Error("Failed to interpret CNI result with netconf CNI version", - zap.Error(err), - zap.Any("cniVersion", nwCfg.CNIVersion), - ) - return errors.Wrapf(err, "failed to interpret CNI result as version %s", nwCfg.CNIVersion) + p.logger.Error("Failed to interpret CNI result with netconf CNI version", zap.Error(err), zap.Any("cniVersion", nwCfg.CNIVersion)) + return cniTypes.NewError(cniTypes.ErrIncompatibleCNIVersion, err.Error(), "failed to interpret CNI result with netconf CNI version") } - p.logger.Info("ADD success", - zap.Any("result", versionedCniResult), - ) + p.logger.Info("ADD success", zap.Any("result", versionedCniResult)) // Write result to output channel - err = versionedCniResult.PrintTo(Out) + err = versionedCniResult.PrintTo(p.out) if err != nil { - p.logger.Error("Failed to output CNI result", - zap.Error(err), - zap.Any("result", versionedCniResult), - ) - return errors.Wrapf(err, "failed to output CNI result") + p.logger.Error("Failed to print CNI result to output channel", zap.Error(err), zap.Any("result", versionedCniResult)) + return cniTypes.NewError(cniTypes.ErrIOFailure, err.Error(), "failed to print CNI result to output channel") } return nil @@ -160,29 +129,20 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error { // CmdDel handles CNI delete commands. func (p *IPAMPlugin) CmdDel(args *cniSkel.CmdArgs) error { - p.logger.Info("DEL called", - zap.Any("args", args), - ) + p.logger.Info("DEL called", zap.Any("args", args)) - // Create CNS request from args - req, err := createCNSRequest(args) + // Create ip config request from args + req, err := ipconfig.CreateIPConfigReq(args) if err != nil { - p.logger.Error("Failed to create CNS IP config request", - zap.Error(err), - ) + p.logger.Error("Failed to create CNS IP config request", zap.Error(err)) return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "failed to create CNS IP config request") } - p.logger.Debug("Created CNS IP config request", - zap.Any("request", req), - ) - // cnsClient enforces it own timeout - ctx := context.TODO() + p.logger.Debug("Created CNS IP config request", zap.Any("request", req)) + p.logger.Debug("Making request to CNS") - if err := p.cnsClient.ReleaseIPAddress(ctx, req); err != nil { - p.logger.Error("Failed to release IP address from CNS", - zap.Error(err), - zap.Any("request", req), - ) + // cnsClient enforces it own timeout + if err := p.cnsClient.ReleaseIPAddress(context.TODO(), req); err != nil { + p.logger.Error("Failed to release IP address from CNS", zap.Error(err), zap.Any("request", req)) return cniTypes.NewError(cniTypes.ErrTryAgainLater, err.Error(), "failed to release IP address from CNS") } @@ -206,7 +166,7 @@ func parseNetConf(b []byte) (*cniTypes.NetConf, error) { } if netConf.CNIVersion == "" { - netConf.CNIVersion = "0.2.0" + netConf.CNIVersion = "0.2.0" // default CNI version } return netConf, nil diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index d8823b5062..1a58c077b5 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -7,6 +7,7 @@ import ( "net" "testing" + "github.com/Azure/azure-container-networking/azure-ipam/logger" "github.com/Azure/azure-container-networking/cns" cniSkel "github.com/containernetworking/cni/pkg/skel" cniTypes "github.com/containernetworking/cni/pkg/types" @@ -15,24 +16,14 @@ import ( "github.com/stretchr/testify/require" ) +var ( + errFoo = errors.New("err") + loggerCfg *logger.Config = &logger.Config{} +) + // MOckCNSClient is a mock implementation of the CNSClient interface type MockCNSClient struct{} -// cniResultsWriter is a helper struct to write CNI results to a byte array -type cniResultsWriter struct { - result *types100.Result -} - -func (w *cniResultsWriter) Write(data []byte) (int, error) { - err := json.Unmarshal(data, &w.result) - if err != nil { - return 0, errors.Wrapf(err, "failed to unmarshal CNI result") - } - return len(data), nil -} - -var errFoo = errors.New("err") - func (c *MockCNSClient) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error) { switch ipconfig.InfraContainerID { case "failRequestCNSArgs": @@ -103,9 +94,21 @@ func (c *MockCNSClient) ReleaseIPAddress(ctx context.Context, ipconfig cns.IPCon } } +// cniResultsWriter is a helper struct to write CNI results to a byte array +type cniResultsWriter struct { + result *types100.Result +} + +func (w *cniResultsWriter) Write(data []byte) (int, error) { + err := json.Unmarshal(data, &w.result) + if err != nil { + return 0, errors.Wrapf(err, "failed to unmarshal CNI result") + } + return len(data), nil +} + const ( - happyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid" - nothappyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid;break=break" // this will break the pod config parsing + happyPodArgs = "K8S_POD_NAMESPACE=testns;K8S_POD_NAME=testname;K8S_POD_INFRA_CONTAINER_ID=testid" ) type scenario struct { @@ -175,11 +178,6 @@ func TestCmdAdd(t *testing.T) { }, wantErr: false, }, - { - name: "Fail create CNS request during CmdAdd", - args: buildArgs("failCreateCNSReqArgs", nothappyPodArgs, happyNetConfByteArr), - wantErr: true, - }, { name: "Fail request CNS ipconfig during CmdAdd", args: buildArgs("failRequestCNSArgs", happyPodArgs, happyNetConfByteArr), @@ -204,17 +202,16 @@ func TestCmdAdd(t *testing.T) { for _, tt := range tests { tt := tt writer := &cniResultsWriter{} - Out = writer t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - logger, cleanup, err := NewLogger() + testLogger, cleanup, err := logger.New(loggerCfg) if err != nil { fmt.Println(err) return } defer cleanup() - ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + ipamPlugin, _ := NewPlugin(testLogger, mockCNSClient, writer) err = ipamPlugin.CmdAdd(tt.args) if tt.wantErr { require.Error(t, err) @@ -245,11 +242,6 @@ func TestCmdDel(t *testing.T) { args: buildArgs("happyArgs", happyPodArgs, happyNetConfByteArr), wantErr: false, }, - { - name: "Fail create CNS request during CmdDel", - args: buildArgs("failCreateCNSReqArgs", nothappyPodArgs, happyNetConfByteArr), - wantErr: true, - }, { name: "Fail request CNS release IP during CmdDel", args: buildArgs("failRequestCNSReleaseIPArgs", happyPodArgs, happyNetConfByteArr), @@ -261,12 +253,12 @@ func TestCmdDel(t *testing.T) { t.Run(tt.name, func(t *testing.T) { fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} - logger, cleanup, err := NewLogger() + testLogger, cleanup, err := logger.New(loggerCfg) if err != nil { return } defer cleanup() - ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + ipamPlugin, _ := NewPlugin(testLogger, mockCNSClient, nil) err = ipamPlugin.CmdDel(tt.args) if tt.wantErr { require.Error(t, err) @@ -280,12 +272,12 @@ func TestCmdDel(t *testing.T) { func TestCmdCheck(t *testing.T) { fmt.Println("test : cmdCheck") mockCNSClient := &MockCNSClient{} - logger, cleanup, err := NewLogger() + testLogger, cleanup, err := logger.New(loggerCfg) if err != nil { return } defer cleanup() - ipamPlugin, _ := NewPlugin(logger, mockCNSClient) + ipamPlugin, _ := NewPlugin(testLogger, mockCNSClient, nil) err = ipamPlugin.CmdCheck(nil) require.NoError(t, err) } diff --git a/azure-ipam/cnsutils.go b/azure-ipam/ipconfig/ipconfig.go similarity index 80% rename from azure-ipam/cnsutils.go rename to azure-ipam/ipconfig/ipconfig.go index a0ea305710..6906f8cd72 100644 --- a/azure-ipam/cnsutils.go +++ b/azure-ipam/ipconfig/ipconfig.go @@ -1,4 +1,4 @@ -package main +package ipconfig import ( "encoding/json" @@ -11,7 +11,8 @@ import ( "github.com/pkg/errors" ) -func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { +// CreateIPConfigReq creates an IPConfigRequest from the given CNI args. +func CreateIPConfigReq(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { podConf, err := parsePodConf(args.Args) if err != nil { return cns.IPConfigRequest{}, errors.Wrapf(err, "failed to parse pod config from CNI args") @@ -36,7 +37,8 @@ func createCNSRequest(args *cniSkel.CmdArgs) (cns.IPConfigRequest, error) { return req, nil } -func processCNSResponse(resp *cns.IPConfigResponse) (*netip.Prefix, *netip.Addr, error) { +// ProcessIPConfigResp processes the IPConfigResponse from the CNS. +func ProcessIPConfigResp(resp *cns.IPConfigResponse) (*netip.Prefix, *netip.Addr, error) { podCIDR := fmt.Sprintf( "%s/%d", resp.PodIpInfo.PodIPConfig.IPAddress, @@ -56,18 +58,19 @@ func processCNSResponse(resp *cns.IPConfigResponse) (*netip.Prefix, *netip.Addr, return &podIPNet, &gwIP, nil } -type K8SPodEnvArgs struct { +type k8sPodEnvArgs struct { cniTypes.CommonArgs K8S_POD_NAMESPACE cniTypes.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` // nolint K8S_POD_NAME cniTypes.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` // nolint K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` // nolint } -func parsePodConf(args string) (*K8SPodEnvArgs, error) { - podCfg := K8SPodEnvArgs{} +func parsePodConf(args string) (*k8sPodEnvArgs, error) { + podCfg := k8sPodEnvArgs{} + podCfg.CommonArgs.IgnoreUnknown = true err := cniTypes.LoadArgs(args, &podCfg) if err != nil { - return nil, errors.Wrapf(err, "failed to parse pod config from stdin") + return nil, errors.Wrapf(err, "failed to parse pod config from env args") } return &podCfg, nil } diff --git a/azure-ipam/logger.go b/azure-ipam/logger/logger.go similarity index 68% rename from azure-ipam/logger.go rename to azure-ipam/logger/logger.go index 078d8264c9..4fcd8e989c 100644 --- a/azure-ipam/logger.go +++ b/azure-ipam/logger/logger.go @@ -1,27 +1,32 @@ -package main +package logger import ( "strings" - "github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo" "github.com/pkg/errors" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) +type Config struct { + Level string + OutputPaths string // comma separated list of paths + ErrorOutputPaths string // comma separated list of paths +} + // NewLogger creates and returns a zap logger and a clean up function -func NewLogger() (*zap.Logger, func(), error) { +func New(cfg *Config) (*zap.Logger, func(), error) { loggerCfg := &zap.Config{} - level, err := zapcore.ParseLevel(buildinfo.LogLevel) + level, err := zapcore.ParseLevel(cfg.Level) if err != nil { return nil, nil, errors.Wrapf(err, "failed to parse log level") } loggerCfg.Level = zap.NewAtomicLevelAt(level) loggerCfg.Encoding = "json" - loggerCfg.OutputPaths = getLogOutputPath(buildinfo.OutputPaths) - loggerCfg.ErrorOutputPaths = getErrOutputPath(buildinfo.ErrorOutputPaths) + loggerCfg.OutputPaths = getLogOutputPath(cfg.OutputPaths) + loggerCfg.ErrorOutputPaths = getErrOutputPath(cfg.ErrorOutputPaths) loggerCfg.EncoderConfig = zapcore.EncoderConfig{ MessageKey: "msg", LevelKey: "level", @@ -34,7 +39,7 @@ func NewLogger() (*zap.Logger, func(), error) { } cleanup := func() { - logger.Sync() // nolint + _ = logger.Sync() } return logger, cleanup, nil } diff --git a/azure-ipam/main.go b/azure-ipam/main.go index e3bb90ff30..3e75d5e9b9 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -4,6 +4,7 @@ import ( "log" "os" + "github.com/Azure/azure-container-networking/azure-ipam/logger" cnsclient "github.com/Azure/azure-container-networking/cns/client" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/version" @@ -19,24 +20,30 @@ func main() { } func executePlugin() error { + // logger config + var loggerCfg *logger.Config + loggerCfg.Level = "debug" + loggerCfg.OutputPaths = "stdout" + loggerCfg.ErrorOutputPaths = "stderr" + // Create logger - logger, cleanup, err := NewLogger() + pluginLogger, cleanup, err := logger.New(loggerCfg) if err != nil { return errors.Wrapf(err, "failed to setup IPAM logging") } - logger.Debug("logger construction succeeded") + pluginLogger.Debug("logger construction succeeded") defer cleanup() // Create CNS client - client, err := cnsclient.New(cnsBaseURL, csnReqTimeout) + client, err := cnsclient.New(cnsBaseURL, cnsReqTimeout) if err != nil { return errors.Wrapf(err, "failed to initialize CNS client") } // Create IPAM plugin - plugin, err := NewPlugin(logger, client) + plugin, err := NewPlugin(pluginLogger, client, os.Stdout) if err != nil { - logger.Error("Failed to create IPAM plugin") + pluginLogger.Error("Failed to create IPAM plugin") return errors.Wrapf(err, "failed to create IPAM plugin") } From 79c40e85ce6bb626eb014e5dd951123a5507fd71 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 30 Jun 2022 17:05:16 +0000 Subject: [PATCH 12/12] remove println from tests --- azure-ipam/ipam_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index 1a58c077b5..485ee4f928 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -203,7 +203,6 @@ func TestCmdAdd(t *testing.T) { tt := tt writer := &cniResultsWriter{} t.Run(tt.name, func(t *testing.T) { - fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} testLogger, cleanup, err := logger.New(loggerCfg) if err != nil { @@ -251,7 +250,6 @@ func TestCmdDel(t *testing.T) { for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { - fmt.Printf("test : %v\n", tt.name) mockCNSClient := &MockCNSClient{} testLogger, cleanup, err := logger.New(loggerCfg) if err != nil { @@ -270,7 +268,6 @@ func TestCmdDel(t *testing.T) { } func TestCmdCheck(t *testing.T) { - fmt.Println("test : cmdCheck") mockCNSClient := &MockCNSClient{} testLogger, cleanup, err := logger.New(loggerCfg) if err != nil {