Documentation ¶
Index ¶
- Constants
- func ClusterRoleBindings(namespace string, enableClusterPermissions bool) []*rbacv1.ClusterRoleBinding
- func ConfigSyncContainer() *corev1.Container
- func Contains(elements []uint32, element uint32) bool
- func ContainsAllPolicies(elements []rbacv1.PolicyRule, included []rbacv1.PolicyRule) bool
- func GatewayDetectTypeIfPresent() (string, error)
- func GetFreePort() (port int, err error)
- func GetLocalLinkStatus(cli *VanClient, namespace string, siteNameMap map[string]string) (map[string]*types.LinkStatus, error)
- func OauthProxyContainer(serviceAccount string, servicePort string) *corev1.Container
- type AllowedBy
- type ClusterPolicyValidator
- func (p *ClusterPolicyValidator) AppliesToNS(policyName string) bool
- func (p *ClusterPolicyValidator) CrdDefined() bool
- func (p *ClusterPolicyValidator) Dump() *PolicyInfo
- func (p *ClusterPolicyValidator) Enabled() bool
- func (p *ClusterPolicyValidator) HasPermission() bool
- func (p *ClusterPolicyValidator) LoadNamespacePolicies() ([]v1alpha12.SkupperClusterPolicy, error)
- func (p *ClusterPolicyValidator) SetStaticPolicyList(policies []v1alpha12.SkupperClusterPolicy)
- func (p *ClusterPolicyValidator) ValidateExpose(resourceType, resourceName string) *PolicyValidationResult
- func (p *ClusterPolicyValidator) ValidateImportService(serviceName string) *PolicyValidationResult
- func (p *ClusterPolicyValidator) ValidateIncomingLink() *PolicyValidationResult
- func (p *ClusterPolicyValidator) ValidateOutgoingLink(hostname string) *PolicyValidationResult
- type GatewayConfig
- type GatewayInstance
- type PolicyAPIClient
- func (p *PolicyAPIClient) Expose(resourceType, resourceName string) (*PolicyAPIResult, error)
- func (p *PolicyAPIClient) IncomingLink() (*PolicyAPIResult, error)
- func (p *PolicyAPIClient) OutgoingLink(hostname string) (*PolicyAPIResult, error)
- func (p *PolicyAPIClient) Service(name string) (*PolicyAPIResult, error)
- func (p *PolicyAPIClient) Services(names ...string) (map[string]*PolicyAPIResult, error)
- type PolicyAPIResult
- type PolicyInfo
- type PolicyValidationResult
- type UnitInfo
- type VanClient
- func (cli *VanClient) ClusterRoles(enablePermissions bool) []*rbacv1.ClusterRole
- func (cli *VanClient) ConnectorCreate(ctx context.Context, secret *corev1.Secret, ...) error
- func (cli *VanClient) ConnectorCreateFromFile(ctx context.Context, secretFile string, options types.ConnectorCreateOptions) (*corev1.Secret, error)
- func (cli *VanClient) ConnectorCreateSecretFromData(ctx context.Context, options types.ConnectorCreateOptions) (*corev1.Secret, error)
- func (cli *VanClient) ConnectorInspect(ctx context.Context, name string) (*types.LinkStatus, error)
- func (cli *VanClient) ConnectorList(ctx context.Context) ([]types.LinkStatus, error)
- func (cli *VanClient) ConnectorRemove(ctx context.Context, options types.ConnectorRemoveOptions) error
- func (cli *VanClient) ConnectorTokenCreate(ctx context.Context, subject string, namespace string) (*corev1.Secret, bool, error)
- func (cli *VanClient) ConnectorTokenCreateFile(ctx context.Context, subject string, secretFile string) error
- func (cli *VanClient) ConnectorTokenCreateFromTemplate(ctx context.Context, tokenName string, templateName string) (*corev1.Secret, bool, error)
- func (cli *VanClient) GatewayBind(ctx context.Context, gatewayName string, endpoint types.GatewayEndpoint) error
- func (cli *VanClient) GatewayDownload(ctx context.Context, gatewayName string, downloadPath string) (string, error)
- func (cli *VanClient) GatewayExportConfig(ctx context.Context, targetGatewayName string, exportGatewayName string, ...) (string, error)
- func (cli *VanClient) GatewayExpose(ctx context.Context, gatewayName string, gatewayType string, ...) (string, error)
- func (cli *VanClient) GatewayForward(ctx context.Context, gatewayName string, endpoint types.GatewayEndpoint) error
- func (cli *VanClient) GatewayGenerateBundle(ctx context.Context, configFile string, bundlePath string) (string, error)
- func (cli *VanClient) GatewayInit(ctx context.Context, gatewayName string, gatewayType string, configFile string) (string, error)
- func (cli *VanClient) GatewayInspect(ctx context.Context, gatewayName string) (*types.GatewayInspectResponse, error)
- func (cli *VanClient) GatewayList(ctx context.Context) ([]*types.GatewayInspectResponse, error)
- func (cli *VanClient) GatewayRemove(ctx context.Context, gatewayName string) error
- func (cli *VanClient) GatewayUnbind(ctx context.Context, gatewayName string, endpoint types.GatewayEndpoint) error
- func (cli *VanClient) GatewayUnexpose(ctx context.Context, gatewayName string, endpoint types.GatewayEndpoint, ...) error
- func (cli *VanClient) GatewayUnforward(ctx context.Context, gatewayName string, endpoint types.GatewayEndpoint) error
- func (cli *VanClient) GetConsoleUrl(namespace string) (string, error)
- func (cli *VanClient) GetDiscoveryClient() *discovery.DiscoveryClient
- func (cli *VanClient) GetDynamicClient() dynamic.Interface
- func (cli *VanClient) GetHeadlessServiceConfiguration(targetName string, protocol string, address string, ports []int, ...) (*types.ServiceInterface, error)
- func (cli *VanClient) GetIngressDefault() string
- func (cli *VanClient) GetKubeClient() kubernetes.Interface
- func (cli *VanClient) GetNamespace() string
- func (cli *VanClient) GetRouteClient() *routev1client.RouteV1Client
- func (cli *VanClient) GetRouterHostAliasesSpecFromTokens(ctx context.Context, namespace string) ([]corev1.HostAlias, error)
- func (cli *VanClient) GetRouterSpecFromOpts(options types.SiteConfigSpec, siteId string) (*types.RouterSpec, error)
- func (cli *VanClient) GetSiteMetadata() (*qdr.SiteMetadata, error)
- func (cli *VanClient) GetVanControllerSpec(options types.SiteConfigSpec, van *types.RouterSpec, ...)
- func (cli *VanClient) GetVanPrometheusServerSpec(options types.SiteConfigSpec, van *types.RouterSpec)
- func (cli *VanClient) GetVersion(component string, name string) string
- func (cli *VanClient) NetworkStatus(ctx context.Context) (*network.NetworkStatusInfo, error)
- func (cli *VanClient) RevokeAccess(ctx context.Context) error
- func (cli *VanClient) RouterCreate(ctx context.Context, options types.SiteConfig) error
- func (cli *VanClient) RouterInspect(ctx context.Context) (*types.RouterInspectResponse, error)
- func (cli *VanClient) RouterInspectNamespace(ctx context.Context, namespace string) (*types.RouterInspectResponse, error)
- func (cli *VanClient) RouterRemove(ctx context.Context) error
- func (cli *VanClient) RouterRestart(ctx context.Context, namespace string) error
- func (cli *VanClient) RouterUpdateAnnotations(ctx context.Context, settings *corev1.ConfigMap) (bool, error)
- func (cli *VanClient) RouterUpdateHostAliases(ctx context.Context, token *corev1.Secret) (bool, error)
- func (cli *VanClient) RouterUpdateLogging(ctx context.Context, settings *corev1.ConfigMap, hup bool) (bool, error)
- func (cli *VanClient) RouterUpdateVersion(ctx context.Context, hup bool) (bool, error)
- func (cli *VanClient) RouterUpdateVersionInNamespace(ctx context.Context, hup bool, namespace string) (bool, error)
- func (cli *VanClient) ServiceInterfaceBind(ctx context.Context, service *types.ServiceInterface, targetType string, ...) error
- func (cli *VanClient) ServiceInterfaceCreate(ctx context.Context, service *types.ServiceInterface) error
- func (cli *VanClient) ServiceInterfaceInspect(ctx context.Context, address string) (*types.ServiceInterface, error)
- func (cli *VanClient) ServiceInterfaceList(ctx context.Context) ([]*types.ServiceInterface, error)
- func (cli *VanClient) ServiceInterfaceRemove(ctx context.Context, address string) error
- func (cli *VanClient) ServiceInterfaceUnbind(ctx context.Context, targetType string, targetName string, address string, ...) error
- func (cli *VanClient) ServiceInterfaceUpdate(ctx context.Context, service *types.ServiceInterface) error
- func (cli *VanClient) SiteConfigCreate(ctx context.Context, spec types.SiteConfigSpec) (*types.SiteConfig, error)
- func (cli *VanClient) SiteConfigInspect(ctx context.Context, input *corev1.ConfigMap) (*types.SiteConfig, error)
- func (cli *VanClient) SiteConfigInspectInNamespace(ctx context.Context, input *corev1.ConfigMap, namespace string) (*types.SiteConfig, error)
- func (cli *VanClient) SiteConfigRemove(ctx context.Context) error
- func (cli *VanClient) SiteConfigUpdate(ctx context.Context, config types.SiteConfigSpec) ([]string, error)
- func (cli *VanClient) SkupperCheckService(service string, verbose bool) (*bytes.Buffer, error)
- func (cli *VanClient) SkupperDump(ctx context.Context, tarName string, version string, kubeConfigPath string, ...) (string, error)
- func (cli *VanClient) SkupperEvents(verbose bool) (*bytes.Buffer, error)
- func (cli *VanClient) SkupperPolicies(verbose bool) (*bytes.Buffer, error)
- func (cli *VanClient) TokenClaimCreate(ctx context.Context, name string, password []byte, expiry time.Duration, ...) (*corev1.Secret, bool, error)
- func (cli *VanClient) TokenClaimCreateFile(ctx context.Context, name string, password []byte, expiry time.Duration, ...) error
- func (cli *VanClient) VerifySecretCompatibility(secret corev1.Secret) error
- func (cli *VanClient) VerifySiteCompatibility(siteVersion string) error
Constants ¶
const ( GatewayServiceType string = "service" GatewayDockerType string = "docker" GatewayPodmanType string = "podman" GatewayMockType string = "mock" )
const ( ValidRfc1123Label = `^(` + ValidRfc1123LabelKey + `)+=(` + ValidRfc1123LabelValue + `)+(,(` + ValidRfc1123LabelKey + `)+=(` + ValidRfc1123LabelValue + `)+)*$` ValidRfc1123LabelKey = "[a-z0-9]([-._a-z0-9]*[a-z0-9])*" ValidRfc1123LabelValue = "[a-zA-Z0-9]([-._a-zA-Z0-9]*[a-zA-Z0-9])*" DefaultSkupperExtraLabels string = "" )
Variables ¶
This section is empty.
Functions ¶
func ClusterRoleBindings ¶
func ClusterRoleBindings(namespace string, enableClusterPermissions bool) []*rbacv1.ClusterRoleBinding
func ConfigSyncContainer ¶
func ContainsAllPolicies ¶
func ContainsAllPolicies(elements []rbacv1.PolicyRule, included []rbacv1.PolicyRule) bool
func GetFreePort ¶
func GetLocalLinkStatus ¶
Types ¶
type AllowedBy ¶
func (AllowedBy) SortedKeys ¶
type ClusterPolicyValidator ¶
type ClusterPolicyValidator struct {
// contains filtered or unexported fields
}
ClusterPolicyValidator The policy validator component must be used internally by the service-controller only. Client applications must use the PolicyAPIClient (rest client).
func NewClusterPolicyValidator ¶
func NewClusterPolicyValidator(cli *VanClient) *ClusterPolicyValidator
func (*ClusterPolicyValidator) AppliesToNS ¶
func (p *ClusterPolicyValidator) AppliesToNS(policyName string) bool
func (*ClusterPolicyValidator) CrdDefined ¶
func (p *ClusterPolicyValidator) CrdDefined() bool
func (*ClusterPolicyValidator) Dump ¶
func (p *ClusterPolicyValidator) Dump() *PolicyInfo
func (*ClusterPolicyValidator) Enabled ¶
func (p *ClusterPolicyValidator) Enabled() bool
func (*ClusterPolicyValidator) HasPermission ¶
func (p *ClusterPolicyValidator) HasPermission() bool
func (*ClusterPolicyValidator) LoadNamespacePolicies ¶
func (p *ClusterPolicyValidator) LoadNamespacePolicies() ([]v1alpha12.SkupperClusterPolicy, error)
func (*ClusterPolicyValidator) SetStaticPolicyList ¶
func (p *ClusterPolicyValidator) SetStaticPolicyList(policies []v1alpha12.SkupperClusterPolicy)
func (*ClusterPolicyValidator) ValidateExpose ¶
func (p *ClusterPolicyValidator) ValidateExpose(resourceType, resourceName string) *PolicyValidationResult
func (*ClusterPolicyValidator) ValidateImportService ¶
func (p *ClusterPolicyValidator) ValidateImportService(serviceName string) *PolicyValidationResult
func (*ClusterPolicyValidator) ValidateIncomingLink ¶
func (p *ClusterPolicyValidator) ValidateIncomingLink() *PolicyValidationResult
func (*ClusterPolicyValidator) ValidateOutgoingLink ¶
func (p *ClusterPolicyValidator) ValidateOutgoingLink(hostname string) *PolicyValidationResult
type GatewayConfig ¶
type GatewayConfig struct { GatewayName string `yaml:"name,omitempty"` QdrListeners []qdr.Listener `yaml:"qdr-listeners,omitempty"` Bindings []types.GatewayEndpoint `yaml:"bindings,omitempty"` Forwards []types.GatewayEndpoint `yaml:"forwards,omitempty"` }
type GatewayInstance ¶
type PolicyAPIClient ¶
type PolicyAPIClient struct {
// contains filtered or unexported fields
}
func NewPolicyValidatorAPI ¶
func NewPolicyValidatorAPI(cli *VanClient) *PolicyAPIClient
func (*PolicyAPIClient) Expose ¶
func (p *PolicyAPIClient) Expose(resourceType, resourceName string) (*PolicyAPIResult, error)
func (*PolicyAPIClient) IncomingLink ¶
func (p *PolicyAPIClient) IncomingLink() (*PolicyAPIResult, error)
func (*PolicyAPIClient) OutgoingLink ¶
func (p *PolicyAPIClient) OutgoingLink(hostname string) (*PolicyAPIResult, error)
func (*PolicyAPIClient) Service ¶
func (p *PolicyAPIClient) Service(name string) (*PolicyAPIResult, error)
func (*PolicyAPIClient) Services ¶
func (p *PolicyAPIClient) Services(names ...string) (map[string]*PolicyAPIResult, error)
type PolicyAPIResult ¶
type PolicyAPIResult struct { Allowed bool `json:"allowed"` AllowedBy []string `json:"allowedBy"` Enabled bool `json:"enabled"` Error string `json:"error"` }
func (*PolicyAPIResult) Err ¶
func (p *PolicyAPIResult) Err() error
type PolicyInfo ¶
type PolicyInfo struct { AllowIncomingLinks AllowedBy `json:"allowIncomingLinks"` AllowedOutgoingLinksHostnames AllowedBy `json:"allowedOutgoingLinksHostnames"` AllowedExposedResources AllowedBy `json:"allowedExposedResources"` AllowedServices AllowedBy `json:"allowedServices"` }
func (*PolicyInfo) String ¶
func (p *PolicyInfo) String() string
type PolicyValidationResult ¶
type PolicyValidationResult struct {
// contains filtered or unexported fields
}
func (*PolicyValidationResult) AllowPolicies ¶
func (p *PolicyValidationResult) AllowPolicies() []v1alpha12.SkupperClusterPolicy
func (*PolicyValidationResult) AllowPolicyNames ¶
func (p *PolicyValidationResult) AllowPolicyNames() []string
func (*PolicyValidationResult) Allowed ¶
func (p *PolicyValidationResult) Allowed() bool
func (*PolicyValidationResult) Enabled ¶
func (p *PolicyValidationResult) Enabled() bool
func (*PolicyValidationResult) Error ¶
func (p *PolicyValidationResult) Error() error
type VanClient ¶
type VanClient struct { Namespace string KubeClient kubernetes.Interface RouteClient *routev1client.RouteV1Client OCAppsClient openshiftapps.Interface RestConfig *restclient.Config DynamicClient dynamic.Interface DiscoveryClient *discovery.DiscoveryClient LinkHandler domain.LinkHandler }
A VAN Client manages orchestration and communications with the network components
func (*VanClient) ClusterRoles ¶
func (cli *VanClient) ClusterRoles(enablePermissions bool) []*rbacv1.ClusterRole
func (*VanClient) ConnectorCreate ¶
func (*VanClient) ConnectorCreateFromFile ¶
func (*VanClient) ConnectorCreateSecretFromData ¶
func (*VanClient) ConnectorInspect ¶
ConnectorInspect VAN connector instance
func (*VanClient) ConnectorList ¶
func (*VanClient) ConnectorRemove ¶
func (*VanClient) ConnectorTokenCreate ¶
func (*VanClient) ConnectorTokenCreateFile ¶
func (*VanClient) ConnectorTokenCreateFromTemplate ¶
func (*VanClient) GatewayBind ¶
func (*VanClient) GatewayDownload ¶
func (*VanClient) GatewayExportConfig ¶
func (*VanClient) GatewayExpose ¶
func (*VanClient) GatewayForward ¶
func (*VanClient) GatewayGenerateBundle ¶
func (*VanClient) GatewayInit ¶
func (*VanClient) GatewayInspect ¶
func (*VanClient) GatewayList ¶
func (*VanClient) GatewayRemove ¶
func (*VanClient) GatewayUnbind ¶
func (*VanClient) GatewayUnexpose ¶
func (*VanClient) GatewayUnforward ¶
func (*VanClient) GetConsoleUrl ¶
func (*VanClient) GetDiscoveryClient ¶
func (cli *VanClient) GetDiscoveryClient() *discovery.DiscoveryClient
func (*VanClient) GetDynamicClient ¶
func (*VanClient) GetHeadlessServiceConfiguration ¶
func (*VanClient) GetIngressDefault ¶
func (*VanClient) GetKubeClient ¶
func (cli *VanClient) GetKubeClient() kubernetes.Interface
func (*VanClient) GetNamespace ¶
func (*VanClient) GetRouteClient ¶
func (cli *VanClient) GetRouteClient() *routev1client.RouteV1Client
func (*VanClient) GetRouterHostAliasesSpecFromTokens ¶
func (*VanClient) GetRouterSpecFromOpts ¶
func (cli *VanClient) GetRouterSpecFromOpts(options types.SiteConfigSpec, siteId string) (*types.RouterSpec, error)
func (*VanClient) GetSiteMetadata ¶
func (cli *VanClient) GetSiteMetadata() (*qdr.SiteMetadata, error)
func (*VanClient) GetVanControllerSpec ¶
func (cli *VanClient) GetVanControllerSpec(options types.SiteConfigSpec, van *types.RouterSpec, transport *appsv1.Deployment, siteId string)
func (*VanClient) GetVanPrometheusServerSpec ¶
func (cli *VanClient) GetVanPrometheusServerSpec(options types.SiteConfigSpec, van *types.RouterSpec)
func (*VanClient) GetVersion ¶
func (*VanClient) NetworkStatus ¶
func (*VanClient) RouterCreate ¶
RouterCreate instantiates a VAN (router and controller) deployment
func (*VanClient) RouterInspect ¶
func (*VanClient) RouterInspectNamespace ¶
func (cli *VanClient) RouterInspectNamespace(ctx context.Context, namespace string) (*types.RouterInspectResponse, error)
RouterInspect VAN deployment
func (*VanClient) RouterRemove ¶
RouterRemove delete a VAN (router and controller) deployment
func (*VanClient) RouterRestart ¶
func (*VanClient) RouterUpdateAnnotations ¶
func (*VanClient) RouterUpdateHostAliases ¶
func (*VanClient) RouterUpdateLogging ¶
func (*VanClient) RouterUpdateVersion ¶
func (*VanClient) RouterUpdateVersionInNamespace ¶
func (*VanClient) ServiceInterfaceBind ¶
func (*VanClient) ServiceInterfaceCreate ¶
func (*VanClient) ServiceInterfaceInspect ¶
func (*VanClient) ServiceInterfaceList ¶
func (*VanClient) ServiceInterfaceRemove ¶
func (*VanClient) ServiceInterfaceUnbind ¶
func (*VanClient) ServiceInterfaceUpdate ¶
func (*VanClient) SiteConfigCreate ¶
func (cli *VanClient) SiteConfigCreate(ctx context.Context, spec types.SiteConfigSpec) (*types.SiteConfig, error)
func (*VanClient) SiteConfigInspect ¶
func (*VanClient) SiteConfigInspectInNamespace ¶
func (*VanClient) SiteConfigRemove ¶
func (*VanClient) SiteConfigUpdate ¶
func (*VanClient) SkupperCheckService ¶
func (*VanClient) SkupperDump ¶
func (*VanClient) SkupperEvents ¶
func (*VanClient) SkupperPolicies ¶
func (*VanClient) TokenClaimCreate ¶
func (*VanClient) TokenClaimCreateFile ¶
func (*VanClient) VerifySecretCompatibility ¶
VerifySecretCompatibility returns nil if current site version is compatible with the token or cert provided. If sites are not compatible an error is returned with the appropriate information
func (*VanClient) VerifySiteCompatibility ¶
VerifySiteCompatibility returns nil if current site version is compatible with the provided version, otherwise it returns a clear error.
Source Files ¶
- client.go
- client_debug.go
- connector_create.go
- connector_inspect.go
- connector_list.go
- connector_remove.go
- connector_token_create.go
- gateway.go
- labels.go
- network_status.go
- policy_validator.go
- revoke_all.go
- router_create.go
- router_inspect.go
- router_remove.go
- router_update.go
- serviceinterface_create.go
- serviceinterface_inspect.go
- serviceinterface_list.go
- serviceinterface_remove.go
- serviceinterface_update.go
- site_config_create.go
- site_config_inspect.go
- site_config_remove.go
- site_config_update.go
- token_claim_create.go
- utils.go