Documentation
¶
Index ¶
- Constants
- Variables
- func NewCredentialResolver(coreClient client.Reader, resolverChain []Resolver) repository.CredentialResolver
- func NewReferenceResolver(coreClient client.Reader) repository.ReferenceResolver
- func ParseRepositoryName(name string) (string, error)
- func RunBackground(ctx context.Context, coreClient client.WithWatch, cache cachetypes.Cache, ...)
- type ApiserverUserInfoProvider
- type BackgroundOption
- type BasicAuthCredential
- type BasicAuthResolver
- type BearerTokenAuthCredentials
- type BearerTokenAuthResolver
- type CaBundleCredential
- type CaBundleResolver
- type CircuitBreakerError
- type GcloudWICredential
- type GcloudWIResolver
- type NoMatchingResolverError
- type NoopUpdateStrategy
- type RESTStorageOptions
- type Resolver
- type SimpleRESTCreateStrategy
- type SimpleRESTUpdateStrategy
Constants ¶
View Source
const ( // Values for secret types supported by porch. BasicAuthType = core.SecretTypeBasicAuth WorkloadIdentityAuthType = "kpt.dev/workload-identity-auth" // Annotation used to specify the gsa for a ksa. WIGCPSAAnnotation = "iam.gke.io/gcp-service-account" // Secret.Data key required for the caBundle CaBundleDataName = "ca.crt" // Secret.Data key required for bearer token authentication TokenDataName = "bearerToken" )
View Source
const ConflictErrorMsgBase = "another request is already in progress %s"
Variables ¶
View Source
var GenericConflictErrorMsg = fmt.Sprintf(ConflictErrorMsgBase, "on %s \"%s\"")
View Source
var ( PrFilterFieldMappings = map[porchapi.PkgRevFieldSelector]prFilterFieldMappingFunc{ porchapi.PkgRevSelectorName: func(f *repository.ListPackageRevisionFilter, name string) error { var err error if filterKey, err := repository.PkgRevK8sName2Key("", name); err == nil { f.Key = filterKey } return err }, porchapi.PkgRevSelectorNamespace: func(f *repository.ListPackageRevisionFilter, namespace string) error { f.Key.PkgKey.RepoKey.Namespace = namespace return nil }, porchapi.PkgRevSelectorRevision: func(f *repository.ListPackageRevisionFilter, strRevision string) error { f.Key.Revision = repository.Revision2Int(strRevision) return nil }, porchapi.PkgRevSelectorPackageName: func(f *repository.ListPackageRevisionFilter, fullPkgName string) error { split := strings.Split(fullPkgName, "/") if len(split) > 1 { f.Key.PkgKey.Package = split[len(split)-1] f.Key.PkgKey.Path = strings.Join(split[0:len(split)-1], "/") } else { f.Key.PkgKey.Package = fullPkgName } return nil }, porchapi.PkgRevSelectorRepository: func(f *repository.ListPackageRevisionFilter, repoName string) error { f.Key.PkgKey.RepoKey.Name = repoName return nil }, porchapi.PkgRevSelectorWorkspaceName: func(f *repository.ListPackageRevisionFilter, workspaceName string) error { f.Key.WorkspaceName = workspaceName return nil }, porchapi.PkgRevSelectorLifecycle: func(f *repository.ListPackageRevisionFilter, lifecycle string) error { var err error l := porchapi.PackageRevisionLifecycle(lifecycle) if l.IsValid() { f.Lifecycles = append(f.Lifecycles, l) } else { err = apierrors.NewBadRequest(fmt.Sprintf("unsupported fieldSelector value %q for field %q", lifecycle, porchapi.PkgRevSelectorLifecycle)) } return err }, } )
Functions ¶
func NewCredentialResolver ¶
func NewCredentialResolver(coreClient client.Reader, resolverChain []Resolver) repository.CredentialResolver
func NewReferenceResolver ¶
func NewReferenceResolver(coreClient client.Reader) repository.ReferenceResolver
func ParseRepositoryName ¶
func RunBackground ¶
func RunBackground(ctx context.Context, coreClient client.WithWatch, cache cachetypes.Cache, options ...BackgroundOption)
Types ¶
type ApiserverUserInfoProvider ¶
type ApiserverUserInfoProvider struct{}
func (*ApiserverUserInfoProvider) GetUserInfo ¶
func (p *ApiserverUserInfoProvider) GetUserInfo(ctx context.Context) *repository.UserInfo
type BackgroundOption ¶
type BackgroundOption interface {
// contains filtered or unexported methods
}
func WithListTimeoutPerRepo ¶
func WithListTimeoutPerRepo(timeout time.Duration) BackgroundOption
func WithMaxConcurrentLists ¶
func WithMaxConcurrentLists(maxList int) BackgroundOption
func WithPeriodicRepoSyncFrequency ¶
func WithPeriodicRepoSyncFrequency(period time.Duration) BackgroundOption
func WithRepoOperationRetryAttempts ¶
func WithRepoOperationRetryAttempts(count int) BackgroundOption
type BasicAuthCredential ¶
func (*BasicAuthCredential) ToAuthMethod ¶
func (b *BasicAuthCredential) ToAuthMethod() transport.AuthMethod
func (*BasicAuthCredential) ToString ¶
func (b *BasicAuthCredential) ToString() string
func (*BasicAuthCredential) Valid ¶
func (b *BasicAuthCredential) Valid() bool
type BasicAuthResolver ¶
type BasicAuthResolver struct{}
func (*BasicAuthResolver) Resolve ¶
func (b *BasicAuthResolver) Resolve(_ context.Context, secret core.Secret) (repository.Credential, bool, error)
type BearerTokenAuthCredentials ¶
type BearerTokenAuthCredentials struct {
BearerToken string // #nosec G117
}
func (*BearerTokenAuthCredentials) ToAuthMethod ¶
func (b *BearerTokenAuthCredentials) ToAuthMethod() transport.AuthMethod
func (*BearerTokenAuthCredentials) ToString ¶
func (b *BearerTokenAuthCredentials) ToString() string
func (*BearerTokenAuthCredentials) Valid ¶
func (b *BearerTokenAuthCredentials) Valid() bool
type BearerTokenAuthResolver ¶
type BearerTokenAuthResolver struct{}
func (*BearerTokenAuthResolver) Resolve ¶
func (b *BearerTokenAuthResolver) Resolve(_ context.Context, secret core.Secret) (repository.Credential, bool, error)
type CaBundleCredential ¶
type CaBundleCredential struct {
CaBundle string
}
func (*CaBundleCredential) ToAuthMethod ¶
func (c *CaBundleCredential) ToAuthMethod() transport.AuthMethod
func (*CaBundleCredential) ToString ¶
func (c *CaBundleCredential) ToString() string
func (*CaBundleCredential) Valid ¶
func (c *CaBundleCredential) Valid() bool
type CaBundleResolver ¶
type CaBundleResolver struct{}
func (*CaBundleResolver) Resolve ¶
func (c *CaBundleResolver) Resolve(_ context.Context, secret core.Secret) (repository.Credential, bool, error)
type CircuitBreakerError ¶
type CircuitBreakerError struct {
Err error
}
func (*CircuitBreakerError) Error ¶
func (cbe *CircuitBreakerError) Error() string
func (*CircuitBreakerError) Unwrap ¶
func (cbe *CircuitBreakerError) Unwrap() error
type GcloudWICredential ¶
type GcloudWICredential struct {
// contains filtered or unexported fields
}
func (*GcloudWICredential) ToAuthMethod ¶
func (b *GcloudWICredential) ToAuthMethod() transport.AuthMethod
func (*GcloudWICredential) ToString ¶
func (b *GcloudWICredential) ToString() string
func (*GcloudWICredential) Valid ¶
func (b *GcloudWICredential) Valid() bool
type GcloudWIResolver ¶
type GcloudWIResolver struct {
// contains filtered or unexported fields
}
func (*GcloudWIResolver) Resolve ¶
func (g *GcloudWIResolver) Resolve(ctx context.Context, secret core.Secret) (repository.Credential, bool, error)
type NoMatchingResolverError ¶
type NoMatchingResolverError struct {
Type string
}
func (*NoMatchingResolverError) Error ¶
func (e *NoMatchingResolverError) Error() string
func (*NoMatchingResolverError) Is ¶
func (e *NoMatchingResolverError) Is(err error) bool
type NoopUpdateStrategy ¶
type NoopUpdateStrategy struct{}
func (NoopUpdateStrategy) Canonicalize ¶
func (s NoopUpdateStrategy) Canonicalize(obj runtime.Object)
func (NoopUpdateStrategy) PrepareForUpdate ¶
func (s NoopUpdateStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
func (NoopUpdateStrategy) ValidateUpdate ¶
type RESTStorageOptions ¶
type RESTStorageOptions struct {
Scheme *runtime.Scheme
Codecs serializer.CodecFactory
CaD engine.CaDEngine
CoreClient client.WithWatch
}
func (*RESTStorageOptions) NewRESTStorage ¶
func (r *RESTStorageOptions) NewRESTStorage() (genericapiserver.APIGroupInfo, error)
type Resolver ¶
type Resolver interface {
Resolve(ctx context.Context, secret core.Secret) (repository.Credential, bool, error)
}
func NewBasicAuthResolver ¶
func NewBasicAuthResolver() Resolver
func NewBearerTokenAuthResolver ¶
func NewBearerTokenAuthResolver() Resolver
Bearer Token Secret Verification
func NewCaBundleResolver ¶
func NewCaBundleResolver() Resolver
func NewGcloudWIResolver ¶
func NewGcloudWIResolver(corev1Client *corev1client.CoreV1Client, stsClient *stsv1.Service) Resolver
type SimpleRESTCreateStrategy ¶
type SimpleRESTCreateStrategy interface {
// Validate returns an ErrorList with validation errors or nil. Validate
// is invoked after default fields in the object have been filled in
// before the object is persisted. This method should not mutate the
// object.
Validate(ctx context.Context, obj runtime.Object) field.ErrorList
}
SimpleRESTCreateStrategy is similar to rest.RESTCreateStrategy, though only contains methods currently required.
type SimpleRESTUpdateStrategy ¶
type SimpleRESTUpdateStrategy interface {
PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList
Canonicalize(obj runtime.Object)
}
SimpleRESTUpdateStrategy is similar to rest.RESTUpdateStrategy, though only contains methods currently required.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.