Merge pull request #8164 from cjcullen/cloudprovider

Route creation reconciler loop.
This commit is contained in:
Dawn Chen
2015-05-22 12:27:50 -07:00
23 changed files with 825 additions and 968 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package cloudprovider
import (
"errors"
"net"
"strings"
@@ -33,6 +34,8 @@ type Interface interface {
Zones() (Zones, bool)
// Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
Clusters() (Clusters, bool)
// Routes returns a routes interface along with whether the interface is supported.
Routes() (Routes, bool)
}
// Clusters is an abstract, pluggable interface for clusters of containers.
@@ -85,12 +88,34 @@ type Instances interface {
List(filter string) ([]string, error)
// GetNodeResources gets the resources for a particular node
GetNodeResources(name string) (*api.NodeResources, error)
// Configure the specified instance using the spec
Configure(name string, spec *api.NodeSpec) error
// Delete all the configuration related to the instance, including other cloud resources
Release(name string) error
}
// Route is a representation of an advanced routing rule.
type Route struct {
// Name is the name of the routing rule in the cloud-provider.
Name string
// TargetInstance is the name of the instance as specified in routing rules
// for the cloud-provider (in gce: the Instance Name).
TargetInstance string
// Destination CIDR is the CIDR format IP range that this routing rule
// applies to.
DestinationCIDR string
// Description is a free-form string. It can be useful for tagging Routes.
Description string
}
// Routes is an abstract, pluggable interface for advanced routing rules.
type Routes interface {
// List all routes that match the filter
ListRoutes(filter string) ([]*Route, error)
// Create the described route
CreateRoute(route *Route) error
// Delete the specified route
DeleteRoute(name string) error
}
var InstanceNotFound = errors.New("instance not found")
// Zone represents the location of a particular machine.
type Zone struct {
FailureDomain string