utils

package
v0.27.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompilePolicy

func CompilePolicy(path string) (*circuitfactory.Circuit, error)

CompilePolicy compiles the policy and returns the circuit.

func FetchPolicyFromCR

func FetchPolicyFromCR(crPath string) (string, error)

FetchPolicyFromCR extracts the spec key from a CR and saves it to a temp file.

func GenerateDotFile

func GenerateDotFile(circuit *circuitfactory.Circuit, dotFilePath string) error

GenerateDotFile generates a DOT file from the circuit.

func GenerateMermaidFile

func GenerateMermaidFile(circuit *circuitfactory.Circuit, mermaidFile string) error

GenerateMermaidFile generates a mermaid file from the circuit.

func GetKubeConfig added in v0.23.0

func GetKubeConfig(kubeConfig string) (*rest.Config, error)

GetKubeConfig prepares Kubernetes config to connect with the cluster using provided or default kube config file location.

func ResolveLatestVersion added in v0.23.0

func ResolveLatestVersion() (string, error)

ResolveLatestVersion returns the latest release version of Aperture.

func ValidateWithJSONSchema added in v0.24.0

func ValidateWithJSONSchema(rootSchema string, schemas []string, documentFile string) error

ValidateWithJSONSchema validates the given document (YAML) against the given JSON schema.

Types

type ControllerConn added in v0.25.0

type ControllerConn struct {
	// contains filtered or unexported fields
}

ControllerConn manages flags for connecting to controller – either via address or kubeconfig.

func (*ControllerConn) Client added in v0.25.0

func (c *ControllerConn) Client() (cmdv1.ControllerClient, error)

Client returns Controller Client, connecting to controller if not yet connected.

func (*ControllerConn) InitFlags added in v0.25.0

func (c *ControllerConn) InitFlags(flags *flag.FlagSet)

InitFlags sets up flags for kubeRestConfig.

func (*ControllerConn) PostRun added in v0.25.0

func (c *ControllerConn) PostRun(_ *cobra.Command, _ []string)

PostRun cleans up ControllerConn's resources, and should be run at PostRun stage.

func (*ControllerConn) PreRunE added in v0.25.0

func (c *ControllerConn) PreRunE(_ *cobra.Command, _ []string) error

PreRunE verifies flags (optionally loading kubeconfig) and should be run at PreRunE stage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL