Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRoute ¶
func ParseRoute(route string) (*istiov1alpha1.Route, error)
ParseRoute maps string route representation into a Route struct by unwrapping its type, name and value.
Types ¶
type Client ¶ added in v0.0.4
Client interacts with the k8s api server.
func DefaultClient ¶
DefaultClient creates a client based on existing kube config. The instance is created lazily only once and shared among all the callers While resolving configuration we look for .kube/config file unless KUBECONFIG env variable is set If namespace parameter is empty default one from the current context is used.
func (*Client) Create ¶ added in v0.0.4
func (c *Client) Create(session *istiov1alpha1.Session) error
Create creates a session instance in a cluster.
func (*Client) Delete ¶ added in v0.0.4
func (c *Client) Delete(session *istiov1alpha1.Session) error
Delete deletes a session instance in a cluster.
type DeploymentNotFoundError ¶ added in v0.0.3
type DeploymentNotFoundError struct {
// contains filtered or unexported fields
}
DeploymentNotFoundError denotes failing to find deployment.
func (DeploymentNotFoundError) Error ¶ added in v0.0.3
func (dnfe DeploymentNotFoundError) Error() string
Error returns the formatted deployment error.
type Handler ¶
Handler is a function to setup a server session before attempting to connect. Returns a 'cleanup' function.
type Options ¶
type Options struct { NamespaceName string // name of the namespace for target resource DeploymentName string // name of the initial resource to target SessionName string // name of the session create or join if exist RouteExp string // expression of how to route the traffic to the target resource Strategy string // name of the strategy to use for the target resource StrategyArgs map[string]string // additional arguments for the strategy Revert bool // Revert back to previous known value if join/leave a existing session with a known ref Duration *time.Duration // Duration defines the interval used to check for changes to the session object }
Options holds the variables used by the Session Handler.
type State ¶
type State struct { DeploymentName string // name of the resource to target within the cloned route. Hosts []string // currently exposed hosts Route istiov1alpha1.Route // the current route configuration }
State holds the new variables as presented by the creation of the session.
func CreateOrJoinHandler ¶
CreateOrJoinHandler provides the option to either create a new session if non exist or join an existing. Rely on the following flags:
- namespace - the name of the target namespace where deployment is defined
- deployment - the name of the target deployment and will update the flag with the new deployment name
- session - the name of the session
- route - the definition of traffic routing.
func RemoveHandler ¶
RemoveHandler provides the option to delete an existing sessions if found. Rely on the following flags:
- namespace - the name of the target namespace where deployment is defined
- session - the name of the session.