Commit Graph

31 Commits

Author SHA1 Message Date
Hidde Beydals 582c2092b6 Change copyright to Flux authors
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-10-27 17:54:22 +01:00
stefanprodan f16e5f041a Promote API to v1beta1 2020-09-30 16:11:00 +03:00
Hidde Beydals 4da80b65e5 storage: add CopyFromPath method 2020-09-21 23:16:13 +02:00
stefanprodan c2c61b10a1 Implement S3 Bucket controller 2020-09-18 16:11:24 +03:00
Hidde Beydals d03f4fa4c4 Change advertised artifact URLs on hostname change 2020-09-10 14:13:46 +02:00
Hidde Beydals 42706a342b Calculate checksums during file writes 2020-09-10 13:00:08 +02:00
Hidde Beydals 1ab12869ac Make storage file writes atomic 2020-09-10 12:02:32 +02:00
Hidde Beydals 68ccf2598f storage: actually record relative path in artifact 2020-09-09 16:32:25 +02:00
Hidde Beydals 99b74da044 api/artifact: add checksum field to artifact
This includes a change to how the revision for HelmRepository sources is
recorded, as this will now equal to the generated timestamp from the index
in RFC3339Nano format.
2020-09-09 13:41:56 +02:00
Hidde Beydals 0b752178b1 storage: only store relative path in artifact
As the storage base directory is determined during runtime, and
artifacts may live longer than that if they are e.g. stored in a
persistent volume but the mount path configuration changes.
2020-09-08 17:21:56 +02:00
Hidde Beydals f8c4bd31ca api/artifact: add ArtifactDir helper func
To make it easier to construct just the directory path for the
artifact (relative to the storage base path).
2020-09-08 15:16:58 +02:00
Hidde Beydals b7603f9fd3 storage: change logic of `ArtifactExist` method
Given that:

* The produced artifact as advertisted in the path should always
  be a regular file (including the exclusion of symlinks).
* The produced artifact should be readable, so any type of error
  should count as "does not exist".

We should use `os.Lstat` to not follow symlinks; return `false`
on any error we run in to, or return if the file mode information
reports a regular file.
2020-09-01 16:01:19 +02:00
Hidde Beydals 24f47ac183 Support Helm charts from GitRepository sources 2020-08-31 16:21:53 +02:00
Erik Hollensbe 687b79a7dd Storage: fix a small bug in RemoveAllButCurrent when the directory is invalid
filepath.Walk can return a `nil` for the stat value, when it does, the
directory is invalid and the error will be set. This causes a
panic+crash if the directory does not currently exist when
RemoveAllButCurrent is called.

The following patch makes the behavior an error instead.

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2020-07-15 18:50:09 +00:00
stefanprodan b9dc2ecf64 Add ignore field to GitRepository spec 2020-07-09 14:48:02 +03:00
Erik Hollensbe a723b9e3e7 Archive and storage tests
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2020-07-08 23:23:33 +00:00
Erik Hollensbe b1b1dbcec5 Support programming excluded patterns in gitrepository spec
-- More coming in this commit message soon

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2020-07-08 14:38:44 +00:00
stefanprodan e92cbbdd45 Migrate to fluxcd/pkg 2020-06-30 17:30:21 +03:00
Hidde Beydals 39ee34897a Replace tar/gzip shell-out with Go implementation 2020-06-06 19:15:52 +02:00
Hidde Beydals 77822bd4d1 controllers: simple GitRepository test 2020-05-29 14:24:31 +02:00
Hidde Beydals e880a45474 controllers: control tar ignores w/ exclude files
This commit changes the file excludes for tarballs generated for
Git repository artifacts from a fixed set of strings to include
exclusion files files. It currently takes `.sourceignore` and
in the root of the given directory into account.

In addition to this the Git VCS related files that are ignored have
been extended to not only include the .git/ directory, but also the
.gitignore, .gitmodules and .gitattributes files. Mimicking part of
the --exclude-vcs flag not available on all tar versions.
2020-05-13 19:45:31 +02:00
stefanprodan 9540efe9de git: add archive integrity check 2020-04-27 13:39:36 +03:00
stefanprodan e88d7219ca Change artifact path format
- move artifact path composition to API
- change path format to `<source-kind>/<source-namespace>/<source-name>/<artifact-filename>`
2020-04-13 19:52:30 +03:00
Hidde Beydals 3e0810aefe Give namespace precedence in calc artifact path 2020-04-12 22:07:57 +02:00
Hidde Beydals 7e99998c5f Factor out injection of kind string in controllers 2020-04-12 22:07:53 +02:00
stefanprodan 2bbcd91544 Add artifact to Git and Helm repos status
- create index.yaml symlink for Helm repos
- set symlink URL in status
2020-04-12 17:39:07 +03:00
stefanprodan 786071fe3c Add symlink helper to storage 2020-04-12 09:56:03 +03:00
stefanprodan d1f76995ab Add ready condition helpers 2020-04-10 22:44:09 +03:00
stefanprodan 98deb3fa54 Add file lock helper to Storage
- use https://github.com/golang/go/tree/master/src/cmd/go/internal/lockedfile
2020-04-10 16:08:05 +03:00
stefanprodan 9dae1c43d7 Use storage helper in HelmRepositoryReconciler
- move checksum and file write operations to Storage
- implement GC
2020-04-10 15:16:31 +03:00
stefanprodan d1fb8e1ade Add storage helpers
- add storage and artifact types
- extract fs operations to storage functions
- construct artifact paths from Kubernetes objects metadata
2020-04-10 11:51:15 +03:00