clients

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoInstallation is the error given when querying an Installation resource that does not exist.
	ErrNoInstallation = errors.New("no installation")

	// ErrNoInstallationCRD is the error given when the Installation CRD does not exist in the cluster.
	ErrNoInstallationCRD = errors.New("no installation CRD")
)

Functions

This section is empty.

Types

type AllIssuers

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

AllIssuers is a special client to wrap logic for determining the kinds of issuers present in a cluster

func NewAllIssuers

func NewAllIssuers(config *rest.Config) (*AllIssuers, error)

NewAllIssuers returns a new instance of and AllIssuers client.

func (*AllIssuers) ListKinds

func (a *AllIssuers) ListKinds(ctx context.Context) ([]AnyIssuer, error)

type AnyIssuer

type AnyIssuer int64

AnyIssuer is an enum of all known issuer types, external and built-in.

const (
	CertManagerIssuer AnyIssuer = iota
	CertManagerClusterIssuer
	VenafiEnhancedIssuer
	VenafiEnhancedClusterIssuer
	AWSPCAIssuer
	AWSPCAClusterIssuer
	KMSIssuer
	GoogleCASIssuer
	GoogleCASClusterIssuer
	OriginCAIssuer
	SmallStepIssuer
	SmallStepClusterIssuer
)

func (AnyIssuer) String

func (s AnyIssuer) String() string

type ComponentStatus

type ComponentStatus struct {
	Name    string `json:"name"`
	Ready   bool   `json:"ready"`
	Message string `json:"message,omitempty"`
}

ComponentStatus describes the status of an individual operator component.

type FakeGeneric added in v0.1.17

type FakeGeneric[T, ListT runtime.Object] struct {
	FakeGet     func(context.Context, *GenericRequestOptions, T) error
	FakeList    func(context.Context, *GenericRequestOptions, ListT) error
	FakePresent func(context.Context, *GenericRequestOptions) (bool, error)
	FakePatch   func(context.Context, *GenericRequestOptions, []byte) error
}

func (*FakeGeneric[T, ListT]) Get added in v0.1.17

func (f *FakeGeneric[T, ListT]) Get(ctx context.Context, options *GenericRequestOptions, result T) error

func (*FakeGeneric[T, ListT]) List added in v0.1.17

func (f *FakeGeneric[T, ListT]) List(ctx context.Context, options *GenericRequestOptions, result ListT) error

func (*FakeGeneric[T, ListT]) Patch added in v0.1.17

func (f *FakeGeneric[T, ListT]) Patch(ctx context.Context, options *GenericRequestOptions, patch []byte) error

func (*FakeGeneric[T, ListT]) Present added in v0.1.17

func (f *FakeGeneric[T, ListT]) Present(ctx context.Context, options *GenericRequestOptions) (bool, error)

type Generic

type Generic[T, ListT runtime.Object] interface {
	Get(context.Context, *GenericRequestOptions, T) error
	List(context.Context, *GenericRequestOptions, ListT) error
	Present(ctx context.Context, options *GenericRequestOptions) (bool, error)
	Patch(ctx context.Context, options *GenericRequestOptions, patch []byte) error
}

func NewAWSPCAClusterIssuerClient

NewAWSPCAClusterIssuerClient returns an instance of a generic client for querying AWS PCA cluster Issuers

func NewAWSPCAIssuerClient

NewAWSPCAIssuerClient returns an instance of a generic client for querying AWS PCA Issuers

func NewCRDClient

NewCRDClient returns an instance of a generic client for querying CRDs

func NewCertManagerClusterIssuerClient

func NewCertManagerClusterIssuerClient(config *rest.Config) (Generic[*cmapi.ClusterIssuer, *cmapi.ClusterIssuerList], error)

NewCertManagerClusterIssuerClient returns an instance of a generic client for querying cert-manager ClusterIssuers

func NewCertManagerIssuerClient

func NewCertManagerIssuerClient(config *rest.Config) (Generic[*cmapi.Issuer, *cmapi.IssuerList], error)

NewCertManagerIssuerClient returns an instance of a generic client for querying cert-manager Issuers

func NewCertificateClient added in v0.1.16

func NewCertificateClient(config *rest.Config) (Generic[*cmapi.Certificate, *cmapi.CertificateList], error)

NewCertificateClient returns an instance of a generic client for querying cert-manager Certificates

func NewCertificateRequestClient added in v0.1.17

