Documentation ¶
Index ¶
- Constants
- type ArchiveFileFilter
- type BucketProvider
- type BucketReconciler
- type BucketReconcilerOptions
- type GitRepositoryReconciler
- func (r *GitRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error)
- func (r *GitRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *GitRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts GitRepositoryReconcilerOptions) error
- type GitRepositoryReconcilerOptions
- type HelmChartReconciler
- type HelmChartReconcilerOptions
- type HelmRepositoryOCIReconciler
- func (r *HelmRepositoryOCIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error)
- func (r *HelmRepositoryOCIReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *HelmRepositoryOCIReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts HelmRepositoryReconcilerOptions) error
- type HelmRepositoryReconciler
- func (r *HelmRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error)
- func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *HelmRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts HelmRepositoryReconcilerOptions) error
- type HelmRepositoryReconcilerOptions
- type OCIRepositoryReconciler
- func (r *OCIRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error)
- func (r *OCIRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *OCIRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts OCIRepositoryReconcilerOptions) error
- type OCIRepositoryReconcilerOptions
- type RegistryClientGeneratorFunc
- type SourceRevisionChangePredicate
- type Storage
- func (s *Storage) Archive(artifact *sourcev1.Artifact, dir string, filter ArchiveFileFilter) (err error)
- func (s *Storage) ArtifactExist(artifact sourcev1.Artifact) bool
- func (s *Storage) AtomicWriteFile(artifact *sourcev1.Artifact, reader io.Reader, mode os.FileMode) (err error)
- func (s *Storage) Checksum(reader io.Reader) string
- func (s *Storage) Copy(artifact *sourcev1.Artifact, reader io.Reader) (err error)
- func (s *Storage) CopyFromPath(artifact *sourcev1.Artifact, path string) (err error)
- func (s *Storage) CopyToPath(artifact *sourcev1.Artifact, subPath, toPath string) error
- func (s *Storage) GarbageCollect(ctx context.Context, artifact sourcev1.Artifact, timeout time.Duration) ([]string, error)
- func (s *Storage) LocalPath(artifact sourcev1.Artifact) string
- func (s *Storage) Lock(artifact sourcev1.Artifact) (unlock func(), err error)
- func (s *Storage) MkdirAll(artifact sourcev1.Artifact) error
- func (s *Storage) NewArtifactFor(kind string, metadata metav1.Object, revision, fileName string) sourcev1.Artifact
- func (s *Storage) RemoveAll(artifact sourcev1.Artifact) (string, error)
- func (s *Storage) RemoveAllButCurrent(artifact sourcev1.Artifact) ([]string, error)
- func (s Storage) SetArtifactURL(artifact *sourcev1.Artifact)
- func (s Storage) SetHostname(URL string) string
- func (s *Storage) Symlink(artifact sourcev1.Artifact, linkName string) (string, error)
Constants ¶
const GarbageCountLimit = 1000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveFileFilter ¶ added in v0.12.0
ArchiveFileFilter must return true if a file should not be included in the archive after inspecting the given path and/or os.FileInfo.
func SourceIgnoreFilter ¶ added in v0.12.0
func SourceIgnoreFilter(ps []gitignore.Pattern, domain []string) ArchiveFileFilter
SourceIgnoreFilter returns an ArchiveFileFilter that filters out files matching sourceignore.VCSPatterns and any of the provided patterns. If an empty gitignore.Pattern slice is given, the matcher is set to sourceignore.NewDefaultMatcher.
type BucketProvider ¶ added in v0.22.0
type BucketProvider interface { // BucketExists returns if an object storage bucket with the provided name // exists, or returns a (client) error. BucketExists(ctx context.Context, bucketName string) (bool, error) // FGetObject gets the object from the provided object storage bucket, and // writes it to targetPath. // It returns the etag of the successfully fetched file, or any error. FGetObject(ctx context.Context, bucketName, objectKey, targetPath string) (etag string, err error) // VisitObjects iterates over the items in the provided object storage // bucket, calling visit for every item. // If the underlying client or the visit callback returns an error, // it returns early. VisitObjects(ctx context.Context, bucketName string, visit func(key, etag string) error) error // ObjectIsNotFound returns true if the given error indicates an object // could not be found. ObjectIsNotFound(error) bool // Close closes the provider's client, if supported. Close(context.Context) }
BucketProvider is an interface for fetching objects from a storage provider bucket.
type BucketReconciler ¶ added in v0.0.17
type BucketReconciler struct { client.Client kuberecorder.EventRecorder helper.Metrics Storage *Storage ControllerName string // contains filtered or unexported fields }
BucketReconciler reconciles a v1beta2.Bucket object.
func (*BucketReconciler) SetupWithManager ¶ added in v0.0.17
func (r *BucketReconciler) SetupWithManager(mgr ctrl.Manager) error
func (*BucketReconciler) SetupWithManagerAndOptions ¶ added in v0.0.17
func (r *BucketReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts BucketReconcilerOptions) error
type BucketReconcilerOptions ¶ added in v0.0.17
type BucketReconcilerOptions struct { MaxConcurrentReconciles int RateLimiter ratelimiter.RateLimiter }
type GitRepositoryReconciler ¶
type GitRepositoryReconciler struct { client.Client kuberecorder.EventRecorder helper.Metrics Storage *Storage ControllerName string // contains filtered or unexported fields }
GitRepositoryReconciler reconciles a v1beta2.GitRepository object.
func (*GitRepositoryReconciler) SetupWithManager ¶
func (r *GitRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
func (*GitRepositoryReconciler) SetupWithManagerAndOptions ¶
func (r *GitRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts GitRepositoryReconcilerOptions) error
type GitRepositoryReconcilerOptions ¶
type GitRepositoryReconcilerOptions struct { MaxConcurrentReconciles int DependencyRequeueInterval time.Duration RateLimiter ratelimiter.RateLimiter }
type HelmChartReconciler ¶
type HelmChartReconciler struct { client.Client kuberecorder.EventRecorder helper.Metrics RegistryClientGenerator RegistryClientGeneratorFunc Storage *Storage Getters helmgetter.Providers ControllerName string Cache *cache.Cache TTL time.Duration *cache.CacheRecorder // contains filtered or unexported fields }
HelmChartReconciler reconciles a HelmChart object
func (*HelmChartReconciler) SetupWithManager ¶
func (r *HelmChartReconciler) SetupWithManager(mgr ctrl.Manager) error
func (*HelmChartReconciler) SetupWithManagerAndOptions ¶
func (r *HelmChartReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts HelmChartReconcilerOptions) error
type HelmChartReconcilerOptions ¶
type HelmChartReconcilerOptions struct { MaxConcurrentReconciles int RateLimiter ratelimiter.RateLimiter }
type HelmRepositoryOCIReconciler ¶ added in v0.25.0
type HelmRepositoryOCIReconciler struct { client.Client kuberecorder.EventRecorder helper.Metrics Getters helmgetter.Providers ControllerName string RegistryClientGenerator RegistryClientGeneratorFunc // contains filtered or unexported fields }
HelmRepositoryOCI Reconciler reconciles a v1beta2.HelmRepository object of type OCI.
func (*HelmRepositoryOCIReconciler) SetupWithManager ¶ added in v0.25.0
func (r *HelmRepositoryOCIReconciler) SetupWithManager(mgr ctrl.Manager) error
func (*HelmRepositoryOCIReconciler) SetupWithManagerAndOptions ¶ added in v0.25.0
func (r *HelmRepositoryOCIReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts HelmRepositoryReconcilerOptions) error
type HelmRepositoryReconciler ¶
type HelmRepositoryReconciler struct { client.Client kuberecorder.EventRecorder helper.Metrics Getters helmgetter.Providers Storage *Storage ControllerName string Cache *cache.Cache TTL time.Duration *cache.CacheRecorder // contains filtered or unexported fields }
HelmRepositoryReconciler reconciles a v1beta2.HelmRepository object.
func (*HelmRepositoryReconciler) SetupWithManager ¶
func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
func (*HelmRepositoryReconciler) SetupWithManagerAndOptions ¶
func (r *HelmRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts HelmRepositoryReconcilerOptions) error
type HelmRepositoryReconcilerOptions ¶
type HelmRepositoryReconcilerOptions struct { MaxConcurrentReconciles int RateLimiter ratelimiter.RateLimiter }
type OCIRepositoryReconciler ¶ added in v0.26.0
type OCIRepositoryReconciler struct { client.Client helper.Metrics kuberecorder.EventRecorder Storage *Storage ControllerName string // contains filtered or unexported fields }
OCIRepositoryReconciler reconciles a v1beta2.OCIRepository object
func (*OCIRepositoryReconciler) SetupWithManager ¶ added in v0.26.0
func (r *OCIRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*OCIRepositoryReconciler) SetupWithManagerAndOptions ¶ added in v0.26.0
func (r *OCIRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts OCIRepositoryReconcilerOptions) error
type OCIRepositoryReconcilerOptions ¶ added in v0.26.0
type OCIRepositoryReconcilerOptions struct { MaxConcurrentReconciles int DependencyRequeueInterval time.Duration RateLimiter ratelimiter.RateLimiter }
type RegistryClientGeneratorFunc ¶ added in v0.25.0
RegistryClientGeneratorFunc is a function that returns a registry client and an optional file name. The file is used to store the registry client credentials. The caller is responsible for deleting the file.
type SourceRevisionChangePredicate ¶ added in v0.4.0
func (SourceRevisionChangePredicate) Create ¶ added in v0.4.0
func (SourceRevisionChangePredicate) Create(e event.CreateEvent) bool
func (SourceRevisionChangePredicate) Delete ¶ added in v0.4.0
func (SourceRevisionChangePredicate) Delete(e event.DeleteEvent) bool
func (SourceRevisionChangePredicate) Update ¶ added in v0.4.0
func (SourceRevisionChangePredicate) Update(e event.UpdateEvent) bool
type Storage ¶
type Storage struct { // BasePath is the local directory path where the source artifacts are stored. BasePath string `json:"basePath"` // Hostname is the file server host name used to compose the artifacts URIs. Hostname string `json:"hostname"` // ArtifactRetentionTTL is the duration of time that artifacts will be kept // in storage before being garbage collected. ArtifactRetentionTTL time.Duration `json:"artifactRetentionTTL"` // ArtifactRetentionRecords is the maximum number of artifacts to be kept in // storage after a garbage collection. ArtifactRetentionRecords int `json:"artifactRetentionRecords"` }
Storage manages artifacts
func NewStorage ¶
func NewStorage(basePath string, hostname string, artifactRetentionTTL time.Duration, artifactRetentionRecords int) (*Storage, error)
NewStorage creates the storage helper for a given path and hostname.
func (*Storage) Archive ¶
func (s *Storage) Archive(artifact *sourcev1.Artifact, dir string, filter ArchiveFileFilter) (err error)
Archive atomically archives the given directory as a tarball to the given v1beta1.Artifact path, excluding directories and any ArchiveFileFilter matches. While archiving, any environment specific data (for example, the user and group name) is stripped from file headers. If successful, it sets the checksum and last update time on the artifact.
func (*Storage) ArtifactExist ¶
ArtifactExist returns a boolean indicating whether the v1beta1.Artifact exists in storage and is a regular file.
func (*Storage) AtomicWriteFile ¶ added in v0.0.15
func (s *Storage) AtomicWriteFile(artifact *sourcev1.Artifact, reader io.Reader, mode os.FileMode) (err error)
AtomicWriteFile atomically writes the io.Reader contents to the v1beta1.Artifact path. If successful, it sets the checksum and last update time on the artifact.
func (*Storage) Checksum ¶
Checksum returns the SHA256 checksum for the data of the given io.Reader as a string.
func (*Storage) Copy ¶ added in v0.0.15
Copy atomically copies the io.Reader contents to the v1beta1.Artifact path. If successful, it sets the checksum and last update time on the artifact.
func (*Storage) CopyFromPath ¶ added in v0.0.18
CopyFromPath atomically copies the contents of the given path to the path of the v1beta1.Artifact. If successful, the checksum and last update time on the artifact is set.
func (*Storage) CopyToPath ¶ added in v0.13.0
CopyToPath copies the contents in the (sub)path of the given artifact to the given path.
func (*Storage) GarbageCollect ¶ added in v0.23.0
func (s *Storage) GarbageCollect(ctx context.Context, artifact sourcev1.Artifact, timeout time.Duration) ([]string, error)
GarbageCollect removes all garabge files in the artifact dir according to the provided retention options.
func (*Storage) LocalPath ¶ added in v0.0.15
LocalPath returns the secure local path of the given artifact (that is: relative to the Storage.BasePath).
func (*Storage) NewArtifactFor ¶ added in v0.0.15
func (s *Storage) NewArtifactFor(kind string, metadata metav1.Object, revision, fileName string) sourcev1.Artifact
NewArtifactFor returns a new v1beta1.Artifact.
func (*Storage) RemoveAllButCurrent ¶
RemoveAllButCurrent removes all files for the given v1beta1.Artifact base dir, excluding the current one.
func (Storage) SetArtifactURL ¶ added in v0.0.15
SetArtifactURL sets the URL on the given v1beta1.Artifact.
func (Storage) SetHostname ¶ added in v0.0.15
SetHostname sets the hostname of the given URL string to the current Storage.Hostname and returns the result.