use istio client-go library instead of knative (#1661)
use istio client-go library instead of knative bump kubernetes dependency version change code coverage to codecov
This commit is contained in:
14
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/bgpconfig.go
generated
vendored
14
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/bgpconfig.go
generated
vendored
@@ -129,6 +129,20 @@ func (r bgpConfigurations) ValidateDefaultOnlyFields(res *apiv3.BGPConfiguration
|
||||
Reason: "Cannot set ASNumber on a non default BGP Configuration.",
|
||||
})
|
||||
}
|
||||
|
||||
if res.Spec.ServiceExternalIPs != nil && len(res.Spec.ServiceExternalIPs) > 0 {
|
||||
errFields = append(errFields, cerrors.ErroredField{
|
||||
Name: "BGPConfiguration.Spec.ServiceExternalIPs",
|
||||
Reason: "Cannot set ServiceExternalIPs on a non default BGP Configuration.",
|
||||
})
|
||||
}
|
||||
|
||||
if res.Spec.ServiceClusterIPs != nil && len(res.Spec.ServiceClusterIPs) > 0 {
|
||||
errFields = append(errFields, cerrors.ErroredField{
|
||||
Name: "BGPConfiguration.Spec.ServiceClusterIPs",
|
||||
Reason: "Cannot set ServiceClusterIPs on a non default BGP Configuration.",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if len(errFields) > 0 {
|
||||
|
||||
4
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/client.go
generated
vendored
4
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/client.go
generated
vendored
@@ -24,10 +24,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/satori/go.uuid"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
|
||||
"github.com/projectcalico/libcalico-go/lib/apiconfig"
|
||||
"github.com/projectcalico/libcalico-go/lib/apis/v3"
|
||||
v3 "github.com/projectcalico/libcalico-go/lib/apis/v3"
|
||||
"github.com/projectcalico/libcalico-go/lib/backend"
|
||||
bapi "github.com/projectcalico/libcalico-go/lib/backend/api"
|
||||
cerrors "github.com/projectcalico/libcalico-go/lib/errors"
|
||||
|
||||
26
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/node.go
generated
vendored
26
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/node.go
generated
vendored
@@ -115,6 +115,32 @@ func (r nodes) Delete(ctx context.Context, name string, opts options.DeleteOptio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add in tunnel addresses if they exist for the node.
|
||||
if n, err := r.client.Nodes().Get(ctx, name, options.GetOptions{}); err != nil {
|
||||
if _, ok := err.(errors.ErrorResourceDoesNotExist); !ok {
|
||||
return nil, err
|
||||
}
|
||||
// Resource does not exist, carry on and clean up as much as we can.
|
||||
} else {
|
||||
if n.Spec.BGP != nil && n.Spec.BGP.IPv4IPIPTunnelAddr != "" {
|
||||
ipAddr, _, err := cnet.ParseCIDROrIP(n.Spec.BGP.IPv4IPIPTunnelAddr)
|
||||
if err == nil {
|
||||
ips = append(ips, *ipAddr)
|
||||
} else {
|
||||
log.WithError(err).Warnf("Failed to parse IPIP tunnel address CIDR: %s", n.Spec.BGP.IPv4IPIPTunnelAddr)
|
||||
}
|
||||
}
|
||||
if n.Spec.IPv4VXLANTunnelAddr != "" {
|
||||
ipAddr, _, err := cnet.ParseCIDROrIP(n.Spec.IPv4VXLANTunnelAddr)
|
||||
if err == nil {
|
||||
ips = append(ips, *ipAddr)
|
||||
} else {
|
||||
log.WithError(err).Warnf("Failed to parse VXLAN tunnel address CIDR: %s", n.Spec.IPv4VXLANTunnelAddr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_, err = r.client.IPAM().ReleaseIPs(context.Background(), ips)
|
||||
switch err.(type) {
|
||||
case nil, errors.ErrorResourceDoesNotExist, errors.ErrorOperationNotSupported:
|
||||
|
||||
2
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/resources.go
generated
vendored
2
vendor/github.com/projectcalico/libcalico-go/lib/clientv3/resources.go
generated
vendored
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
|
||||
Reference in New Issue
Block a user