func NewCertificateRequestClient(config *rest.Config) (Generic[*cmapi.CertificateRequest, *cmapi.CertificateRequestList], error)

NewCertificateRequestClient returns an instance of a generic client for querying cert-manager CertificateRequests

func NewCertificateRequestPolicyClient added in v0.1.16

NewCertificateRequestPolicyClient returns an instance of a generic client for querying approver policy CertificateRequestPolicies

func NewGenericClient

func NewGenericClient[T, ListT runtime.Object](opts *GenericClientOptions) (Generic[T, ListT], error)

NewGenericClient returns a new instance of a Generic client configured to query the specified resource. Use type parameters for types and list types for the desired result types and gvk function parameters to specify the group, version, and kind of the resource to query.

func NewGoogleCASClusterIssuerClient

NewGoogleCASClusterIssuerClient returns an instance of a generic client for querying google CAS cluster Issuers

func NewGoogleCASIssuerClient

NewGoogleCASIssuerClient returns an instance of a generic client for querying google CAS Issuers

func NewKMSIssuerClient

NewKMSIssuerClient returns an instance of a generic client for querying KMS Issuers

func NewOriginCAIssuerClient

NewOriginCAIssuerClient returns an instance of a generic client for querying Origin CA Issuers

func NewSmallStepClusterIssuerClient

NewSmallStepClusterIssuerClient returns an instance of a generic client for querying Step Cluster Issuers

func NewSmallStepIssuerClient

func NewSmallStepIssuerClient(config *rest.Config) (Generic[*stepissuerv1beta1.StepIssuer, *stepissuerv1beta1.StepIssuerList], error)

NewSmallStepIssuerClient returns an instance of a generic client for querying Step Issuers

func NewVenafiEnhancedClusterIssuerClient

func NewVenafiEnhancedClusterIssuerClient(config *rest.Config) (Generic[*veiv1alpha1.VenafiClusterIssuer, *veiv1alpha1.VenafiClusterIssuerList], error)

NewVenafiEnhancedClusterIssuerClient returns an instance of a generic client for querying Venafi enhanced cluster issuers

func NewVenafiEnhancedIssuerClient

func NewVenafiEnhancedIssuerClient(config *rest.Config) (Generic[*veiv1alpha1.VenafiIssuer, *veiv1alpha1.VenafiIssuerList], error)

NewVenafiEnhancedIssuerClient returns an instance of a generic client for querying Venafi enhanced issuers

type GenericClientOptions

type GenericClientOptions struct {
	RestConfig *rest.Config
	APIPath    string
	Group      string
	Version    string
	Kind       string
}

GenericClientOptions wrap the options for a Generic client initialization

type GenericRequestOptions

type GenericRequestOptions struct {
	// Name is the name of the resource to fetch. Set only when fetching a single
	// resource.
	Name string
	// Namespace is the name of the namespace to fetch resources from. Set only
	// when fetching resources in a single namespace and namespaced resources.
	Namespace string

	// DropFields is a list of fields to drop from the response
	DropFields []string
}

GenericRequestOptions wrap data used to form requests

type InstallationClient

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

The InstallationClient is used to query information on an Installation resource within a Kubernetes cluster.

func NewInstallationClient

func NewInstallationClient(config *rest.Config) (*InstallationClient, error)

NewInstallationClient returns a new instance of the InstallationClient that will interact with the Kubernetes cluster specified in the rest.Config.

func (*InstallationClient) Status

Status returns a slice of ComponentStatus types that describe the state of individual components installed by the operator. Returns ErrNoInstallation if an Installation resource cannot be found in the cluster. It uses the status conditions on an Installation resource and maps those to a ComponentStatus, the ComponentStatus.Name field is chosen based on the content of the componentNames map. Add friendly names to that map to include additional component statuses to return.

type SupportedIssuer added in v0.1.16

type SupportedIssuer struct {
	CRDName  string
	Versions []string
}

type SupportedIssuerList added in v0.1.16

type SupportedIssuerList []SupportedIssuer

func ListSupportedIssuers added in v0.1.16

func ListSupportedIssuers() (SupportedIssuerList, error)

ListSupportedIssuers returns a static list of all supported issuer types and versions. It checks each items in the AllIssuers list is mapped and errors if there are missing Issuers. This is caught in a test to help us keep this up to date.

func (SupportedIssuerList) String added in v0.1.16

func (s SupportedIssuerList) String() string

Jump to

Keyboard shortcuts

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