1
0
mirror of synced 2026-03-01 11:16:56 +00:00

Compare commits

..

2401 Commits

Author SHA1 Message Date
Joel Bennett
2d3f3a4be5 Correct "sync" to "component" in log lines
Signed-off-by: Joel Bennett <Jaykul@HuddledMasses.org>
2023-12-12 09:08:10 +02:00
Stefan Prodan
b742799307 Merge pull request #4460 from fluxcd/dependabot/github_actions/ci-4046e4e628
build(deps): bump the ci group with 4 updates
2023-12-11 08:43:28 +01:00
dependabot[bot]
3abc829250 build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [korthout/backport-action](https://github.com/korthout/backport-action), [actions/setup-go](https://github.com/actions/setup-go), [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) and [anchore/sbom-action](https://github.com/anchore/sbom-action).


Updates `korthout/backport-action` from 2.1.1 to 2.2.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](08bafb375e...b982d297e3)

Updates `actions/setup-go` from 4.1.0 to 5.0.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](93397bea11...0c52d547c9)

Updates `google-github-actions/setup-gcloud` from 1.1.1 to 2.0.0
- [Release notes](https://github.com/google-github-actions/setup-gcloud/releases)
- [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/main/CHANGELOG.md)
- [Commits](e30db14379...825196879a)

Updates `anchore/sbom-action` from 0.15.0 to 0.15.1
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](fd74a6fb98...5ecf649a41)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: google-github-actions/setup-gcloud
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 01:03:57 +00:00
Sunny
92486b70be Merge pull request #4433 from fluxcd/helm-oci-static-rfc
Update Helm OCI RFC - static HelmRepository design
2023-12-08 22:13:20 +05:30
Sunny
1e37cbeae7 Update Helm OCI RFC - static HelmRepository design
Update the design details to reflect the design change to make the
HelmRepository of type OCI static.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 21:46:05 +05:30
Sunny
0e7dedc728 Merge pull request #4298 from fluxcd/no-reconcile-ready-static
Add support for HelmRepo OCI and NC v1beta3 static objects
2023-12-08 21:32:27 +05:30
Sunny
2649bfb3a3 tests/int: do not wait for static objects
HelmRepo OCI, Alerts and Providers are static objects and don't need to
be checked for readiness.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 21:16:54 +05:30
Sunny
e901e8b6f8 Update all the references of NC v1beta2 to v1beta3
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 21:16:54 +05:30
Sunny
b28b5dd9b9 non-reconciliable & readiness of static objects
Remove reconcile subcommand for static object APIs Alerts and Providers.

Add a isStatic() method on all the object adapters to determine if
they are static and don't have reconciler. The objects that don't
have reconcilers are skipped from reconciliation and readiness
checks like HelmRepository of type OCI.

Add default ready message for `get` subcommand output for static
objects, Alerts, Providers and HelmRepositories of type OCI, as ready
message can't be derived for them from their status.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 21:15:20 +05:30
Sunny
6135c326d8 Merge pull request #4311 from fluxcd/kstatus-readiness
Check readiness of Flux kinds using kstatus
2023-12-08 20:29:16 +05:30
Sunny
05c13fe35a check readiness using kstatus
This change replaces all the many functions and ways of calculating
readiness of objects into one unified way that uses kstatus.Compute() to
check if the object is in progress or current. Only the objects that are
current are considered to be ready. This takes advantage of the kstatus
compatibility of Flux's APIs and also makes sure that they remain
kstatus compatible.

The new isObjectReady() function is also aware of static/statusless
objects and knows how to check their readiness using kstatus. This
prepares the CLI for the upcoming static API objects.

All the is*Ready() functions for specific objects have been removed.

This change doesn't affect any of the existing tests results.

Introduce suspend and resume subcommands for alert-provider.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-12-08 19:47:12 +05:30
Sunny
8e3a809e91 Merge pull request #4422 from somtochiama/fix-bootstrap-failed
bootstrap: More details for `context deadline exceeded` error
2023-12-08 19:10:44 +05:30
Somtochi Onyekwere
2289c6cc60 bootstrap: provide better error message on timeout
Check GitRepository and return Ready condition message as part of error
on timeout.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-12-08 19:00:01 +05:30
Sunny
b6447800a7 Merge pull request #4454 from fluxcd/update-components
Update toolkit components
2023-12-08 18:59:36 +05:30
fluxcdbot
e4747b55c7 Update toolkit components
- source-controller to v1.2.1
  https://github.com/fluxcd/source-controller/blob/v1.2.1/CHANGELOG.md
- notification-controller to v1.2.1
  https://github.com/fluxcd/notification-controller/blob/v1.2.1/CHANGELOG.md
- image-reflector-controller to v0.31.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.31.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-12-08 13:02:54 +00:00
Max Jonas Werner
3c06ebcda2 Merge pull request #4455 from chewong/bootstrap-typo
Fix typos in flux bootstrap documentation
2023-12-08 12:04:10 +01:00
Ernest Wong
5685afb9d5 Fix typos in flux bootstrap documentation
Signed-off-by: Ernest Wong <chwong719@gmail.com>
2023-12-07 13:03:12 -08:00
Sunny
3da7e1ce2d Merge pull request #4424 from somtochiama/version-check
Show distribution name in flux check and flux version
2023-12-06 20:13:11 +05:30
Somtochi Onyekwere
fd163ddcf2 show cluster instance name and version in flux check and flux version
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-12-06 15:21:55 +01:00
Stefan Prodan
62ac960273 Merge pull request #4447 from fluxcd/dependabot/github_actions/ci-10ada1b5dc
build(deps): bump the ci group with 4 updates
2023-12-04 08:33:10 +02:00
dependabot[bot]
daa25a9a30 build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [Azure/login](https://github.com/azure/login), [google-github-actions/auth](https://github.com/google-github-actions/auth), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [fossa-contrib/fossa-action](https://github.com/fossa-contrib/fossa-action).


Updates `Azure/login` from 1.4.7 to 1.5.1
- [Release notes](https://github.com/azure/login/releases)
- [Commits](92a5484dfa...de95379fe4)

Updates `google-github-actions/auth` from 1.1.1 to 2.0.0
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](35b0e87d16...67e9c72af6)

Updates `anchore/sbom-action` from 0.14.3 to 0.15.0
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](78fc58e266...fd74a6fb98)

Updates `fossa-contrib/fossa-action` from 2.0.0 to 3.0.0
- [Release notes](https://github.com/fossa-contrib/fossa-action/releases)
- [Changelog](https://github.com/fossa-contrib/fossa-action/blob/master/CHANGELOG.md)
- [Commits](6728dc6fe9...cdc5065bcd)

---
updated-dependencies:
- dependency-name: Azure/login
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: fossa-contrib/fossa-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 01:15:12 +00:00
Max Jonas Werner
f20fe76168 Merge pull request #4404 from VinGarcia/main
Fix flux install command so it returns an error when unexpected arguments are passed
2023-11-27 18:19:10 +01:00
Vinícius Garcia
b596aefb91 Fix flux install command so it returns an error when unexpected arguments are passed
Co-authored-by: Max Jonas Werner <makkes@users.noreply.github.com>
Signed-off-by: Vinícius Garcia <vingarcia00@gmail.com>
2023-11-27 13:02:14 -03:00
Stefan Prodan
c5b5263b1b Merge pull request #4388 from fluxcd/rfc-0003-keyless-match
[RFC-0003] OIDC identity matching for keyless verification
2023-11-23 13:05:45 +02:00
Stefan Prodan
765ebbacfe OIDC identity matching for keyless verification
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-23 10:56:30 +02:00
Stefan Prodan
2fb132bdc5 Merge pull request #4416 from fluxcd/kube-1.28
Update dependencies to Kubernetes v1.28
2023-11-20 17:02:37 +02:00
Stefan Prodan
80efd29ec0 Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-20 15:27:46 +02:00
Stefan Prodan
4cb89adec4 Merge pull request #4409 from somtochiama/flux-events
Make events cmd work well with lowercased and only kind selector
2023-11-20 15:01:23 +02:00
Somtochi Onyekwere
aca461912c make flux events work with lowercased kinds
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-11-17 02:25:17 +01:00
Max Jonas Werner
e645402ced Merge pull request #4402 from mclarke47/patch-1
fix build_artifact.go typo
2023-11-15 08:44:54 +01:00
Matthew Clarke
e184ef2618 fix build_artifact.go typo
Signed-off-by: Matthew Clarke <matthewclarke47@gmail.com>
2023-11-14 15:02:54 -05:00
Max Jonas Werner
0fcda45659 Merge pull request #4399 from fluxcd/dependabot/github_actions/ci-da8bbba46e
build(deps): bump the ci group with 2 updates
2023-11-13 08:53:20 +01:00
dependabot[bot]
c5dd6a18fa build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer).


Updates `korthout/backport-action` from 2.1.0 to 2.1.1
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](cb79e4e5f4...08bafb375e)

Updates `sigstore/cosign-installer` from 3.1.2 to 3.2.0
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](11086d2504...1fc5bd396d)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 01:09:39 +00:00
Hidde Beydals
3c8072d0e6 Merge pull request #4380 from fluxcd/tweak-file-perms
Tweak permissions on created files
2023-11-06 12:49:01 +01:00
Hidde Beydals
cbccb8c46a Update fluxcd/pkg dependencies
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-06 12:33:39 +01:00
Hidde Beydals
e73d1acb20 Tweak permissions on created files
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-06 12:33:38 +01:00
Max Jonas Werner
1b239fbc82 Merge pull request #4385 from fluxcd/dependabot/github_actions/ci-f6b2bf3fcc
build(deps): bump the ci group with 2 updates
2023-11-06 07:45:15 +01:00
dependabot[bot]
0ad4db9f82 build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform).


Updates `korthout/backport-action` from 2.0.0 to 2.1.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](408fae11ed...cb79e4e5f4)

Updates `hashicorp/setup-terraform` from 2.0.3 to 3.0.0
- [Release notes](https://github.com/hashicorp/setup-terraform/releases)
- [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md)
- [Commits](633666f66e...a1502cd9e7)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: hashicorp/setup-terraform
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 00:39:04 +00:00
Sunny
659ce798c9 Merge pull request #4382 from fluxcd/int-test-stop-exit-code
tests/int: Set exit code 1 on tf destroy fail
2023-11-04 16:34:39 +05:30
Sunny
6dd0cbfadd tests/int: Set exit code 1 on tf destroy fail
Explicitly set the test program exit code to 1 when terraform destroy
fails to delete the infrastructure.

This was observed when GKE clusters failed to delete due to delete
protection enabled by default in the latest version of terraform
provider google.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-04 00:16:54 +05:30
Max Jonas Werner
e7c015d24c Merge pull request #4270 from Azhovan/jabar/add-gitea-bootstrapper
feat: add bootstrap gitea command
2023-11-01 16:12:42 +01:00
Jabar Asadi
dcbca6b1bf feat: add gitea bootstrapper
Signed-off-by: Jabar Asadi <jasadi@d2iq.com>
2023-11-01 15:46:42 +01:00
Stefan Prodan
28971edc07 Merge pull request #4355 from somtochiama/safe-bootstrap
Confirm before overriding installation by another manager
2023-11-01 13:09:12 +02:00
Somtochi Onyekwere
9cd4a7215f Display better uninstall prompt if flux is managed by a different tool
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-11-01 11:36:57 +01:00
Somtochi Onyekwere
2f15ad972b confirm before overriding installation by another manager
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-11-01 11:36:13 +01:00
Stefan Prodan
10cddb457f Merge pull request #4370 from fluxcd/dependabot/go_modules/tests/integration/github.com/docker/docker-24.0.7incompatible
build(deps): bump github.com/docker/docker from 23.0.3+incompatible to 24.0.7+incompatible in /tests/integration
2023-10-30 23:06:19 +02:00
dependabot[bot]
7771107e4d build(deps): bump github.com/docker/docker in /tests/integration
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.3+incompatible to 24.0.7+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v23.0.3...v24.0.7)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 17:12:00 +00:00
Stefan Prodan
5879d8575a Merge pull request #4369 from fluxcd/dependabot/go_modules/github.com/docker/docker-24.0.7incompatible
build(deps): bump github.com/docker/docker from 24.0.0+incompatible to 24.0.7+incompatible
2023-10-30 18:01:52 +02:00
dependabot[bot]
80810bdc0f build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.0+incompatible to 24.0.7+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v24.0.0...v24.0.7)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 15:44:06 +00:00
Max Jonas Werner
e3605acc13 Merge pull request #4366 from fluxcd/dependabot/github_actions/ci-fa2bfd4781
build(deps): bump the ci group with 2 updates
2023-10-30 09:00:07 +01:00
dependabot[bot]
cbce9b5e26 build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [ossf/scorecard-action](https://github.com/ossf/scorecard-action).


Updates `korthout/backport-action` from 1.4.0 to 2.0.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](bd68141f07...408fae11ed)

Updates `ossf/scorecard-action` from 2.3.0 to 2.3.1
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](483ef80eb9...0864cf1902)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 00:09:02 +00:00
Stefan Prodan
1ff76bd4a5 Merge pull request #4358 from fluxcd/dependabot/go_modules/tests/integration/google.golang.org/grpc-1.56.3
build(deps): bump google.golang.org/grpc from 1.55.0 to 1.56.3 in /tests/integration
2023-10-26 08:19:32 +03:00
dependabot[bot]
920fea7d1b build(deps): bump google.golang.org/grpc in /tests/integration
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.55.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.55.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 22:41:32 +00:00
Stefan Prodan
adc04651cf Merge pull request #4345 from somtochiama/safe-bootstrap
Prevent `flux install` from overriding bootrapped cluster
2023-10-23 17:01:05 +03:00
Somtochi Onyekwere
0eba9662e6 prevent flux install from overriding bootrapped cluster
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-10-23 14:39:43 +01:00
Max Jonas Werner
7949135a74 Merge pull request #4351 from fluxcd/dependabot/github_actions/ci-16ff15100a
build(deps): bump the ci group with 1 update
2023-10-23 09:06:52 +02:00
dependabot[bot]
025fe9ced1 build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [actions/checkout](https://github.com/actions/checkout).

- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8ade135a41...b4ffde65f4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 00:19:31 +00:00
Hidde Beydals
5f1fe306bb Merge pull request #4329 from fluxcd/tidy-nits
Address various issues throughout code base
2023-10-17 14:24:37 +02:00
Hidde Beydals
f137263fe9 misc: clean up immediately and avoid delayed defer
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:11 +02:00
Hidde Beydals
ba1180ad4d misc: fix hypothetical implicit memory aliasing
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:10 +02:00
Hidde Beydals
e3f6f0f8b3 misc: sinceSeconds -> sinceDuration
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:10 +02:00
Hidde Beydals
f5d3283cff misc: remove unused bits of code
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:09 +02:00
Hidde Beydals
3fdb292381 misc: address wait.PollImmediate deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:09 +02:00
Hidde Beydals
22134b1233 misc: use errors.As instead of type checking
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:08 +02:00
Hidde Beydals
ce3e264c7d misc: unconditional strings.TrimPrefix
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:07 +02:00
Hidde Beydals
5b22207c98 misc: address kustomize/api/filesys deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:07 +02:00
Hidde Beydals
3278a0782f misc: simplify row append
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:06 +02:00
Hidde Beydals
43c2359705 misc: address double import
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:05 +02:00
Hidde Beydals
a2a3b4f00f misc: use raw string for regex to avoid double esc
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:03 +02:00
Hidde Beydals
3c495861a1 misc: address unnecessary use of fmt.Sprintf
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:02 +02:00
Hidde Beydals
b67a46371b misc: handle undhandled error
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:00 +02:00
Hidde Beydals
16d352b15b misc: address strings.Title deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:07:58 +02:00
Stefan Prodan
ac95ac0653 Merge pull request #4332 from matheuscscp/oci-verify-secret
Add CLI flags for OCIRepository signature verification
2023-10-17 14:53:20 +03:00
Matheus Pimenta
840e717b72 Add CLI flag for OCIRepo verify secret
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-10-17 12:36:35 +01:00
Stefan Prodan
ae0c3c8020 Merge pull request #4284 from errordeveloper/pull-any-artifact
Make `flux pull` work for OCI artifacts produced by other tools
2023-10-12 16:14:35 +03:00
Ilya Dmitrichenko
b46e298b4d Print artifact source and revision only when available
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2023-10-12 16:00:57 +03:00
Ilya Dmitrichenko
e9d4b42b12 Upgrade github.com/fluxcd/pkg/oci
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2023-10-12 16:00:57 +03:00
Hidde Beydals
771b7ab98a Merge pull request #4296 from Skarlso/fix-apply-timeout-on-empty-set
fix: only wait for changeset if the result is not empty
2023-10-12 14:12:01 +02:00
Gergely Brautigam
a51ede681f fix: only wait for changeset if the result is not empty
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
2023-10-12 13:54:49 +02:00
Stefan Prodan
be03ca3b5d Merge pull request #4324 from somtochiama/update-ggp
bootstrap: Fix error msg when the Git token doesn't match the repo owner
2023-10-12 14:03:32 +03:00
Somtochi Onyekwere
08cb3858ed Update go-git-providers to v0.19.1
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-10-12 11:48:05 +01:00
Stefan Prodan
39d4270f32 Merge pull request #4323 from fluxcd/update-e2e-deps
e2e: Update Go dependencies
2023-10-12 10:03:44 +03:00
Stefan Prodan
42372d9ef6 e2e: Update Go dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-10-12 09:43:46 +03:00
Stefan Prodan
e9aa53d2ed Merge pull request #4318 from fluxcd/dependabot/go_modules/golang.org/x/net-0.17.0
build(deps): bump golang.org/x/net from 0.15.0 to 0.17.0
2023-10-12 09:25:18 +03:00
dependabot[bot]
8f7ed74913 build(deps): bump golang.org/x/net from 0.15.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.15.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 23:12:22 +00:00
Stefan Prodan
2c090dbdf6 Merge pull request #4313 from fluxcd/update-components
Update toolkit components
2023-10-11 18:23:57 +03:00
fluxcdbot
084fb6318d Update toolkit components
- helm-controller to v0.36.2
  https://github.com/fluxcd/helm-controller/blob/v0.36.2/CHANGELOG.md
- kustomize-controller to v1.1.1
  https://github.com/fluxcd/kustomize-controller/blob/v1.1.1/CHANGELOG.md
- source-controller to v1.1.2
  https://github.com/fluxcd/source-controller/blob/v1.1.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-10-11 14:02:03 +00:00
Max Jonas Werner
1daa7a8aa4 Merge pull request #4308 from fluxcd/dependabot/github_actions/ci-2f3aab97f7
build(deps): bump the ci group with 1 update
2023-10-09 16:40:44 +02:00
dependabot[bot]
cf78e029aa build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [ossf/scorecard-action](https://github.com/ossf/scorecard-action).

- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](08b4669551...483ef80eb9)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 00:47:36 +00:00
Stefan Prodan
a337a7ec73 Merge pull request #4285 from matheuscscp/slsa
Add badge for SLSA Level 3
2023-09-27 14:56:40 +03:00
Matheus Pimenta
630ca340dd Add badge for SLSA Level 3
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-09-27 12:41:35 +01:00
Max Jonas Werner
e12839567e Merge pull request #4279 from fluxcd/dependabot/github_actions/ci-663ed1f0b6
build(deps): bump the ci group with 1 update
2023-09-25 17:23:03 +02:00
dependabot[bot]
524a729f5d build(deps): bump the ci group with 1 update
Bumps the ci group with 1 update: [actions/checkout](https://github.com/actions/checkout).

- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](3df4ab11eb...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 00:39:21 +00:00
Hidde Beydals
d3eacd4c20 Merge pull request #4228 from sonbui00/fix-4224
Improve AUR package templates
2023-09-19 12:44:34 +02:00
Son Bui
f9e7190a04 Improve AUR package templates
- remove armv6h #4224
- unique source name #4224
- improve pkgver/_srcver #4224
- fix source name in .SRCINFO

Signed-off-by: Son Bui <sonbv00@gmail.com>
2023-09-19 12:23:27 +02:00
Hidde Beydals
15a63e3f2e Merge pull request #4255 from fluxcd/update-azure-test-deps
tests/azure: update controller dependencies
2023-09-19 11:33:11 +02:00
Hidde Beydals
1cba3e4476 tests/azure: update controller dependencies
- github.com/fluxcd/helm-controller/api to v0.36.1
- github.com/fluxcd/image-automation-controller/api to v0.36.1
- github.com/fluxcd/source-controller/api to v1.1.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-19 11:10:22 +02:00
Stefan Prodan
5c567a1ea8 Merge pull request #4251 from fluxcd/update-components
Update toolkit components
2023-09-19 11:02:20 +03:00
fluxcdbot
0c47d738a9 Update toolkit components
- helm-controller to v0.36.1
  https://github.com/fluxcd/helm-controller/blob/v0.36.1/CHANGELOG.md
- source-controller to v1.1.1
  https://github.com/fluxcd/source-controller/blob/v1.1.1/CHANGELOG.md
- image-automation-controller to v0.36.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.36.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-09-18 15:11:52 +00:00
Stefan Prodan
ebace983b9 Merge pull request #4226 from somtochiama/update-kubeconfig-flag
Update description of kubeconfig specific flag
2023-09-18 13:31:58 +03:00
Somtochi Onyekwere
1654791feb update description of kubeconfig flags
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-09-18 10:48:08 +01:00
Stefan Prodan
c20a57f1df Merge pull request #4246 from fluxcd/dependabot/github_actions/ci-6331f14bff
build(deps): bump the ci group with 4 updates
2023-09-18 10:16:24 +03:00
dependabot[bot]
1fc463c065 build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/login-action](https://github.com/docker/login-action) and [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action).


Updates `docker/setup-qemu-action` from 2.2.0 to 3.0.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](2b82ce82d5...68827325e0)

Updates `docker/setup-buildx-action` from 2.10.0 to 3.0.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](885d1462b8...f95db51fdd)

Updates `docker/login-action` from 2.2.0 to 3.0.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](465a07811f...343f7c4344)

Updates `goreleaser/goreleaser-action` from 4.6.0 to 5.0.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5fdedb94ab...7ec5c2b0c6)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 01:02:23 +00:00
Max Jonas Werner
904226fcf3 Merge pull request #4238 from fluxcd/upgrade-pkg
Upgrade github.com/fluxcd/pkg/{git,git/gogit}
2023-09-13 19:37:59 +02:00
Max Jonas Werner
c721474e0b Upgrade github.com/fluxcd/pkg/{git,git/gogit}
This allows us to get rid of the replace directive consuming the
filepath-securejoin fork.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-09-13 17:49:02 +02:00
Max Jonas Werner
1902f4af0d Merge pull request #4233 from sonbui00/fix-4224-armv6h
chore: remove support armv6h for aur package
2023-09-12 12:56:44 +02:00
Son Bui
bc90e7cf01 chore: remove support armv6h for aur package #4224
Signed-off-by: Son Bui <sonbv00@gmail.com>
2023-09-12 17:15:05 +08:00
Max Jonas Werner
0d18dc128a Merge pull request #4227 from fluxcd/dependabot/github_actions/ci-ae28534c02
build(deps): bump the ci group with 3 updates
2023-09-11 10:31:45 +02:00
dependabot[bot]
8cd7d8c5d2 build(deps): bump the ci group with 3 updates
Bumps the ci group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action).


Updates `actions/checkout` from 3.6.0 to 4.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](f43a0e5ff2...3df4ab11eb)

Updates `actions/upload-artifact` from 3.1.2 to 3.1.3
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b7f8abb15...a8a3f3ad30)

Updates `goreleaser/goreleaser-action` from 4.4.0 to 4.6.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](3fa32b8bb5...5fdedb94ab)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 01:13:25 +00:00
Max Jonas Werner
9b1e160798 Merge pull request #4222 from fluxcd/dependabot/go_modules/tests/integration/github.com/cyphar/filepath-securejoin-0.2.4
build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4 in /tests/integration
2023-09-08 11:07:05 +02:00
dependabot[bot]
ab18cfe1a2 build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 07:28:36 +00:00
Stefan Prodan
037562bf7b Merge pull request #4221 from fluxcd/dependabot/go_modules/tests/azure/github.com/cyphar/filepath-securejoin-0.2.4
build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4 in /tests/azure
2023-09-08 10:26:43 +03:00
dependabot[bot]
2d1937a5c8 build(deps): bump github.com/cyphar/filepath-securejoin in /tests/azure
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 13:02:50 +00:00
Max Jonas Werner
c5723821da Merge pull request #4215 from fluxcd/dependabot/github_actions/ci-2ac463fa23
build(deps): bump the ci group with 4 updates
2023-09-04 12:51:56 +02:00
dependabot[bot]
dbb9ea303d build(deps): bump the ci group with 4 updates
Bumps the ci group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [actions/setup-go](https://github.com/actions/setup-go), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer).


Updates `actions/checkout` from 3.4.0 to 3.6.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...f43a0e5ff2bd294095638e18286ca9a3d1956744)

Updates `actions/setup-go` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...93397bea11091df50f3d7e59dc26a7711a8bcfbe)

Updates `docker/setup-buildx-action` from 2.9.1 to 2.10.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](4c0219f9ac...885d1462b8)

Updates `sigstore/cosign-installer` from 3.1.1 to 3.1.2
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](6e04d228eb...11086d2504)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 00:52:11 +00:00
Stefan Prodan
47c8e5f44d Merge pull request #4213 from fluxcd/dependabot/go_modules/tests/integration/github.com/docker/distribution-2.8.2incompatible
build(deps): bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible in /tests/integration
2023-09-01 11:16:53 +03:00
dependabot[bot]
aff3365750 build(deps): bump github.com/docker/distribution in /tests/integration
Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](https://github.com/docker/distribution/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 07:59:47 +00:00
Stefan Prodan
d61efd1e2c Merge pull request #4212 from fluxcd/dependabot/go_modules/tests/integration/github.com/docker/docker-23.0.3incompatible
build(deps): bump github.com/docker/docker from 23.0.1+incompatible to 23.0.3+incompatible in /tests/integration
2023-09-01 10:55:56 +03:00
dependabot[bot]
5d1cadcd5e build(deps): bump github.com/docker/docker in /tests/integration
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 18:24:29 +00:00
Sunny
ffe5657367 Merge pull request #4092 from fluxcd/azure-e2e-refactor
Add new Azure and GCP e2e test setup
2023-08-31 23:52:53 +05:30
Sunny
a9a67a27e7 workflows/e2e-azure: Disable new azure job
There's no azure subscription to run the tests against at present.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-31 21:39:39 +05:30
Sunny
c2e526ca57 workflows/e2e-gcp: Fix secret variable typo
Also update terraform config to add a description to the service
account and a note about github organization repo.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-31 21:39:14 +05:30
Somtochi Onyekwere
7141271bae instructions for test user in Azure DevOps and GCP source repo
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-29 17:43:59 +05:30
Sunny
3b637a5125 tests/int: Separate ssh key names for Azure & GCP
- Also update IAM setup docs to include github terraform provider
  configuration with github owner so that it can be used with a
  repository under an organization.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-29 17:43:59 +05:30
Somtochi Onyekwere
cdc1c98a11 add workflow for gcp
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-29 17:43:59 +05:30
Sunny
ab94c8064c tests/int: Add IAM setup automation docs and misc fixes
Add instructions about how to create service accounts with IAM
permissions and populate the secrets and variables required in the CI.

Update the panic recovery code to ensure that the exit status surfaces
on panic along with a log message.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-29 17:43:59 +05:30
Somtochi Onyekwere
e63ddb99de make tests for notifications provider agnostic
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-29 17:43:59 +05:30
Somtochi Onyekwere
7c1b897919 Add terraform files and config for GCP
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-29 17:43:59 +05:30
Somtochi Onyekwere
f6b0c6e7ef Add refactored e2e tests
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-29 17:43:53 +05:30
Max Jonas Werner
1730f3c46b Merge pull request #4198 from fluxcd/2.1.x-label
Add 2.1.x backport label
2023-08-28 13:09:48 +02:00
Max Jonas Werner
a814487d4b Add 2.1.x backport label
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-08-28 12:42:24 +02:00
Stefan Prodan
cd90bc2c92 Merge pull request #4197 from fluxcd/fix-gh-action-links
Fix links to fluxcd.io
2023-08-28 12:19:58 +03:00
Stefan Prodan
709b17ce59 Fix links to fluxcd.io
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-28 12:10:03 +03:00
Stefan Prodan
39fa7d5502 Merge pull request #4195 from fluxcd/dependabot/github_actions/ci-17ac1b16d8
build(deps): bump the ci group with 2 updates
2023-08-28 11:25:39 +03:00
dependabot[bot]
29f77d2cb3 build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator).


Updates `actions/checkout` from 3.5.3 to 3.6.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...f43a0e5ff2)

Updates `slsa-framework/slsa-github-generator` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 00:57:07 +00:00
Stefan Prodan
22cf986a79 Merge pull request #4169 from fluxcd/monitoring-deprecation
Add monitoring configuration deprecation notice
2023-08-24 12:35:06 +03:00
Sunny
d80b697fbd Add monitoring configuration deprecation notice
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-08-24 14:51:15 +05:30
Stefan Prodan
8b9aaad20a Merge pull request #4189 from fluxcd/update-deps
Update dependencies
2023-08-24 12:15:41 +03:00
Hidde Beydals
4080d5807a tests/azure: update dependencies
- github.com/Azure/azure-event-hubs-go/v3 to v3.6.1
- github.com/fluxcd/helm-controller/api to v0.36.0
- github.com/fluxcd/image-automation-controller/api to v0.36.0
- github.com/fluxcd/image-reflector-controller/api to v0.30.0
- github.com/fluxcd/kustomize-controller/api to v1.1.0
- github.com/fluxcd/notification-controller/api to v1.1.0
- github.com/fluxcd/pkg/apis/event to v0.5.2
- github.com/fluxcd/pkg/apis/meta to v1.1.2
- github.com/fluxcd/pkg/git to v0.13.0
- github.com/fluxcd/pkg/git/gogit to v0.13.0
- github.com/fluxcd/source-controller/api to v1.1.0
- github.com/go-git/go-git/v5 to v5.8.1
- k8s.io/api to v0.27.4
- k8s.io/apimachinery to v0.27.4
- k8s.io/client-go to v0.27.4
- sigs.k8s.io/controller-runtime to v0.15.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-24 10:56:11 +02:00
Hidde Beydals
7c2072eed1 Update dependencies
- github.com/ProtonMail/go-crypto to v0.0.0-20230717121422-5aa5874ade95
- github.com/distribution/distribution/v3 to v3.0.0-20230823142118-4f7424c8eb41
- github.com/fluxcd/pkg/apis/event to v0.5.2
- github.com/fluxcd/pkg/git to v0.13.0
- github.com/fluxcd/pkg/git/gogit to v0.13.0
- github.com/fluxcd/pkg/oci to v0.31.0
- github.com/fluxcd/pkg/runtime to v0.42.0
- github.com/fluxcd/pkg/sourceignore to v0.3.5
- github.com/fluxcd/pkg/ssa to v0.32.0
- github.com/fluxcd/pkg/ssh to v0.8.2
- github.com/go-git/go-git/v5 to v5.8.1
- github.com/google/go-containerregistry to v0.16.1
- github.com/onsi/gomega to v1.27.10
- golang.org/x/crypto to v0.12.0
- golang.org/x/term to v0.11.0
- k8s.io/cli-runtime to v0.27.4
- k8s.io/kubectl to v0.27.4
- sigs.k8s.io/cli-utils to v0.35.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-24 10:54:40 +02:00
Stefan Prodan
d21e779b9f Merge pull request #4186 from fluxcd/update-components
Update toolkit components
2023-08-24 11:19:58 +03:00
fluxcdbot
f7e5223533 Update toolkit components
- helm-controller to v0.36.0
  https://github.com/fluxcd/helm-controller/blob/v0.36.0/CHANGELOG.md
- kustomize-controller to v1.1.0
  https://github.com/fluxcd/kustomize-controller/blob/v1.1.0/CHANGELOG.md
- source-controller to v1.1.0
  https://github.com/fluxcd/source-controller/blob/v1.1.0/CHANGELOG.md
- notification-controller to v1.1.0
  https://github.com/fluxcd/notification-controller/blob/v1.1.0/CHANGELOG.md
- image-reflector-controller to v0.30.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.30.0/CHANGELOG.md
- image-automation-controller to v0.36.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.36.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-08-24 08:02:17 +00:00
Sanskar Jaiswal
525bd21cd1 Merge pull request #4147 from fluxcd/tls-flags
Adopt Kubernetes style TLS Secrets and add relevant flags
2023-08-23 15:09:40 +05:30
Sanskar Jaiswal
8df27d8c3a modify flux create secret tls to create secrets of type TLS
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-08-23 14:44:10 +05:30
Sanskar Jaiswal
6464d6c7b4 add deprecation warning per secret key field and constant
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-08-23 14:44:09 +05:30
Sanskar Jaiswal
2fc9d73c5f add flag --ca-crt-file to flux create secret git
Add flag `--ca-crt-file` to `flux create secret git` to specify the path
to CA certificate. It takes precedence over `--ca-file` and uses the
key `ca.crt` in the generated Secret.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-08-23 14:44:09 +05:30
Sanskar Jaiswal
b32051df53 deprecate TLS flags for flux create secret helm
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-08-23 14:44:09 +05:30
Sanskar Jaiswal
bf36a29ca2 add support for Kubernetes TLS keys for flux create secret tls
Add support for using `tls.key`, `tls.crt` and `ca.crt` keys while
generating a Secret, using the `--tls-key-file`, `--tls-crt-file` and
`--ca-crt-file` flags respectively.
Mark the flags `--key-file`, `--cert-file` and `--ca-file` as
deprecated.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-08-23 14:44:09 +05:30
Stefan Prodan
a2ac94b625 Merge pull request #4183 from somtochiama/fix-auto-complete
Fix autocompletion for helm chart
2023-08-22 16:57:34 +03:00
Somtochi Onyekwere
c81afa6993 fix autocompletion for helm chart
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-22 14:19:08 +01:00
Hidde Beydals
4fa93ec4d6 Merge pull request #4182 from fluxcd/clean-http-client
manifestgen/install: use clean default HTTP client
2023-08-22 14:20:17 +02:00
Hidde Beydals
00c6ac81b9 manifestgen/install: use clean default HTTP client
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-22 14:05:12 +02:00
Hidde Beydals
8801031f06 Merge pull request #4181 from fluxcd/cmd-events-err-fix
cmd/events: handle error value
2023-08-22 13:57:56 +02:00
Hidde Beydals
2a033215a4 cmd/events: handle error value
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-22 13:39:39 +02:00
Stefan Prodan
8214fefde6 Merge pull request #4180 from fluxcd/fix-version-info
Fix controller version info
2023-08-22 12:56:14 +03:00
Stefan Prodan
4cdb75b74d Fix controller version info
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-22 12:36:58 +03:00
Stefan Prodan
eac82585ad Merge pull request #4177 from fluxcd/min-rsa-size
Set min value for the `--ssh-rsa-bits` flag
2023-08-22 11:59:35 +03:00
Stefan Prodan
2c76c70205 Set min value for the --ssh-rsa-bits flag
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-22 11:42:33 +03:00
Hidde Beydals
a9e09b856f Merge pull request #4176 from fluxcd/e2e-improvements
ci: disable fail-fast for ARM end-to-end
2023-08-21 17:40:59 +02:00
Hidde Beydals
c03a0b7f87 ci: disable fail-fast for ARM end-to-end
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-21 17:17:02 +02:00
Hidde Beydals
0ab8740832 cmd: address typo in end-to-end tests
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-21 17:17:02 +02:00
Hidde Beydals
aa1eae22c7 Merge pull request #4175 from fluxcd/update-securejoin
build: update securejoin dependency
2023-08-21 16:58:23 +02:00
Hidde Beydals
4f3b34f86b build: update securejoin dependency
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-21 16:36:52 +02:00
Stefan Prodan
8435cb8df9 Merge pull request #4167 from fluxcd/dependabot/github_actions/ci-ab6beeed51
build(deps): bump the ci group with 2 updates
2023-08-18 12:16:37 +03:00
dependabot[bot]
0d457d6d11 build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [korthout/backport-action](https://github.com/korthout/backport-action) and [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action).


Updates `korthout/backport-action` from 1.3.1 to 1.4.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](bf5fdd624b...bd68141f07)

Updates `goreleaser/goreleaser-action` from 4.3.0 to 4.4.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](336e29918d...3fa32b8bb5)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-17 09:50:14 +00:00
Stefan Prodan
484015ceea Merge pull request #4166 from fluxcd/e2e-kube-1.28.0
e2e: Add Kubernetes v1.28.0 to conformance tests
2023-08-17 12:47:35 +03:00
Stefan Prodan
1b5c4245df e2e: Add Kubernetes v1.28.0 to conformance tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-17 11:45:36 +03:00
Stefan Prodan
ce68a06436 Merge pull request #4142 from fluxcd/dependabot/github_actions/ci-a9a55711ae
build(deps): bump the ci group with 2 updates
2023-08-10 12:00:07 +03:00
dependabot[bot]
7273059cb9 build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [actions/setup-go](https://github.com/actions/setup-go) and [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator).


Updates `actions/setup-go` from 4.0.1 to 4.1.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...93397bea11)

Updates `slsa-framework/slsa-github-generator` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 16:35:22 +00:00
Hidde Beydals
a03ea8ace3 Merge pull request #4151 from fluxcd/enable-codeql-quality
ci: enable security-and-quality CodeQL query
2023-08-09 18:32:15 +02:00
Hidde Beydals
d6cbfa39f8 ci: enable security-and-quality CodeQL query
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-09 18:14:39 +02:00
Sunny
a2e4cbbfe2 Merge pull request #4134 from sestegra/monitor
monitoring: add OCIRepository in cluster dashboard and new source panels in control-plane dashboard
2023-08-09 14:42:35 +05:30
Stéphane Este-Gracias
23518953d0 monitoring: add Sources Stats panels
Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
2023-08-09 14:22:33 +05:30
Stéphane Este-Gracias
2716ca449e monitoring: add OCIRepository in cluster dashboard panels
Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
2023-08-09 14:21:49 +05:30
Hidde Beydals
ecb1ad6ca5 Merge pull request #4140 from somtochiama/disable-test 2023-08-08 20:48:09 +02:00
Somtochi Onyekwere
3fa7af12e0 disable e2e test
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-08 16:35:47 +01:00
Stefan Prodan
12efb1967e Merge pull request #4131 from mraerino/fix/diff-with-multiobj
Fix selection of kustomization resource from multi doc yaml
2023-08-07 14:04:32 +03:00
Marcus Weiner
56b1e80758 Fix selection of kustomization resource from multi doc yaml
Signed-off-by: Marcus Weiner <marcus.weiner@gmail.com>
2023-08-07 12:05:29 +02:00
Stefan Prodan
baf874ea67 Merge pull request #4126 from fluxcd/min-kube-1.25
Set Kubernetes min version to 1.25
2023-08-03 13:39:24 +03:00
Stefan Prodan
28262f59d3 Set Kubernetes min version to 1.25
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-02 14:17:30 +03:00
Stefan Prodan
44d69d6fc0 Merge pull request #4077 from fluxcd/dependabot/github_actions/ci-f6f7181596
build(deps): bump the ci group with 2 updates
2023-07-17 18:24:01 +03:00
dependabot[bot]
4d76ff4e6a build(deps): bump the ci group with 2 updates
Bumps the ci group with 2 updates: [helm/kind-action](https://github.com/helm/kind-action) and [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action).


Updates `helm/kind-action` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](fa81e57adf...dda0770415)

Updates `docker/setup-buildx-action` from 2.8.0 to 2.9.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](16c0bc4a6e...4c0219f9ac)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 00:37:57 +00:00
Stefan Prodan
1eaf259e52 Merge pull request #4068 from fluxcd/up-deps-tests
Update dependencies
2023-07-11 14:51:19 +03:00
Stefan Prodan
bca1fa0968 Update dependencies
- bump the APIs packages in tests
- bump golang crypto and term to latest

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-11 14:14:27 +03:00
Hidde Beydals
bd79884d84 Merge pull request #4065 from fluxcd/action-toolcache
action: support `openssl` and `sha256sum`
2023-07-11 11:11:11 +02:00
Hidde Beydals
3b42b200d3 action: support openssl and sha256sum
As availability may be limited in some edge cases.

When a job is for example running within a container, `openssl` is not
always available. However, when running on a macOS or Windows runner,
the actual opposite is true.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-11 11:10:08 +02:00
souleb
dad4a20fa7 Merge pull request #4062 from souleb/fix-diff-kustomization
diff: Take into account the server-side inventory for local Flux Kustomizations
2023-07-11 10:32:38 +02:00
Soule BA
90d95988aa Take into account the server-side inventory for local diff
If implemented users will be able to use a local kustomization file while
retrieving status from the live kustomization file.

Signed-off-by: Soule BA <soule@weave.works>
2023-07-11 10:19:12 +02:00
Hidde Beydals
e88577fe52 Merge pull request #4061 from fluxcd/action-toolcache
action: re-allow configuration of non-default token
2023-07-10 16:39:52 +02:00
Hidde Beydals
6fa495b843 action: re-allow configuration of non-default token
To allow usage of action on GitHub Enterprise instances.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-10 16:25:36 +02:00
Stefan Prodan
3311bfd3ca Merge pull request #4057 from fluxcd/update-components
Update toolkit components
2023-07-10 15:32:15 +03:00
fluxcdbot
cfd4d285da Update toolkit components
- kustomize-controller to v1.0.1
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.1/CHANGELOG.md
- source-controller to v1.0.1
  https://github.com/fluxcd/source-controller/blob/v1.0.1/CHANGELOG.md
- image-reflector-controller to v0.29.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.29.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-07-10 12:02:21 +00:00
Stefan Prodan
c751bf6bdb Merge pull request #4052 from fluxcd/docs-gh-action
docs: Link to the Flux GitHub Action documentation
2023-07-07 18:10:17 +03:00
Stefan Prodan
6f94844a35 docs: Link to the Flux GitHub Action documentation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-07 17:45:51 +03:00
Hidde Beydals
f74d097837 Merge pull request #4051 from fluxcd/action-toolcache
action: use `$RUNNER_TOOL_CACHE`, support MacOS and Windows, validate checksum
2023-07-07 12:08:57 +02:00
Hidde Beydals
0a58b0cdad ci: add workflow to test action
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-07 11:56:00 +02:00
Hidde Beydals
6f94ec728f action: rewrite action to use $RUNNER_TOOL_CACHE
Plus the verification of the SHA256 of the archive, as advertised in
the checksum file published together with the release.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-07 11:50:33 +02:00
Stefan Prodan
e3747209eb Merge pull request #4043 from fluxcd/ci-release-fix-slsa-tag
ci: release: extract the image tag from GITHUB_REF
2023-07-06 11:11:01 +03:00
Stefan Prodan
36b39a50a4 ci: release: extract the image tag from GITHUB_REF
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-06 10:40:50 +03:00
Hidde Beydals
d9c7ff8685 Merge pull request #4046 from fluxcd/fix-backport
ci: backport: set write permissions
2023-07-06 09:35:23 +02:00
Stefan Prodan
625d865625 ci: backport: set write permissions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-06 10:21:16 +03:00
Hidde Beydals
00c6bd0240 Merge pull request #4041 from fluxcd/ci-release-fix-slsa
ci: release: disable interpretation backslash esc
2023-07-05 17:21:54 +02:00
Hidde Beydals
506da2466b ci: release: disable interpretation backslash esc
This ensures `jq` can properly parse the given `ARTIFACTS` JSON blob,
as it contains escaped newlines in for example the Brew formula.

This should address the issue with the generation of SLSA metadata.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-05 17:07:03 +02:00
Stefan Prodan
9ea0a535ea Merge pull request #4035 from fluxcd/up-go-deps
Update dependencies
2023-07-04 18:03:22 +03:00
Stefan Prodan
25d2a3cdf1 Bump kubectl to v1.27.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 17:37:10 +03:00
Stefan Prodan
9fa59df798 Update dependencies
- k8s.io/* v0.27.3
- github.com/fluxcd/go-git-providers v0.18.0
- github.com/fluxcd/pkg/git v0.12.3
- github.com/fluxcd/pkg/oci v0.28.0
- github.com/fluxcd/pkg/runtime v0.40.0
- github.com/fluxcd/pkg/ssa v0.28.2
- github.com/fluxcd/pkg/ssh v0.8.0
- github.com/homeport/dyff v1.5.8
- golang.org/x/crypto v0.10.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 17:35:34 +03:00
Stefan Prodan
93c0467f91 Merge pull request #4006 from fluxcd/update-components
Update toolkit components
2023-07-04 17:22:34 +03:00
fluxcdbot
c377fe7651 Update toolkit components
- helm-controller to v0.35.0
  https://github.com/fluxcd/helm-controller/blob/v0.35.0/CHANGELOG.md
- kustomize-controller to v1.0.0
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0/CHANGELOG.md
- source-controller to v1.0.0
  https://github.com/fluxcd/source-controller/blob/v1.0.0/CHANGELOG.md
- notification-controller to v1.0.0
  https://github.com/fluxcd/notification-controller/blob/v1.0.0/CHANGELOG.md
- image-reflector-controller to v0.29.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.29.0/CHANGELOG.md
- image-automation-controller to v0.35.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.35.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-07-04 12:26:47 +00:00
Stefan Prodan
9ed24522bb Merge pull request #4033 from fluxcd/docs-release-links
docs: link to releases spec from website
2023-07-04 15:26:15 +03:00
Stefan Prodan
ddcabbf95d docs: link to releases spec from website
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 15:13:06 +03:00
Stefan Prodan
5c58b45340 Merge pull request #4031 from fluxcd/ci-e2e-k8s
Run conformance tests for Kubernetes v1.27.3
2023-07-04 14:59:55 +03:00
Stefan Prodan
5690b639cd Run conformance tests for Kubernetes v1.27.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 14:46:43 +03:00
Stefan Prodan
22d0ff8173 Merge pull request #4029 from fluxcd/ci-release-workflows
Run e2e tests on release branches
2023-07-04 14:11:03 +03:00
Stefan Prodan
8e61fe805c ci: group all GH action updates under the same PR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 13:43:22 +03:00
Stefan Prodan
5356436c94 ci: enable workflows for release/** branches
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 13:27:33 +03:00
Stefan Prodan
8ca8b92f92 ci: run backport under fluxcdbot account
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-04 12:21:22 +03:00
Stefan Prodan
7c98f20e11 Merge pull request #3254 from fluxcd/docs-release-spec
Flux GA release spec and long term support pledge
2023-07-03 16:57:09 +03:00
Stefan Prodan
1a8798a5d4 Link to release cadence from minor section
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:11 +03:00
Hidde Beydals
926842a216 Address review comment section titles
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 16:41:08 +03:00
Hidde Beydals
9e11b860ec Address release procedure review nits
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 16:41:08 +03:00
Hidde Beydals
5abf1ee817 Address various nits
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 16:41:08 +03:00
Hidde Beydals
4e78e80619 Document various release procedures
This lacks documentation for the Terraform provider repository, which
is a higher level component than anything documented here.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 16:41:08 +03:00
Stefan Prodan
33be9840f0 Apply suggestions from code review
Co-authored-by: Max Jonas Werner <makkes@users.noreply.github.com>
Co-authored-by: Aurel Canciu <aurelcanciu@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:08 +03:00
Stefan Prodan
33fdaee399 Move the release procedures to dedicated doc
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
91660a98d5 Add SLSA provenance to release artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
8d5c4492d8 Apply suggestions from code review
Co-authored-by: Aurel Canciu <aurelcanciu@gmail.com>
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
29ad52bb46 Add Flux release spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
590b7b7682 Add controller release artifacts spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
ea06d9614f Add API versioning spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
41ba55634a Add controller release spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
f09616e780 Add shared packages release spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:07 +03:00
Stefan Prodan
a4d7e35cdd Cleanup internal docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-07-03 16:41:06 +03:00
Stefan Prodan
346e0ea734 Merge pull request #4028 from fluxcd/prefix-ggp-error
Annotate errors from go-git-providers
2023-07-03 16:38:58 +03:00
Max Jonas Werner
ce854236cf Annotate errors from go-git-providers
closes #3623

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-07-03 13:55:53 +02:00
Hidde Beydals
1588663358 Merge pull request #4027 from fluxcd/bump-gogit
Update go-git to unreleased v5.8.0
2023-07-03 13:39:53 +02:00
Hidde Beydals
68fdc0a2b6 Update go-git to unreleased v5.8.0
To improve support for Git >=v2.41.0.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 12:55:59 +02:00
Stefan Prodan
d335f8f981 Merge pull request #4025 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.8.0
build(deps): bump docker/setup-buildx-action from 2.7.0 to 2.8.0
2023-06-30 18:01:28 +03:00
dependabot[bot]
b4efd15afd build(deps): bump docker/setup-buildx-action from 2.7.0 to 2.8.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](ecf95283f0...16c0bc4a6e)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 14:47:48 +00:00
Stefan Prodan
0e6f9da761 Merge pull request #4024 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.1.1
build(deps): bump sigstore/cosign-installer from 3.1.0 to 3.1.1
2023-06-30 17:47:07 +03:00
dependabot[bot]
02b34f05c8 build(deps): bump sigstore/cosign-installer from 3.1.0 to 3.1.1
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](d13028333d...6e04d228eb)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 14:29:43 +00:00
Stefan Prodan
f26800eb85 Merge pull request #4023 from fluxcd/backport-automation
Add backport GitHub Action workflow
2023-06-30 17:29:19 +03:00
Stefan Prodan
d2cc01169b Declaratively define (and sync) labels
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-30 17:04:12 +03:00
Stefan Prodan
d8924cd8a9 Add backport GitHub Action workflow
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-30 16:55:54 +03:00
Stefan Prodan
25af5d2968 Merge pull request #3755 from rishinair11/add_multiple_args
Allow multiple arguments for "flux suspend/resume"
2023-06-29 11:20:12 +03:00
Rishikesh Nair
3580d4ff85 Add examples for resuming/suspending multiple objects
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
2023-06-29 12:50:38 +05:30
Rishikesh Nair
42607aadc3 Add support for passing multiple objects to suspend/resume commands
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

closes #3746
closes #3793

Co-Authored-By: Max Jonas Werner <mail@makk.es>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-29 08:23:13 +02:00
Stefan Prodan
2fe86a4cde Merge pull request #4020 from fluxcd/min-kube-1.24
Set minimum supported version to Kubernetes 1.24.0
2023-06-28 18:33:19 +03:00
Stefan Prodan
db0256e0f7 Set minimum supported version to Kubernetes 1.24.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-28 17:36:04 +03:00
Stefan Prodan
224e808c21 Merge pull request #4018 from fluxcd/fix-push-aws-doc
docs: Fix the `flux push` example for ECR
2023-06-27 17:59:45 +03:00
Stefan Prodan
6ed6b937f8 Fix the flux push example for ECR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-27 16:33:40 +03:00
Stefan Prodan
99b940f56f Merge pull request #4015 from fluxcd/go.mod-1.20
Align `go.mod` version with Kubernetes (Go 1.20)
2023-06-27 08:35:52 +03:00
Stefan Prodan
66a417a3ee Bump Go to 1.20 in aur deps
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-26 19:52:26 +03:00
Stefan Prodan
761762bdc0 Align go.mod version with Kubernetes (Go 1.20)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-26 19:36:20 +03:00
Sanskar Jaiswal
bd8ada9e4a Merge pull request #3990 from fluxcd/rfc-insecure-http
RFC-0004: add section about proxy
2023-06-26 19:27:50 +05:30
Sanskar Jaiswal
ba5c7e4fc3 RFC-0004: add section about proxy
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-06-26 19:07:18 +05:30
Stefan Prodan
903284fe59 Merge pull request #4008 from fluxcd/slsa3
Add SLSA3 generators to release workflow
2023-06-26 13:21:01 +03:00
Stefan Prodan
cf7ee0081c Add SLSA3 generators to release workflow
Generate SLSA level 3 provenance attestations for the release assets and for the multi-arch container images.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-26 12:40:35 +03:00
Hidde Beydals
e6a1d8156b Merge pull request #4012 from fluxcd/dependabot/github_actions/ossf/scorecard-action-2.2.0
build(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0
2023-06-26 10:56:52 +02:00
dependabot[bot]
b850f51ef5 build(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](80e868c13c...08b4669551)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 08:40:29 +00:00
Hidde Beydals
4e57de4776 Merge pull request #4011 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.1.0
build(deps): bump sigstore/cosign-installer from 3.0.5 to 3.1.0
2023-06-26 10:39:50 +02:00
dependabot[bot]
0a2945e7f1 build(deps): bump sigstore/cosign-installer from 3.0.5 to 3.1.0
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.0.5 to 3.1.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](dd6b2e2b61...d13028333d)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 08:27:20 +00:00
Hidde Beydals
4f9beae49d Merge pull request #4010 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.14.3
build(deps): bump anchore/sbom-action from 0.14.2 to 0.14.3
2023-06-26 09:58:53 +02:00
dependabot[bot]
15a49334d8 build(deps): bump anchore/sbom-action from 0.14.2 to 0.14.3
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.14.2 to 0.14.3.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](4d571ad103...78fc58e266)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 01:16:48 +00:00
Max Jonas Werner
cf5e7c39e0 Merge pull request #4002 from fluxcd/fix-get-all
Don't log errors with missing CRDs for "get * all" commands
2023-06-22 18:40:27 +02:00
Max Jonas Werner
173ee5fcdc Don't log errors with missing CRDs for "get * all" commands
Whenever an API type is not available then both, `flux get all` and
`flux get image all` will just skip over that type instead of logging
an error message.

Before:

```
$ flux get all
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: source.toolkit.fluxcd.io/v1beta2: the server
could not find the requested resource
[...]
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
[...]
$ echo $?
0
```

After:

```
$ flux get all
$ echo $?
0
```
closes #3973

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-22 18:03:38 +02:00
Stefan Prodan
67968dff7e Merge pull request #3981 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.7.0
build(deps): bump docker/setup-buildx-action from 2.6.0 to 2.7.0
2023-06-19 14:30:15 +03:00
dependabot[bot]
c596c70d42 build(deps): bump docker/setup-buildx-action from 2.6.0 to 2.7.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](6a58db7e0d...ecf95283f0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:07:15 +00:00
Max Jonas Werner
d30c3aef32 Merge pull request #3983 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-5.0.2
build(deps): bump peter-evans/create-pull-request from 5.0.1 to 5.0.2
2023-06-19 12:58:51 +02:00
dependabot[bot]
f7e5101753 build(deps): bump peter-evans/create-pull-request from 5.0.1 to 5.0.2
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](284f54f989...153407881e)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 10:37:22 +00:00
Stefan Prodan
597b13d1b3 Merge pull request #3982 from fluxcd/dependabot/github_actions/goreleaser/goreleaser-action-4.3.0
build(deps): bump goreleaser/goreleaser-action from 4.2.0 to 4.3.0
2023-06-19 13:36:38 +03:00
dependabot[bot]
2b8385a874 build(deps): bump goreleaser/goreleaser-action from 4.2.0 to 4.3.0
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](f82d6c1c34...336e29918d)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 01:17:57 +00:00
Hidde Beydals
ddcc301ab6 Merge pull request #3976 from darklore/brew-completion
Use equivalent and shorter way to generate shell completions
2023-06-14 22:00:11 +02:00
Katsunori Tanaka
ab983c678f Use equivalent and shorter way to generate shell completions
Signed-off-by: Katsunori Tanaka <958690+darklore@users.noreply.github.com>
2023-06-15 01:18:18 +09:00
Sunny
79dfbec910 Merge pull request #3955 from somtochiama/fix-kustomize-deprecated
Fix 'patchesJson6902' is deprecated' warning
2023-06-14 21:18:14 +05:30
Somtochi Onyekwere
6bf439d4ce fix 'patchesJson6902' is deprecated' warning
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-06-14 16:32:27 +01:00
Max Jonas Werner
063c5ee328 Merge pull request #3967 from fluxcd/dependabot/github_actions/docker/login-action-2.2.0
build(deps): bump docker/login-action from 2.1.0 to 2.2.0
2023-06-12 12:44:58 +02:00
dependabot[bot]
19137b8e8c build(deps): bump docker/login-action from 2.1.0 to 2.2.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](f4ef78c080...465a07811f)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 10:10:29 +00:00
Max Jonas Werner
95aa30ad41 Merge pull request #3966 from fluxcd/dependabot/github_actions/docker/setup-qemu-action-2.2.0
build(deps): bump docker/setup-qemu-action from 2.1.0 to 2.2.0
2023-06-12 12:09:21 +02:00
dependabot[bot]
55aa96a33a build(deps): bump docker/setup-qemu-action from 2.1.0 to 2.2.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](e81a89b173...2b82ce82d5)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 09:53:46 +00:00
Max Jonas Werner
5460348450 Merge pull request #3965 from fluxcd/dependabot/github_actions/actions/checkout-3.5.3
build(deps): bump actions/checkout from 3.5.2 to 3.5.3
2023-06-12 11:53:08 +02:00
dependabot[bot]
0d1a68ecb4 build(deps): bump actions/checkout from 3.5.2 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e5e7e5ab8...c85c95e3d7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 09:39:54 +00:00
Max Jonas Werner
98466220c7 Merge pull request #3964 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.6.0
build(deps): bump docker/setup-buildx-action from 2.5.0 to 2.6.0
2023-06-12 11:39:14 +02:00
dependabot[bot]
6d2dd076dc build(deps): bump docker/setup-buildx-action from 2.5.0 to 2.6.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](4b4e9c3e2d...6a58db7e0d)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 09:25:10 +00:00
Max Jonas Werner
5e07bcb79a Merge pull request #3968 from fluxcd/dependabot/github_actions/github/codeql-action-2.13.4
build(deps): bump github/codeql-action from 2.3.6 to 2.13.4
2023-06-12 11:24:32 +02:00
dependabot[bot]
9c81a74743 build(deps): bump github/codeql-action from 2.3.6 to 2.13.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.6 to 2.13.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](83f0fe6c49...cdcdbb5797)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 01:20:41 +00:00
Max Jonas Werner
a3f2b1d829 Merge pull request #3945 from fluxcd/lenient-logs-cmd
Make `flux logs` more lenient
2023-06-05 10:19:54 +02:00
Max Jonas Werner
cbdd71e44e Make flux logs more lenient
UX changes:

- Only print an error when a pod doesn't have a matching container
  instead of exiting early.
- Return a non-zero status code when no pod is found at all.

Details:

In certain situations there might be 3rd-party pods running in the
Flux namespace that cause the command to fail streaming logs, e.g.
when they have multiple containers but none of them is called
`manager` (which all Flux-maintained pods do). An example of such a
situation is when Flux is installed with the 3rd-party Flux extension
on AKS.

The `logs` command is now more forgiving and merely logs an error in
these situations instead of completely bailing out. It still returns a
non-zero exit code.

For the parallel log streaming with `-f` the code is now a little more
complex so that errors are now written to stderr in parallel with all
other logs written to stdout. That's what `asyncCopy` is for.

refs #3944

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-05 10:07:38 +02:00
Max Jonas Werner
f01cf5e04c Merge pull request #3952 from fluxcd/dependabot/github_actions/github/codeql-action-2.3.6
build(deps): bump github/codeql-action from 2.3.5 to 2.3.6
2023-06-05 08:29:33 +02:00
dependabot[bot]
bbb3063cb2 build(deps): bump github/codeql-action from 2.3.5 to 2.3.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.5 to 2.3.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0225834cc5...83f0fe6c49)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 01:19:20 +00:00
Hidde Beydals
c0fa6e6939 Merge pull request #3940 from somtochiama/fix-azure
Set controller runtime logger in Azure e2e tests
2023-06-01 13:04:50 +02:00
Somtochi Onyekwere
0337362eec return clone error
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-06-01 12:49:09 +02:00
Somtochi Onyekwere
fb3013cb95 set logger for controller runtime
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-06-01 12:49:09 +02:00
Hidde Beydals
833fec3d21 Merge pull request #3943 from fluxcd/update-components
Update toolkit components
2023-06-01 12:48:44 +02:00
Hidde Beydals
007b79c729 Update github.com/fluxcd/pkg/git/gogit to v0.12.0
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-01 12:28:52 +02:00
Hidde Beydals
09f55955e8 tests/azure: update dependencies
- github.com/Azure/azure-event-hubs-go/v3 to v3.6.0
- github.com/fluxcd/helm-controller/api to v0.34.1
- github.com/fluxcd/image-automation-controller/api to v0.34.1
- github.com/fluxcd/pkg/git/gogit to v0.12.0
- github.com/fluxcd/source-controller/api to v1.0.0-rc.5
- github.com/stretchr/testify to v1.8.4

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-06-01 12:07:58 +02:00
fluxcdbot
29c2c72d8f Update toolkit components
- helm-controller to v0.34.1
  https://github.com/fluxcd/helm-controller/blob/v0.34.1/CHANGELOG.md
- source-controller to v1.0.0-rc.5
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.5/CHANGELOG.md
- image-automation-controller to v0.34.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.34.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-06-01 10:01:54 +00:00
Sanskar Jaiswal
ae9b541ce2 Merge pull request #3938 from fluxcd/e2e-azure-main
e2e: Run e2e Azure tests for PRs to main if tests or wofklow changes
2023-05-31 21:34:20 +05:30
Sanskar Jaiswal
8d86637d3f e2e: run e2e Azure tests for PRs to main if tests or wofklow changes
Run e2e Azure tests for PRs and commits to main if the `tests` directory
or the Azure workflow itself changes.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-05-31 18:07:40 +05:30
Sanskar Jaiswal
390ff1bcf7 Merge pull request #3932 from aryan9600/null-logger
Set `controller-runtime` logger to a null logger
2023-05-30 15:23:57 +05:30
Sanskar Jaiswal
aa65589391 set controller-runtime logger to a null logger
This is required because controller-runtime expects its consumers to
set a logger through log.SetLogger within 30 seconds of the program's
initalization. If not set, the entire debug stack is printed as an
error. Ref: https://github.com/kubernetes-sigs/controller-runtime/blob/ed8be90/pkg/log/log.go#L59
Since we have our own logging and don't care about controller-runtime's
logger, we configure it's logger to do nothing.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-05-30 14:40:17 +05:30
Stefan Prodan
9ee23a9086 Merge pull request #3929 from fluxcd/up-git-pkg
Update Git packages
2023-05-29 14:29:50 +03:00
Stefan Prodan
41cdd3dcf7 Update Git packages
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-29 14:13:56 +03:00
Stefan Prodan
aba5741450 Merge pull request #3922 from fluxcd/update-components
Update toolkit components
2023-05-29 13:33:08 +03:00
fluxcdbot
cb5eb417c5 Update toolkit components
- helm-controller to v0.34.0
  https://github.com/fluxcd/helm-controller/blob/v0.34.0/CHANGELOG.md
- kustomize-controller to v1.0.0-rc.4
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0-rc.4/CHANGELOG.md
- source-controller to v1.0.0-rc.4
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.4/CHANGELOG.md
- notification-controller to v1.0.0-rc.4
  https://github.com/fluxcd/notification-controller/blob/v1.0.0-rc.4/CHANGELOG.md
- image-reflector-controller to v0.28.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.28.0/CHANGELOG.md
- image-automation-controller to v0.34.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.34.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-05-29 10:04:34 +00:00
Stefan Prodan
9f8b8b624b Merge pull request #3928 from fluxcd/k8s-1.27.2
Update kubectl to v1.27.2 in flux-cli image
2023-05-29 13:03:52 +03:00
Stefan Prodan
8728b07e85 Update kubectl to v1.27.2 in flux-cli image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-29 12:47:54 +03:00
Stefan Prodan
e1ffd83b64 Merge pull request #3918 from somtochiama/retry-oci-push
Retry oci push operations
2023-05-29 12:14:24 +03:00
Somtochi Onyekwere
020a494f3f Retry oci push operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-05-29 09:59:47 +01:00
Stefan Prodan
96ed1e1372 Merge pull request #3927 from fluxcd/dependabot/github_actions/github/codeql-action-2.3.5
build(deps): bump github/codeql-action from 2.3.3 to 2.3.5
2023-05-29 10:54:54 +03:00
dependabot[bot]
860682e476 build(deps): bump github/codeql-action from 2.3.3 to 2.3.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.3 to 2.3.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](29b1f65c5e...0225834cc5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 07:24:59 +00:00
Stefan Prodan
2903b4910c Merge pull request #3926 from fluxcd/dependabot/github_actions/snyk/actions-b98d498629f1c368650224d6d212bf7dfa89e4bf
build(deps): bump snyk/actions from 806182742461562b67788a64410098c9d9b96adb to b98d498629f1c368650224d6d212bf7dfa89e4bf
2023-05-29 10:24:22 +03:00
dependabot[bot]
c07e33eff0 build(deps): bump snyk/actions
Bumps [snyk/actions](https://github.com/snyk/actions) from 806182742461562b67788a64410098c9d9b96adb to b98d498629f1c368650224d6d212bf7dfa89e4bf.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](8061827424...b98d498629)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 01:21:22 +00:00
Stefan Prodan
a5b1b04915 Merge pull request #3924 from hgranillo/main
Fix break lines in create helmrelease and source
2023-05-26 17:21:31 +03:00
Horacio Granillo
799848c2a0 Fix break lines in create helmrelease and source
Signed-off-by: Horacio Granillo <horacio.granillo@smarttra.de>
2023-05-26 15:37:55 +02:00
Stefan Prodan
7e6cd34071 Merge pull request #3675 from raffis/feat-reconcilechart
feat: add reconcile source chart command
2023-05-25 15:05:08 +03:00
Raffael Sahli
b8c24f906d fix: support reconcile recursive source tree hr => chart => repo
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-05-25 13:40:21 +02:00
Raffael Sahli
e678738ded feat: add reconcile source chart command
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-05-25 13:40:21 +02:00
Stefan Prodan
9000be6daa Merge pull request #3910 from fluxcd/k8s-1.27
Update Kubernetes to v1.27 and Kustomize to v5.0
2023-05-24 10:29:58 +03:00
Stefan Prodan
13ff4afaa4 Update Kubernetes to v1.27 and Kustomize to v5.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-23 18:49:47 +03:00
Hidde Beydals
40b9c07641 Merge pull request #3903 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.0.5
build(deps): bump sigstore/cosign-installer from 3.0.3 to 3.0.5
2023-05-22 09:36:11 +02:00
dependabot[bot]
0ce5117715 build(deps): bump sigstore/cosign-installer from 3.0.3 to 3.0.5
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.0.3 to 3.0.5.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](204a51a57a...dd6b2e2b61)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 07:17:20 +00:00
Hidde Beydals
526d154172 Merge pull request #3902 from fluxcd/dependabot/github_actions/actions/setup-go-4.0.1 2023-05-22 09:16:32 +02:00
dependabot[bot]
9e422576b8 build(deps): bump actions/setup-go from 4.0.0 to 4.0.1
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](4d34df0c23...fac708d667)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 07:06:34 +00:00
Stefan Prodan
069bca29d1 Merge pull request #3901 from fluxcd/dependabot/github_actions/helm/kind-action-1.7.0
build(deps): bump helm/kind-action from 1.5.0 to 1.7.0
2023-05-22 09:59:42 +03:00
dependabot[bot]
34ac124b6b build(deps): bump helm/kind-action from 1.5.0 to 1.7.0
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.5.0 to 1.7.0.
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](d8ccf8fb62...fa81e57adf)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 01:22:42 +00:00
Stefan Prodan
e475a22435 Merge pull request #3883 from fluxcd/update-az-deps
e2e: Update dependencies
2023-05-12 15:37:08 +03:00
Stefan Prodan
d1ec628d6c e2e: Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-12 15:12:25 +03:00
Stefan Prodan
d13227b277 Merge pull request #3882 from fluxcd/update-components
Update toolkit components
2023-05-12 15:07:41 +03:00
fluxcdbot
fcb992240e Update toolkit components
- helm-controller to v0.33.0
  https://github.com/fluxcd/helm-controller/blob/v0.33.0/CHANGELOG.md
- kustomize-controller to v1.0.0-rc.3
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0-rc.3/CHANGELOG.md
- source-controller to v1.0.0-rc.3
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.3/CHANGELOG.md
- notification-controller to v1.0.0-rc.3
  https://github.com/fluxcd/notification-controller/blob/v1.0.0-rc.3/CHANGELOG.md
- image-reflector-controller to v0.27.2
  https://github.com/fluxcd/image-reflector-controller/blob/v0.27.2/CHANGELOG.md
- image-automation-controller to v0.33.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.33.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-05-12 11:46:20 +00:00
Stefan Prodan
cf5eb6a0bc Merge pull request #3879 from fluxcd/resourcequota
Add ResourceQuota for critical pods
2023-05-12 12:12:08 +03:00
Stefan Prodan
2aa38baa35 Add ResourceQuota for critical pods
Fixes insufficient quota error on GKE

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-12 11:34:54 +03:00
Stefan Prodan
84d046ab2a Merge pull request #3880 from fluxcd/ossf-scorecard
Add OSSF Scorecard
2023-05-12 10:56:42 +03:00
Stefan Prodan
29b08fc306 Add OSSF Scorecard
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-12 10:42:46 +03:00
Stefan Prodan
a7153a0ff5 Merge pull request #3876 from fluxcd/dependabot/go_modules/tests/azure/github.com/cloudflare/circl-1.3.3
build(deps): bump github.com/cloudflare/circl from 1.3.2 to 1.3.3 in /tests/azure
2023-05-12 09:07:47 +03:00
dependabot[bot]
bc67308f85 build(deps): bump github.com/cloudflare/circl in /tests/azure
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.2...v1.3.3)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-12 05:47:08 +00:00
Stefan Prodan
6e93a87265 Merge pull request #3875 from fluxcd/dependabot/go_modules/github.com/cloudflare/circl-1.3.3
build(deps): bump github.com/cloudflare/circl from 1.3.2 to 1.3.3
2023-05-12 08:46:00 +03:00
dependabot[bot]
6fd1f794f9 build(deps): bump github.com/cloudflare/circl from 1.3.2 to 1.3.3
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.2...v1.3.3)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-12 05:30:40 +00:00
Stefan Prodan
5942e65b1c Merge pull request #3877 from fluxcd/dependabot/go_modules/github.com/docker/distribution-2.8.2incompatible
build(deps): bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible
2023-05-12 08:29:33 +03:00
dependabot[bot]
77d670c224 build(deps): bump github.com/docker/distribution
Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](https://github.com/docker/distribution/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-11 20:48:22 +00:00
Hidde Beydals
70546e5dfe Merge pull request #3866 from onedr0p/main
Update Alpine to 3.18
2023-05-10 17:32:15 +02:00
Devin Buhl
fec7dfefa4 Update Alpine to 3.18
This change would be nice to get in because MUSL finally implemented TCP fallback in their DNS resolver.

alpinelinux.org/posts/Alpine-3.18.0-released.html

Signed-off-by: Devin Buhl <devin@buhl.casa>
2023-05-10 09:47:59 -04:00
Stefan Prodan
9a8944df94 Merge pull request #3858 from fluxcd/update-components
Update toolkit components
2023-05-09 18:51:03 +03:00
fluxcdbot
ace242fca2 Update toolkit components
- kustomize-controller to v1.0.0-rc.2
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- source-controller to v1.0.0-rc.2
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- notification-controller to v1.0.0-rc.2
  https://github.com/fluxcd/notification-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- image-reflector-controller to v0.27.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.27.1/CHANGELOG.md
- image-automation-controller to v0.33.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.33.0/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-09 18:34:03 +03:00
Stefan Prodan
96d4034a74 Merge pull request #3860 from bigkevmcd/azure-devops-summary
e2e: Add summary to Azure Alert
2023-05-09 17:05:26 +03:00
Kevin McDermott
2e3624d636 Add summary to Azure Alert.
This updates the Azure alert testing to add a summary which should be
sent to Azure as a commit-status genre.

Signed-off-by: Kevin McDermott <kevin@weave.works>
2023-05-09 14:38:15 +01:00
Stefan Prodan
cb54bbcd97 Merge pull request #3853 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.14.2
build(deps): bump anchore/sbom-action from 0.14.1 to 0.14.2
2023-05-09 10:34:18 +03:00
dependabot[bot]
847e78541a build(deps): bump anchore/sbom-action from 0.14.1 to 0.14.2
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.14.1 to 0.14.2.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](422cb34a0f...4d571ad103)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 13:06:08 +00:00
Stefan Prodan
ad3eebcf63 Merge pull request #3857 from talife/auto-completion-image-repository
Fix autocompletion for image repository reconcile
2023-05-08 15:30:53 +03:00
Vincent Gillet
86df468c3f Fix autocompletion for image repository reconcile
Signed-off-by: Vincent Gillet <gilletvincent@gmail.com>
2023-05-08 20:14:19 +08:00
Max Jonas Werner
2cf2486a2b Merge pull request #3854 from fluxcd/dependabot/github_actions/github/codeql-action-2.3.3
build(deps): bump github/codeql-action from 2.3.2 to 2.3.3
2023-05-08 08:39:30 +02:00
dependabot[bot]
4d443d614b build(deps): bump github/codeql-action from 2.3.2 to 2.3.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f3feb00acb...29b1f65c5e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 06:26:05 +00:00
Max Jonas Werner
50968ec1a6 Merge pull request #3855 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-5.0.1
build(deps): bump peter-evans/create-pull-request from 5.0.0 to 5.0.1
2023-05-08 08:25:23 +02:00
dependabot[bot]
38ada0b998 build(deps): bump peter-evans/create-pull-request from 5.0.0 to 5.0.1
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](5b4a9f6a9e...284f54f989)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 01:03:23 +00:00
Stefan Prodan
0b0f9827b9 Merge pull request #3849 from fluxcd/bump-ggp
Update fluxcd/go-git-providers to v0.15.3
2023-05-04 13:24:13 +03:00
Max Jonas Werner
88b5e3f71b bump ggp to latest version
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-05-04 11:44:27 +02:00
Hidde Beydals
bc608dc130 Merge pull request #3796 from fluxcd/update-components
Update toolkit components
2023-05-03 11:31:17 +02:00
fluxcdbot
961c237d33 Update toolkit components
- helm-controller to v0.32.2
  https://github.com/fluxcd/helm-controller/blob/v0.32.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-05-02 15:57:21 +00:00
Stefan Prodan
73e2f56ff5 Merge pull request #3802 from fluxcd/system-cluster-critical
Set priority class for the critical Flux components
2023-05-02 18:56:46 +03:00
Stefan Prodan
a122ceb09b Set priority class to critical Flux components
Mark source-controller, kustomize-controller and helm-controller as system-cluster-critical.
This will reduce the chances of Flux controllers being evicted before other non-critical workloads.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-02 15:06:30 +03:00
Stefan Prodan
b30d7cb3dc Merge pull request #3795 from fluxcd/e2e-kube-1.27
Run conformance tests for Kubernetes 1.27
2023-05-02 15:02:36 +03:00
Stefan Prodan
cd81362781 Run conformance tests for Kubernetes 1.27
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-02 14:24:31 +03:00
Hidde Beydals
63abf0b840 Merge pull request #3833 from matheuscscp/oci-provider
Add OCI provider option to create Helm source command
2023-05-02 11:50:56 +02:00
Matheus Pimenta
56d265ae11 Add OCI provider option to create Helm source command
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-05-02 10:08:40 +01:00
Max Jonas Werner
c0c76da4c8 Merge pull request #3830 from cuishuang/main
misc: fix some comments
2023-05-02 08:34:29 +02:00
cui fliter
3edfff49a2 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-01 18:05:10 +02:00
Hidde Beydals
f9be835288 Merge pull request #3837 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.0.3
build(deps): bump sigstore/cosign-installer from 3.0.2 to 3.0.3
2023-05-01 10:41:03 +02:00
dependabot[bot]
86e542e524 build(deps): bump sigstore/cosign-installer from 3.0.2 to 3.0.3
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](9e9de2292d...204a51a57a)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 08:07:56 +00:00
Hidde Beydals
f28e189cf5 Merge pull request #3838 from fluxcd/dependabot/github_actions/github/codeql-action-2.3.2
build(deps): bump github/codeql-action from 2.3.0 to 2.3.2
2023-05-01 10:05:28 +02:00
dependabot[bot]
2538b6921f build(deps): bump github/codeql-action from 2.3.0 to 2.3.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.0 to 2.3.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b2c19fb9a2...f3feb00acb)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 01:09:35 +00:00
Max Jonas Werner
83525807a2 Merge pull request #3821 from fluxcd/bump-ggp
Make bootstrap work with Bitbucket Server again
2023-04-24 11:28:10 +02:00
Max Jonas Werner
c6a61c1b92 fix: make bootstrap work with Bitbucket Server again
Bumping GGP to include fluxcd/go-git-provider#210 and fix the
bootstrap process with Bitbucket Server.

closes #3808

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-24 10:13:41 +02:00
Max Jonas Werner
0257171cf5 Merge pull request #3827 from fluxcd/dependabot/github_actions/github/codeql-action-2.3.0
build(deps): bump github/codeql-action from 2.2.12 to 2.3.0
2023-04-24 10:10:00 +02:00
dependabot[bot]
f431f9858c build(deps): bump github/codeql-action from 2.2.12 to 2.3.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.12 to 2.3.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7df0ce3489...b2c19fb9a2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 01:13:50 +00:00
Max Jonas Werner
71e9230789 Merge pull request #3822 from Hey/patch-1
Outdated Loki Helm values URL
2023-04-21 10:05:58 +02:00
Hey
08859f1588 Outdated URL
The location of this URL was moved

Signed-off-by: Hey <18427051+Hey@users.noreply.github.com>
2023-04-20 21:35:15 +02:00
Hidde Beydals
d0a255c84a Merge pull request #3805 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.12
build(deps): bump github/codeql-action from 2.2.11 to 2.2.12
2023-04-17 11:40:42 +02:00
dependabot[bot]
ec6f341497 build(deps): bump github/codeql-action from 2.2.11 to 2.2.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.11 to 2.2.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d186a2a36c...7df0ce3489)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-17 08:17:17 +00:00
Stefan Prodan
811b26275f Merge pull request #3804 from fluxcd/dependabot/github_actions/actions/checkout-3.5.2
build(deps): bump actions/checkout from 3.5.0 to 3.5.2
2023-04-17 11:14:19 +03:00
dependabot[bot]
107894eccf build(deps): bump actions/checkout from 3.5.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8f4b7f8486...8e5e7e5ab8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-17 01:10:39 +00:00
Max Jonas Werner
cb8387cba6 Merge pull request #3797 from fluxcd/improve-messaging
better messaging for `pull artifact` command
2023-04-13 13:20:53 +02:00
Max Jonas Werner
6700aac4a4 better messaging for pull artifact command
- When there's an error stat'ing the output directory flux now prints
  the error:

  Before:
  ```
  ✗ invalid output path ./ro-dir/foo
  ```

  After:
  ```
  ✗ invalid output path "./ro-dir/foo": stat ./ro-dir/foo: permission denied
  ```
- When no output directory is provided flux now explicitly says so in
  the error:

  Before:
  ```
  ✗ invalid output path
  ```

  After:
  ```
  ✗ output path cannot be empty
  ```

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-13 12:43:49 +02:00
Aurel Canciu
3d1173a2cd Merge pull request #3768 from relu/fix-aur-publish-pre
Fix publishing pre-release versions to AUR
2023-04-12 12:18:55 +02:00
Aurel Canciu
52c7cca3fc Fix publishing pre-release versions to AUR
Fixes #3767

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2023-04-12 11:59:56 +02:00
Stefan Prodan
9a59a90187 Merge pull request #3783 from aryan9600/clean-dir
Clean directory before cloning git repo
2023-04-12 12:14:23 +03:00
Sanskar Jaiswal
08370cb3a6 clean dir before cloning git repo
Remove all files/subdirs from the directory we are cloning into. This is
needed because go-git returns a `repository already exists` error if
the directory is non-empty, which is possible since we retry cloning
(into the same dir) if the first attempt fails.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-04-12 14:29:45 +05:30
Stefan Prodan
2dce1f23b0 Merge pull request #3764 from somtochiama/get-selector
Add label selector flag to get cmd
2023-04-11 19:20:27 +03:00
Somtochi Onyekwere
a52f5aaa75 Add label selector flag to get cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-11 17:00:57 +01:00
Max Jonas Werner
ef5f7bca64 Merge pull request #3778 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-3.0.2
build(deps): bump sigstore/cosign-installer from 3.0.1 to 3.0.2
2023-04-11 08:48:22 +02:00
dependabot[bot]
1435c71d9c build(deps): bump sigstore/cosign-installer from 3.0.1 to 3.0.2
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](c3667d9942...9e9de2292d)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 11:36:28 +00:00
Stefan Prodan
0d2517b96d Merge pull request #3780 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.11
build(deps): bump github/codeql-action from 2.2.9 to 2.2.11
2023-04-10 14:35:46 +03:00
dependabot[bot]
48a1c0f5d4 build(deps): bump github/codeql-action from 2.2.9 to 2.2.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.9 to 2.2.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](04df1262e6...d186a2a36c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 07:52:00 +00:00
Stefan Prodan
64fb04b77b Merge pull request #3779 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-5.0.0
build(deps): bump peter-evans/create-pull-request from 4.2.4 to 5.0.0
2023-04-10 10:51:22 +03:00
dependabot[bot]
2696a93ee0 build(deps): bump peter-evans/create-pull-request from 4.2.4 to 5.0.0
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.4 to 5.0.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](38e0b6e68b...5b4a9f6a9e)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 01:03:48 +00:00
Stefan Prodan
c350e300f9 Merge pull request #3763 from souleb/feat-ignore
Add the possibility to ignore files with build and diff Kustomization
2023-04-06 12:46:15 +03:00
Soule BA
b74638c25c Add the possibility to ignore files with build and diff ks
If implemented, user will be able to ignore files when using `build
kustomization` and `diff kustomization` both with .sourceignore and
`ignore-paths` flag.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2023-04-06 11:33:13 +02:00
Stefan Prodan
f00fee5328 Merge pull request #3762 from fluxcd/dependabot/go_modules/github.com/docker/docker-23.0.3incompatible
build(deps): bump github.com/docker/docker from 23.0.1 to 23.0.3
2023-04-06 12:01:38 +03:00
dependabot[bot]
c3aa940c2b build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-06 08:48:02 +00:00
Stefan Prodan
3fc15c42c4 Merge pull request #3758 from fluxcd/release-v2.0.0-rc.1
Release Flux v2.0.0-rc.1
2023-04-06 11:47:04 +03:00
Stefan Prodan
f0c498ff54 Add support for .sourceignore to flux build/diff
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-05 16:33:34 +03:00
Stefan Prodan
cecffc0588 Add commonMetadata to flux build/diff
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-05 16:09:49 +03:00
Stefan Prodan
9293781702 Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-05 16:07:34 +03:00
Sanskar Jaiswal
97b064be13 add a preview note for all non-bootstrap commands
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-04-05 16:05:21 +03:00
Max Jonas Werner
52acac1a37 Add /v2 suffix to module name in preparation of 2.0.0 release
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-05 16:05:21 +03:00
Somtochi Onyekwere
a296afdd69 update azure e2e tests
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:21 +03:00
Somtochi Onyekwere
2e71c718ce update internal flags
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:20 +03:00
Somtochi Onyekwere
e44ab85880 update testdata yamls
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:20 +03:00
Somtochi Onyekwere
24452ecd37 Update GitRepository Receiver, and Kustomization to v1
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:20 +03:00
Stefan Prodan
ccb7d62d95 ci: Run the e2e tests for the release branches
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-05 16:05:20 +03:00
fluxcdbot
83d2739dc5 Update toolkit components
- helm-controller to v0.32.1
  https://github.com/fluxcd/helm-controller/blob/v0.32.1/CHANGELOG.md
- kustomize-controller to v1.0.0-rc.1
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0-rc.1/CHANGELOG.md
- source-controller to v1.0.0-rc.1
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.1/CHANGELOG.md
- notification-controller to v1.0.0-rc.1
  https://github.com/fluxcd/notification-controller/blob/v1.0.0-rc.1/CHANGELOG.md
- image-reflector-controller to v0.27.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.27.0/CHANGELOG.md
- image-automation-controller to v0.32.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.32.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-04-05 16:05:19 +03:00
Stefan Prodan
c0aa1b99b5 Merge pull request #3756 from fluxcd/dependabot/go_modules/github.com/docker/docker-20.10.24incompatible
build(deps): bump github.com/docker/docker from 20.10.20+incompatible to 20.10.24+incompatible
2023-04-05 09:22:57 +03:00
dependabot[bot]
1260db1bcf build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.20+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v20.10.20...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-04 21:19:03 +00:00
Stefan Prodan
0625bf8185 Merge pull request #3744 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.14.1
build(deps): bump anchore/sbom-action from 0.13.4 to 0.14.1
2023-04-03 10:23:45 +03:00
dependabot[bot]
403ea39825 build(deps): bump anchore/sbom-action from 0.13.4 to 0.14.1
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.13.4 to 0.14.1.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](448520c4f1...422cb34a0f)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 07:09:38 +00:00
Stefan Prodan
28e1f6e3c7 Merge pull request #3745 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.9
build(deps): bump github/codeql-action from 2.2.8 to 2.2.9
2023-04-03 10:02:56 +03:00
dependabot[bot]
7ee92db427 build(deps): bump github/codeql-action from 2.2.8 to 2.2.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.8 to 2.2.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](67a35a0858...04df1262e6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 01:35:22 +00:00
Hidde Beydals
d4cc45f55e Merge pull request #3728 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.13.4 2023-03-27 09:06:27 +02:00
dependabot[bot]
8240d19fbd build(deps): bump anchore/sbom-action from 0.13.3 to 0.13.4
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.13.3 to 0.13.4.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](07978da4bd...448520c4f1)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 06:37:54 +00:00
Hidde Beydals
a158360d7a Merge pull request #3729 from fluxcd/dependabot/github_actions/actions/checkout-3.5.0 2023-03-27 08:37:14 +02:00
dependabot[bot]
a30f77f8a4 build(deps): bump actions/checkout from 3.4.0 to 3.5.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](24cb908017...8f4b7f8486)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 06:12:24 +00:00
Hidde Beydals
8ec9e9ef4d Merge pull request #3730 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.8 2023-03-27 08:09:35 +02:00
dependabot[bot]
dbfb4269cb build(deps): bump github/codeql-action from 2.2.7 to 2.2.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.7 to 2.2.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](168b99b3c2...67a35a0858)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 01:27:08 +00:00
Sunny
fad7112dd0 Merge pull request #3643 from Santosh1176/fix-3597
Add support for create source git with --commit and --ref-name flags
2023-03-24 18:08:18 +05:30
Santosh Kaluskar
6afef04a88 Add support for create source git with --commit and --ref-name flags
Signed-off-by: Santosh Kaluskar <dtshbl@gmail.com>
2023-03-24 16:54:50 +05:30
Hidde Beydals
10f8849e12 Merge pull request #3721 from yiannistri/3593-fix-double-newline
fix: Avoid printing an extra newline when exporting resources
2023-03-24 11:07:23 +01:00
Yiannis
b55f49b4fe fix: Remove any leading and trailing whitespace from resource before
exporting

Signed-off-by: Yiannis <yiannistri@users.noreply.github.com>
2023-03-24 09:07:36 +00:00
Max Jonas Werner
883815cd53 Merge pull request #3717 from fluxcd/dependabot/go_modules/google.golang.org/protobuf-1.29.1
build(deps): bump google.golang.org/protobuf from 1.29.0 to 1.29.1
2023-03-23 11:50:38 +01:00
dependabot[bot]
c9e73edd86 build(deps): bump google.golang.org/protobuf from 1.29.0 to 1.29.1
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.29.0 to 1.29.1.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.29.0...v1.29.1)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-23 10:35:38 +00:00
Max Jonas Werner
2ac2a75c8c Merge pull request #3654 from timofurrer/gitlab-deploy-token-auth
Implement `--deploy-token-auth` in GitLab bootstrapping
2023-03-23 11:34:43 +01:00
Timo Furrer
2e1721ca85 Implement --deploy-token-auth in GitLab bootstrapping
This change set implements support for the `--deploy-token-auth` option
in the `flux bootstrap gitlab` command.

That option will reconcile a GitLab Project Deploy Token to use for the
authentication of the GitLab git repository.
A GitLab Project Deploy Token can be used the same way as a Personal
Access Token which is already supported via `--token-auth`.
The difference with the GitLab Project Deploy Token is that the token is
managed (created, updated, deleted) by Flux and not provided by the
user.

This change is transparent to the source-controller.

A prerequisite for this change is the
`fluxcd/go-git-providers` change here:

* https://github.com/fluxcd/go-git-providers/pull/191

See related discussion here: https://github.com/fluxcd/flux2/discussions/3595
GitLab Issue here: https://gitlab.com/gitlab-org/gitlab/-/issues/392605

Signed-off-by: Timo Furrer <tuxtimo@gmail.com>
2023-03-21 14:03:09 +01:00
Timo Furrer
91d1e1df48 Update go-git-providers to v0.15.0
Signed-off-by: Timo Furrer <tuxtimo@gmail.com>
2023-03-21 14:03:09 +01:00
Stefan Prodan
2cfdeeb5a2 Merge pull request #3696 from matheuscscp/retry-interval
Add retry interval option to create kustomization command
2023-03-21 14:56:20 +02:00
Matheus Pimenta
c9fea671a7 Add retry interval option to create kustomization command
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-03-21 12:36:07 +00:00
Hidde Beydals
dbda8fbdb8 Merge pull request #3710 from fluxcd/update-test-components
tests/azure: update toolkit components
2023-03-20 18:52:03 +01:00
Hidde Beydals
e2012a8272 tests/azure: update toolkit components
- github.com/fluxcd/helm-controller/api to v0.31.2
- github.com/fluxcd/image-reflector-controller/api to v0.26.1
- github.com/fluxcd/kustomize-controller/api to v0.35.1
- github.com/fluxcd/source-controller/api to v0.36.1

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 18:25:47 +01:00
Hidde Beydals
c930d58672 Merge pull request #3707 from fluxcd/update-components
Update toolkit components
2023-03-20 18:21:28 +01:00
fluxcdbot
cdd116dedf Update toolkit components
- helm-controller to v0.31.2
  https://github.com/fluxcd/helm-controller/blob/v0.31.2/CHANGELOG.md
- kustomize-controller to v0.35.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.35.1/CHANGELOG.md
- source-controller to v0.36.1
  https://github.com/fluxcd/source-controller/blob/v0.36.1/CHANGELOG.md
- image-reflector-controller to v0.26.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.26.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-03-20 16:42:10 +00:00
Stefan Prodan
ad3141dac7 Merge pull request #3706 from fluxcd/update-workflows-go
build: update `actions/setup-go` in workflows
2023-03-20 13:01:22 +01:00
Hidde Beydals
ce405b6060 build: update actions/setup-go in workflows
- Update `actions/setup-go` to v4.0.0 in workflows.
- Remove separate caching steps in favor of built-in caching feature
  in action (since >=v3.0.0).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 12:19:42 +01:00
Hidde Beydals
53d98c882e Merge pull request #3704 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-4.2.4
build(deps): bump peter-evans/create-pull-request from 4.2.3 to 4.2.4
2023-03-20 11:45:34 +01:00
dependabot[bot]
519cf58d27 build(deps): bump peter-evans/create-pull-request from 4.2.3 to 4.2.4
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](2b011faafd...38e0b6e68b)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 11:29:29 +01:00
Hidde Beydals
fdeae99ba5 Merge pull request #3701 from fluxcd/dependabot/github_actions/actions/checkout-3.4.0
build(deps): bump actions/checkout from 3.3.0 to 3.4.0
2023-03-20 11:29:05 +01:00
dependabot[bot]
1071f04e93 build(deps): bump actions/checkout from 3.3.0 to 3.4.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](ac59398561...24cb908017)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 10:13:50 +00:00
Hidde Beydals
3f6ca549b9 Merge pull request #3703 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.7
build(deps): bump github/codeql-action from 2.2.6 to 2.2.7
2023-03-20 11:04:17 +01:00
dependabot[bot]
a452f15905 build(deps): bump github/codeql-action from 2.2.6 to 2.2.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.6 to 2.2.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](16964e90ba...168b99b3c2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 01:27:33 +00:00
Sunny
5fdc8c3e08 Merge pull request #3617 from Santosh1176/patch-3536
Create secret with bearer-token
2023-03-16 17:42:48 +05:30
Santosh Kaluskar
5a45d2b127 Create secret with bearer-token
Signed-off-by: Santosh Kaluskar <dtshbl@gmail.com>
2023-03-14 22:31:45 +05:30
Hidde Beydals
0fd8fbe301 Merge pull request #3684 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.6
build(deps): bump github/codeql-action from 2.2.5 to 2.2.6
2023-03-13 12:50:36 +01:00
dependabot[bot]
ec978fc79f build(deps): bump github/codeql-action from 2.2.5 to 2.2.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](32dc499307...16964e90ba)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 10:25:14 +00:00
Hidde Beydals
8c3abb0d8b Merge pull request #3683 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.5.0
build(deps): bump docker/setup-buildx-action from 2.4.1 to 2.5.0
2023-03-13 11:24:34 +01:00
dependabot[bot]
e1fca7f062 build(deps): bump docker/setup-buildx-action from 2.4.1 to 2.5.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f03ac48505...4b4e9c3e2d)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 08:52:53 +00:00
Max Jonas Werner
50829c3217 Merge pull request #3685 from fluxcd/dependabot/github_actions/actions/cache-3.3.0
build(deps): bump actions/cache from 3.2.6 to 3.3.0
2023-03-13 09:52:09 +01:00
dependabot[bot]
da06854e05 build(deps): bump actions/cache from 3.2.6 to 3.3.0
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.6 to 3.3.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](69d9d449ac...940f3d7cf1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 01:33:06 +00:00
Hidde Beydals
865f172e33 Merge pull request #3680 from fluxcd/update-components
Update toolkit components
2023-03-10 16:09:39 +01:00
fluxcdbot
5607754702 Update toolkit components
- helm-controller to v0.31.1
  https://github.com/fluxcd/helm-controller/blob/v0.31.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-03-10 14:55:09 +00:00
Stefan Prodan
17d134766d Merge pull request #3676 from fluxcd/update-kube-prometheus-stack
Disable drift detection for kube-prometheus-stack webhooks
2023-03-09 20:19:00 +02:00
Stefan Prodan
06ed881e37 Disable drift detection for kube-prometheus-stack webhooks
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-03-09 19:51:25 +02:00
Hidde Beydals
eabd250ed2 Merge pull request #3628 from somtochiama/flux-events-cmd
Add `flux events` command
2023-03-09 14:54:29 +01:00
Hidde Beydals
af153ea0cf events: avoid having to keep individal kind maps
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
3f3d68a33a events: reword error messages
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
c0916edc44 events: prevent defer in loop
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
34220fd514 events: make --for case insensitive for kinds
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
5b8f673baa events: use constants for supported Flux kinds
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:31 +01:00
Somtochi Onyekwere
5b18289808 Add flux events command
This adds a command to Flux which behaves similarly as `kubectl events`,
including the Flux sources events when showing events for top level
objects, thus making debugging easy for Flux users.

For example, `flux events --for kustomization/<name>` includes the
events of its source (e.g. a `GitRepository`, `OCIRepository` or
`Bucket`).

In addition, `flux events --for helmrelease/<name>` includes events of
the `HelmChart` and `HelmRepository`. While `flux events --for
alerts/<name>` includes the events of the `Provider`.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-03-09 14:41:31 +01:00
Hidde Beydals
2589c90c25 Merge pull request #3674 from fluxcd/update-deps
Update dependencies
2023-03-09 14:31:21 +01:00
Hidde Beydals
16e0b93bec diff: update Action references to typed Action
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 13:10:24 +01:00
Hidde Beydals
9274e80d71 Update dependencies
- github.com/fluxcd/pkg/git to v0.11.0
- github.com/fluxcd/pkg/git/gogit to v0.8.1
- github.com/fluxcd/pkg/kustomize to v0.13.2
- github.com/fluxcd/pkg/oci to v0.21.1
- github.com/fluxcd/pkg/runtime to v0.31.0
- github.com/fluxcd/pkg/ssa to v0.24.1
- github.com/fluxcd/pkg/ssh to v0.7.3
- golang.org/x/crypto to v0.7.0
- golang.org/x/term to v0.6.0
- k8s.io/cli-runtime to v0.26.2
- k8s.io/kubectl to v0.26.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 13:06:43 +01:00
Stefan Prodan
66deeec9f1 Merge pull request #3673 from fluxcd/fix-e2e-kind
ci: Use latest available images of kindest/node
2023-03-09 13:38:17 +02:00
Stefan Prodan
59ca6548ea ci: Use latest available images of kindest/node
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-03-09 13:24:10 +02:00
Stefan Prodan
267d2314e0 Merge pull request #3672 from fluxcd/update-test-deps
tests/azure: update dependencies
2023-03-09 13:11:48 +02:00
Hidde Beydals
0b5502963e tests/azure: update dependencies
- github.com/fluxcd/image-automation-controller/api to v0.31.0
- github.com/fluxcd/image-reflector-controller/api to v0.26.0
- github.com/fluxcd/kustomize-controller/api to v0.35.0
- github.com/fluxcd/notification-controller/api to v0.33.0
- github.com/fluxcd/pkg/apis/event to v0.4.1
- github.com/fluxcd/pkg/git to v0.11.0
- github.com/fluxcd/pkg/git/gogit to v0.8.1
- github.com/fluxcd/source-controller/api to v0.36.0
- github.com/hashicorp/terraform-exec to v0.18.1
- go.uber.org/multierr to v1.10.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 11:59:00 +01:00
Hidde Beydals
4431aa2dd0 Merge pull request #3669 from fluxcd/update-release-workflow
Update GitHub Action workflows
2023-03-09 11:58:23 +01:00
Hidde Beydals
26aafa1b6f e2e: update podinfo to version with newer APIs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 11:43:05 +01:00
Hidde Beydals
d29f1c062f build: update Kubernetes versions in e2e workflows
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:41:23 +01:00
Hidde Beydals
879558fe20 build: update scan workflow
To include a (full) version number behind the actions with a SHA
reference, so Dependabot will continue to update them from now on.

Except for the `snyk/actions`, which follows `main`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:41:23 +01:00
Hidde Beydals
940b5c4fb9 build: update update workflow
To include a version number behind the actions with a SHA reference, so
Dependabot will continue to update them from now on.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:41:23 +01:00
Hidde Beydals
5ab9c01378 build: update e2e{-*} workflows
To include a version number behind the actions with a SHA reference, so
Dependabot will continue to update them from now on.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:41:23 +01:00
Hidde Beydals
db67d2c4df build: update release workflow
- sigstore/cosign-installer to v3.0.1
- Put (exact) version comment behind all action references, while taking note
  this is an absolute insane way to manage versions.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:41:23 +01:00
Hidde Beydals
47867cd80b Merge pull request #3670 from fluxcd/update-go-1.20
Update Go to 1.20
2023-03-09 09:40:52 +01:00
Hidde Beydals
fe0baa4de9 build: update cache keys to reflect Go 1.20
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:26:51 +01:00
Hidde Beydals
262e6bb543 Update kubectl in Dockerfile to v1.26.2
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:26:51 +01:00
Hidde Beydals
18760acaa8 Update Go to 1.20
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 09:26:51 +01:00
Hidde Beydals
a62404c16f Merge pull request #3666 from fluxcd/update-components
Update toolkit components
2023-03-09 09:26:40 +01:00
fluxcdbot
44db4e100a Update toolkit components
- kustomize-controller to v0.35.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.35.0/CHANGELOG.md
- source-controller to v0.36.0
  https://github.com/fluxcd/source-controller/blob/v0.36.0/CHANGELOG.md
- notification-controller to v0.33.0
  https://github.com/fluxcd/notification-controller/blob/v0.33.0/CHANGELOG.md
- image-reflector-controller to v0.26.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.26.0/CHANGELOG.md
- image-automation-controller to v0.31.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.31.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-03-09 08:10:05 +00:00
Hidde Beydals
62d8448b9c Merge pull request #3667 from fluxcd/update-helm-controller
Update helm-controller to v0.31.0
2023-03-09 09:09:13 +01:00
Hidde Beydals
1cc7682d44 Replace helmv2.KubeConfig with meta.KubeConfig
This is a backwards compatible change in terms of "YAML API", as they
spec still equals the previous one. Object type has just changed.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 18:51:14 +01:00
Hidde Beydals
6eb3fdf863 Update helm-controller to v0.31.0
Which includes an update of:

- github.com/fluxcd/pkg/apis/meta to v0.19.1
- k8s.io/apiextensions-apiserver to v0.26.2
- k8s.io/apimachinery to v0.26.2
- k8s.io/client-go to v0.26.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 18:51:13 +01:00
Stefan Prodan
2e4de673b2 Merge pull request #3653 from fluxcd/push-with-annotations
Allow custom annotations to be set when pushing OCI artifacts
2023-03-03 12:57:00 +02:00
Stefan Prodan
a64913f2f0 Allow custom annotations to be set when pushing OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-03-03 12:40:59 +02:00
Hidde Beydals
2c7d650d44 Merge pull request #3645 from fluxcd/update-deps
Update dependencies
2023-02-28 15:14:27 +01:00
Hidde Beydals
c05b540518 Update dependencies
- github.com/onsi/gomega to v1.27.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-02-28 14:37:53 +01:00
Hidde Beydals
c8bd8d0f26 tests/azure: update dependencies
- github.com/fluxcd/notification-controller/api to v0.32.1
- github.com/stretchr/testify to v1.8.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-02-28 14:35:29 +01:00
Hidde Beydals
a4cd8095a1 Merge pull request #3644 from fluxcd/update-components
Update toolkit components
2023-02-28 14:34:11 +01:00
fluxcdbot
79485c99ab Update toolkit components
- notification-controller to v0.32.1
  https://github.com/fluxcd/notification-controller/blob/v0.32.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-02-28 13:07:03 +00:00
Stefan Prodan
e29f171844 Merge pull request #3638 from fluxcd/dependabot/github_actions/actions/cache-3.2.6
build(deps): bump actions/cache from 3.2.5 to 3.2.6
2023-02-27 16:17:44 +02:00
dependabot[bot]
c16cca891f build(deps): bump actions/cache from 3.2.5 to 3.2.6
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](6998d139dd...69d9d449ac)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 13:55:42 +00:00
Stefan Prodan
68ef3a464e Merge pull request #3637 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.5
build(deps): bump github/codeql-action from 2.2.4 to 2.2.5
2023-02-27 15:55:05 +02:00
dependabot[bot]
a5958b494d build(deps): bump github/codeql-action from 2.2.4 to 2.2.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](17573ee1cc...32dc499307)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 01:57:43 +00:00
Hidde Beydals
c88a2f4137 Merge pull request #3626 from fluxcd/update-deps
Update dependencies
2023-02-23 15:21:18 +01:00
Hidde Beydals
349bad9240 tests/azure: update dependencies
- github.com/hashicorp/terraform-exec to v0.18.0
- Unpin golang.org/x/crypto to allow update to v0.6.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 14:52:25 +01:00
Hidde Beydals
8c7b534544 Update dependencies
- github.com/distribution/distribution/v3 to v3.0.0-20230223072852-e5d5810851d
- github.com/fluxcd/pkg/oci to v0.20.0
- github.com/fluxcd/pkg/sourceignore to v0.3.2
- github.com/onsi/gomega to v1.27.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 14:52:25 +01:00
Hidde Beydals
3028897392 Merge pull request #3624 from fluxcd/update-components
Update toolkit components
2023-02-23 14:46:49 +01:00
Hidde Beydals
b28d80e752 tests/azure: update source-controller to v0.35.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 14:30:43 +01:00
fluxcdbot
76552855bb Update toolkit components
- source-controller to v0.35.2
  https://github.com/fluxcd/source-controller/blob/v0.35.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-02-23 13:07:38 +00:00
Stefan Prodan
e4d19c84eb Merge pull request #3615 from fluxcd/rfc-status-updates
Update implementation history of RFC-0003 and RFC-0005
2023-02-20 16:52:55 +02:00
Stefan Prodan
737d615fbc Update implementation history of RFC-0003 and RFC-0005
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-20 16:36:29 +02:00
Stefan Prodan
2cac6ce281 Merge pull request #3578 from fluxcd/stats-cmd
Add command to print the reconcilers status
2023-02-20 13:24:41 +02:00
Stefan Prodan
7490d4d4b8 Add command to print the reconcilers status
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-20 13:08:04 +02:00
Stefan Prodan
3cb9e7cbee Merge pull request #3612 from fluxcd/dependabot/github_actions/fossa-contrib/fossa-action-2.0.0
build(deps): bump fossa-contrib/fossa-action from 1.2.0 to 2.0.0
2023-02-20 09:35:00 +02:00
dependabot[bot]
7b731f7777 build(deps): bump fossa-contrib/fossa-action from 1.2.0 to 2.0.0
Bumps [fossa-contrib/fossa-action](https://github.com/fossa-contrib/fossa-action) from 1.2.0 to 2.0.0.
- [Release notes](https://github.com/fossa-contrib/fossa-action/releases)
- [Changelog](https://github.com/fossa-contrib/fossa-action/blob/master/CHANGELOG.md)
- [Commits](6cffaa0641...6728dc6fe9)

---
updated-dependencies:
- dependency-name: fossa-contrib/fossa-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 02:05:21 +00:00
Hidde Beydals
7e5cbdaea5 Merge pull request #3610 from fluxcd/azure-deps
Update dependencies
2023-02-17 17:40:14 +01:00
Hidde Beydals
6e81e82c8c tests/azure: update other dependencies
- github.com/fluxcd/pkg/apis/event to v0.4.0
- github.com/fluxcd/pkg/git to v0.10.0
- github.com/fluxcd/pkg/git/gogit to v0.7.1
- github.com/hashicorp/hc-install to v0.5.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 16:58:12 +01:00
Hidde Beydals
a4e1b80ba7 tests/azure: update dependencies
- github.com/fluxcd/helm-controller/api v0.30.0
- github.com/fluxcd/image-automation-controller/api v0.30.0
- github.com/fluxcd/kustomize-controller/api v0.34.0
- github.com/fluxcd/notification-controller/api v0.32.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 16:57:57 +01:00
Hidde Beydals
e0131f22dd Update dependencies
- github.com/ProtonMail/go-crypto to v0.0.0-20230217124315-7d5c6f04bbb8
- github.com/distribution/distribution/v3 to v3.0.0-20230217093620-e64b08ada6c3
- github.com/fluxcd/go-git-providers to v0.14.0
- github.com/fluxcd/pkg/git/gogit to v0.7.1
- github.com/fluxcd/pkg/kustomize to v0.13.1
- github.com/fluxcd/pkg/oci to v0.19.1
- github.com/fluxcd/pkg/runtime to v0.29.0
- github.com/fluxcd/pkg/sourceignore to v0.3.1
- github.com/fluxcd/pkg/ssa to v0.23.1
- github.com/fluxcd/pkg/ssh to v0.7.1
- github.com/fluxcd/pkg/version to v0.2.1
- github.com/onsi/gomega to v1.27.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 16:57:57 +01:00
Hidde Beydals
caf55ccb7f Merge pull request #3598 from fluxcd/update-components 2023-02-17 16:00:02 +01:00
fluxcdbot
04afc09d58 Update toolkit components
- helm-controller to v0.30.0
  https://github.com/fluxcd/helm-controller/blob/v0.30.0/CHANGELOG.md
- kustomize-controller to v0.34.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.34.0/CHANGELOG.md
- notification-controller to v0.32.0
  https://github.com/fluxcd/notification-controller/blob/v0.32.0/CHANGELOG.md
- image-automation-controller to v0.30.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.30.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-02-17 14:07:05 +00:00
Hidde Beydals
b67c432bc1 Merge pull request #3606 from fluxcd/set-output-deprecation
build: further solve issue release workflow
2023-02-17 15:06:07 +01:00
Hidde Beydals
a59aaa4dfb build: further solve issue release workflow
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 14:57:45 +01:00
Hidde Beydals
1302fb17c2 Merge pull request #3605 from fluxcd/set-output-deprecation
build: ensure newlines work with $GITHUB_OUTPUT
2023-02-17 14:41:19 +01:00
Hidde Beydals
2e1e4106fd build: ensure newlines work with $GITHUB_OUTPUT
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 14:21:45 +01:00
Hidde Beydals
e4df6c9d14 Merge pull request #3604 from fluxcd/set-output-deprecation
build: convert ::set-output to $GITHUB_OUTPUT
2023-02-17 14:12:00 +01:00
Hidde Beydals
bca26ebf0a build: convert ::set-output to $GITHUB_OUTPUT
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 13:44:27 +01:00
Stefan Prodan
2827171dd8 Merge pull request #3603 from fluxcd/remove-deprecated-flags
Remove deprecated flags
2023-02-17 14:35:46 +02:00
Stefan Prodan
b44a3d36ba Remove deprecated flags
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-17 14:23:11 +02:00
Hidde Beydals
ea04bc8e47 Merge pull request #3602 from fluxcd/update-sc
Update source-controller to v0.35.1
2023-02-17 13:01:49 +01:00
Hidde Beydals
0f7b903ace Update push artifact's --revision to RFC-0005
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 12:48:55 +01:00
Hidde Beydals
71d59e36cc bootstrap: support legacy revision while polling
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 12:48:55 +01:00
Hidde Beydals
7f99655a2b Update golden files with RFC-0005 revision formats
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 12:48:55 +01:00
Hidde Beydals
d56844010f Update source-controller to v0.35.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 11:21:48 +01:00
Stefan Prodan
218a661449 Merge pull request #3601 from fluxcd/fix-snyk
ci: Fix Snyk Go build VCS stamping error
2023-02-17 12:20:04 +02:00
Stefan Prodan
873950dc55 ci: Fix Snyk Go build VCS stamping error
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-17 12:04:14 +02:00
Stefan Prodan
b445013d25 Merge pull request #3566 from fluxcd/rbac-edit-view
rbac: Add view and edit aggregated cluster roles
2023-02-17 11:51:39 +02:00
Stefan Prodan
65055c273f rbac: Add view and edit aggregated cluster roles
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-17 11:21:47 +02:00
Sunny
3c14f8beb0 Merge pull request #3585 from fluxcd/irc-v1beta2
Update image-reflector API to v1beta2
2023-02-17 14:44:04 +05:30
Sunny
9dd98fb2b2 Update image-reflector API to v1beta2
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-02-17 00:32:48 +05:30
Hidde Beydals
4a871cdf10 Merge pull request #3587 from fluxcd/digest-revision-fmt
Support shortening of revision with digest
2023-02-15 16:03:09 +01:00
Hidde Beydals
bb6a7b8f07 Support shortening of revision with digest
The `\b` in the regular expression ensures we only match with a
hexadecimal notation as awhole, while still allowing to match with
e.g. `sha1:...` which would not have been possible by using `\W`
as this includes `_`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-15 15:43:11 +01:00
Hidde Beydals
ae9728685c Merge pull request #3592 from fluxcd/fix-golden-files
tests: only provide template values when used
2023-02-15 14:25:44 +01:00
Hidde Beydals
662f0d8cae tests: rename "kubectl" setupTestNamespace
As the other version has a different signature, but exists for a
different build tag. Resulting in my IDE becoming absolutely confused
when I tried to enable both at the same time. Opted for "exec" because
this one shells out.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-15 13:56:55 +01:00
Hidde Beydals
1f5961d2ad tests: deal with remaining defer
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-15 13:52:05 +01:00
Hidde Beydals
b263e14fa8 tests: only provide template values when used
As otherwise the `.golden` values can not be automatically updated using
`-update` as documented in `CONTRIBUTING.md`.

Also ensure we do not use `defer` but rather `t.Cleanup` in tests, as
this will always be called even if e.g. `t.Fatal` absruptly stops the
test.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-15 13:22:44 +01:00
Stefan Prodan
1e67d75848 Merge pull request #3582 from fluxcd/dependabot/github_actions/actions/cache-3.2.5
build(deps): bump actions/cache from 3.2.4 to 3.2.5
2023-02-13 17:34:05 +02:00
dependabot[bot]
f4acc0cfc9 build(deps): bump actions/cache from 3.2.4 to 3.2.5
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](627f0f41f6...6998d139dd)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 14:05:50 +00:00
Stefan Prodan
e5c9132d1d Merge pull request #3581 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.4
build(deps): bump github/codeql-action from 2.2.1 to 2.2.4
2023-02-13 16:02:40 +02:00
dependabot[bot]
3c330b71aa build(deps): bump github/codeql-action from 2.2.1 to 2.2.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](3ebbd71c74...17573ee1cc)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 13:37:02 +00:00
Stefan Prodan
f3f6c373fc Merge pull request #3583 from fluxcd/dependabot/github_actions/snyk/actions-806182742461562b67788a64410098c9d9b96adb
build(deps): bump snyk/actions from e25b2e6f5658d1bb7a6671b113260f13134cc3af to 806182742461562b67788a64410098c9d9b96adb
2023-02-13 15:36:16 +02:00
dependabot[bot]
577d4e71af build(deps): bump snyk/actions
Bumps [snyk/actions](https://github.com/snyk/actions) from e25b2e6f5658d1bb7a6671b113260f13134cc3af to 806182742461562b67788a64410098c9d9b96adb.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](e25b2e6f56...8061827424)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 11:40:21 +00:00
Stefan Prodan
a80325995d Merge pull request #3575 from fluxcd/rfc-0003-oci-media-type
RFC-0003: Introduce Flux OCI media type
2023-02-13 13:32:56 +02:00
Stefan Prodan
c093714597 RFC-0003: Introduce Flux OCI media type
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-13 13:08:01 +02:00
Stefan Prodan
fa9d42d7bf Merge pull request #3584 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.4.1
build(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1
2023-02-13 12:59:19 +02:00
dependabot[bot]
e93b3d8d75 build(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](15c905b16b...f03ac48505)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 02:06:09 +00:00
Stefan Prodan
6ea3e5b4da Merge pull request #3563 from fluxcd/dependabot/github_actions/actions/cache-3.2.4
build(deps): bump actions/cache from 3.2.3 to 3.2.4
2023-02-06 12:51:16 +02:00
dependabot[bot]
ae5294f010 build(deps): bump actions/cache from 3.2.3 to 3.2.4
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](58c146cc91...627f0f41f6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 09:41:09 +00:00
Stefan Prodan
8571f9e1f8 Merge pull request #3562 from fluxcd/dependabot/github_actions/goreleaser/goreleaser-action-4.2.0
build(deps): bump goreleaser/goreleaser-action from 4.1.1 to 4.2.0
2023-02-06 11:40:25 +02:00
dependabot[bot]
0cd0bf3b58 build(deps): bump goreleaser/goreleaser-action from 4.1.1 to 4.2.0
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](9754a253a8...f82d6c1c34)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 01:05:36 +00:00
Hidde Beydals
d62cc90f51 Merge pull request #3560 from fluxcd/action-perms
docs: Add permissions to update workflow
2023-02-03 15:14:12 +00:00
Stefan Prodan
3fc5f34344 docs: Add permissions to update workflow
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-03 16:51:22 +02:00
Stefan Prodan
978cc0c5b8 Merge pull request #3545 from fluxcd/update-components
Update toolkit components
2023-02-02 12:59:47 +02:00
fluxcdbot
4e009a7167 Update toolkit components
- helm-controller to v0.29.0
  https://github.com/fluxcd/helm-controller/blob/v0.29.0/CHANGELOG.md
- kustomize-controller to v0.33.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.33.0/CHANGELOG.md
- source-controller to v0.34.0
  https://github.com/fluxcd/source-controller/blob/v0.34.0/CHANGELOG.md
- notification-controller to v0.31.0
  https://github.com/fluxcd/notification-controller/blob/v0.31.0/CHANGELOG.md
- image-reflector-controller to v0.24.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.24.0/CHANGELOG.md
- image-automation-controller to v0.29.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.29.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2023-02-01 18:02:11 +00:00
Stefan Prodan
176444263c Merge pull request #3550 from fluxcd/fix-tree-crds
flux tree: Set CRDs GroupKind in output
2023-02-01 12:57:25 +02:00
Stefan Prodan
87232fd4dd flux tree: Set CRDs GroupKind in output
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-01 12:41:35 +02:00
Stefan Prodan
0361a08aa0 Merge pull request #3549 from fluxcd/tree-hr-crds
flux tree: Track CRDs managed by HelmReleases
2023-02-01 12:22:02 +02:00
Stefan Prodan
be154d079b flux tree: Track CRDs managed by HelmReleases
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-01 12:01:11 +02:00
Stefan Prodan
feccc36415 Merge pull request #3542 from fluxcd/tree-hr-ns
flux tree: Add namespaces to objects reconciled from HRs
2023-01-31 18:40:12 +02:00
Stefan Prodan
06b8ad2402 flux tree: Add namespaces to objects reconcile from HRs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 18:17:48 +02:00
Stefan Prodan
023a709b6a Merge pull request #3540 from fluxcd/push-output
Add json/yaml output to flux push artifact
2023-01-31 15:28:26 +02:00
Stefan Prodan
6681cd05a9 Add example of push and sign OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 14:30:50 +02:00
Stefan Prodan
56807fddf6 Add json/yaml output to flux push artifact
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 13:36:59 +02:00
Stefan Prodan
51504406da Merge pull request #3537 from fluxcd/kube-1.26
Update dependencies to Kubernetes v1.26.1
2023-01-31 12:31:07 +02:00
Stefan Prodan
d28cdd9726 Update dependencies
- github.com/fluxcd/go-git-providers v0.13.0
- github.com/fluxcd/pkg/runtime v0.27.0
- github.com/fluxcd/pkg/ssa v0.23.0
- github.com/google/go-containerregistry v0.13.0
- sigs.k8s.io/controller-runtime v0.14.2
- k8s.io/* v0.26.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 11:26:44 +02:00
Stefan Prodan
c1f120facc Merge pull request #3507 from thezanke/patch-1
Update prometheus-community helm repo due to the suspension of OCI builds
2023-01-30 18:32:34 +02:00
Alex Howard
87f792915a Fix kube-prometheus-stack manifests
Updates the HelmRepository and HelmRelease to remove chart
verification and switch to using the official HTTPS repository
at https://prometheus-community.github.io/helm-charts.

OCI builds have temporarily been suspended for these charts due
to pipeline errors.

See: prometheus-community/helm-charts#2841

Signed-off-by: Alex Howard <thezanke@gmail.com>
2023-01-30 11:13:05 -05:00
Max Jonas Werner
9fb5fe3af3 Merge pull request #3531 from fluxcd/fix-misleading-messaging
fix misleading messaging when using `-A` flag
2023-01-30 17:08:22 +01:00
Max Jonas Werner
0648f56049 fix misleading messaging when using -A flag
Before:

```
$ flux get source git -A
✗ no GitRepository objects found in flux-system namespace
```

After:

```
$ flux get source git -A
✗ no GitRepository objects found in any namespace
```

Signed-off-by: Max Jonas Werner <max@e13.dev>
2023-01-30 16:54:16 +01:00
Stefan Prodan
7da8ffd87f Merge pull request #3532 from fluxcd/alpine-3.17
Update Alpine to v3.17 and kubectl to v1.26.1 in flux-cli image
2023-01-30 17:50:49 +02:00
Stefan Prodan
79f900b82e ci: Replace engineerd/setup-kind with helm/kind-action
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-30 17:18:35 +02:00
Stefan Prodan
0394c4d5ef Update Alpine to v3.17
Bump kubectl binary to v1.26.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-30 17:05:14 +02:00
Stefan Prodan
693f0c1da1 Merge pull request #3529 from fluxcd/dependabot/github_actions/docker/setup-buildx-action-2.4.0
build(deps): bump docker/setup-buildx-action from 2.2.1 to 2.4.0
2023-01-30 14:37:51 +02:00
dependabot[bot]
65481c223e build(deps): bump docker/setup-buildx-action from 2.2.1 to 2.4.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](8c0edbc76e...15c905b16b)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 12:12:38 +00:00
Stefan Prodan
d2222426f5 Merge pull request #3526 from fluxcd/dependabot/github_actions/anchore/sbom-action-0.13.3
Bump anchore/sbom-action from 0.13.1 to 0.13.3
2023-01-30 14:09:34 +02:00
dependabot[bot]
18924d29a7 Bump anchore/sbom-action from 0.13.1 to 0.13.3
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.13.1 to 0.13.3.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](06e109483e...07978da4bd)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 11:38:26 +00:00
Stefan Prodan
84a3cdde93 Merge pull request #3525 from fluxcd/dependabot/github_actions/github/codeql-action-2.2.1
Bump github/codeql-action from 2.1.38 to 2.2.1
2023-01-30 13:37:34 +02:00
dependabot[bot]
e5eb4d4a67 Bump github/codeql-action from 2.1.38 to 2.2.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.38 to 2.2.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](515828d974...3ebbd71c74)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 10:23:13 +00:00
Stefan Prodan
60c44c16f5 Merge pull request #3524 from fluxcd/dependabot/github_actions/goreleaser/goreleaser-action-4.1.1
Bump goreleaser/goreleaser-action from 4.1.0 to 4.1.1
2023-01-30 12:19:07 +02:00
dependabot[bot]
f22222f71d Bump goreleaser/goreleaser-action from 4.1.0 to 4.1.1
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](8f67e590f2...9754a253a8)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 01:03:33 +00:00
Stefan Prodan
287ac6b003 Merge pull request #3517 from jooooel/joel/fix-bug-in-action
Fix broken GitHub Action and handle case where VERSION is provided as an input
2023-01-26 16:54:41 +02:00
Joel Guedj
5b422bef17 Handle case where VERSION is provided as an input
If VERSION is provided, VERSION_SLUG will never be set and VERSION will
be overwritten with a bad value.

Signed-off-by: Joel Guedj <joel.guedj@gmail.com>
2023-01-26 11:46:21 +01:00
Stefan Prodan
1dc3ff6c59 Merge pull request #3513 from kingdonb/fix-action-3
Fix fluxcd/flux2/action
2023-01-24 22:08:23 +02:00
Kingdon Barrett
ed13067ff2 test conditionals in a nested structure
add an "else" branch
(https://github.com/fluxcd/flux2/pull/3511 failed to fix #3509)

* factor out sed and cut

so we at least do not repeat the most complex part of the expression

* eliminate intermediary array TOKEN
* delete reassignment of token
* wording

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2023-01-24 14:25:42 -05:00
Stefan Prodan
a3151aa10c Merge pull request #3511 from kingdonb/fix-action-again
Fix fluxcd/flux2/action (finally)
2023-01-24 13:51:24 +02:00
Kingdon Barrett
536f4c31ce do not quote token here
Adding quotes here, when the variable is empty you get:

curl https://api.github.com/repos/fluxcd/flux2/releases/latest -sL ''

(ref:
https://github.com/kingdonb/bootstrap-repo/actions/runs/3991169408/jobs/6845685491#step:3:31
)

That does curl twice, once for the URL provided and again for the empty
string, which results in curl returning error code 3 "malformed URL"

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2023-01-23 17:50:12 -05:00
Hidde Beydals
3a8765859d Merge pull request #3508 from kingdonb/fix-action
Quote tested values in fluxcd/flux GitHub Action
2023-01-23 22:23:38 +00:00
Kingdon Barrett
369ae5aa71 Quote tested values in fluxcd/flux GitHub Action
Fix an issue with improperly quoted variables created by #3474

Also, curl should fail with an error code if the download results in
404 not found

* + (x3) Update action/action.yml
* for consistent format

Co-authored-by: Steven E. Harris <seh@panix.com>
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2023-01-23 14:51:18 -05:00
Stefan Prodan
ca2b93ba39 Merge pull request #3501 from kingdonb/flux-action-updates
Add GITHUB_TOKEN  to Flux GitHub Action
2023-01-23 13:27:41 +02:00
Erik Kristensen
8ff8295d0c fix: update example to use correct output method
feat: add ability to auth to github api
docs: add authentication snippet example
docs: update checkout@v3, create-pull-request@v4
docs: add documentation about the github token secret

Review: Add suggested change from last week

(per
https://github.com/fluxcd/flux2/pull/3474#discussion_r1067178730)

Signed-off-by: Erik Kristensen <erik@erikkristensen.com>
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2023-01-21 13:07:23 -05:00
Stefan Prodan
0439154564 Merge pull request #3488 from fluxcd/dependabot/github_actions/snyk/actions-e25b2e6f5658d1bb7a6671b113260f13134cc3af
Bump snyk/actions from 1cc9026f51d822442cb4b872d8d7ead8cc69a018 to e25b2e6f5658d1bb7a6671b113260f13134cc3af
2023-01-16 17:11:38 +02:00
dependabot[bot]
e7e05f870b Bump snyk/actions
Bumps [snyk/actions](https://github.com/snyk/actions) from 1cc9026f51d822442cb4b872d8d7ead8cc69a018 to e25b2e6f5658d1bb7a6671b113260f13134cc3af.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](1cc9026f51...e25b2e6f56)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 13:43:09 +00:00
Stefan Prodan
d54f08e7a9 Merge pull request #3487 from fluxcd/dependabot/github_actions/actions/cache-3.2.3
Bump actions/cache from 3.2.2 to 3.2.3
2023-01-16 15:42:12 +02:00
dependabot[bot]
ece3a07567 Bump actions/cache from 3.2.2 to 3.2.3
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](4723a57e26...58c146cc91)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 09:07:24 +00:00
Max Jonas Werner
9c37506130 Merge pull request #3486 from fluxcd/dependabot/github_actions/github/codeql-action-2.1.38
Bump github/codeql-action from 2.1.37 to 2.1.38
2023-01-16 10:04:41 +01:00
dependabot[bot]
58b4ed586a Bump github/codeql-action from 2.1.37 to 2.1.38
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.37 to 2.1.38.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](959cbb7472...515828d974)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 01:16:39 +00:00
Aurel Canciu
c479eb80c6 Merge pull request #3477 from raffis/gh-auth-token
fix(install-script): support $GITHUB_TOKEN
2023-01-11 13:47:46 +01:00
raffis
da7af5ab5f Update install/README.md
Co-authored-by: Aurel Canciu <aurelcanciu@gmail.com>
Signed-off-by: raffis <raffael.sahli@doodle.com>
2023-01-11 13:13:20 +01:00
Raffael Sahli
d1b4851fbe fix(install-script): support github api auth
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-01-11 08:05:49 +00:00
Sunny
a9f53b4f1a Merge pull request #3476 from aryan9600/revert-auto-stage
Update git/gogit to v0.4.1
2023-01-10 20:33:09 +05:30
Sanskar Jaiswal
7327b14a62 update git/gogit to v0.4.1
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-01-10 17:15:51 +05:30
Hidde Beydals
3d5fc3dc18 Merge pull request #3469 from fluxcd/dependabot/github_actions/actions/checkout-3.3.0
Bump actions/checkout from 3.2.0 to 3.3.0
2023-01-09 14:23:23 +00:00
dependabot[bot]
1d80ff2b09 Bump actions/checkout from 3.2.0 to 3.3.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](755da8c3cf...ac59398561)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 00:57:58 +00:00
Sunny
28111d27fb Merge pull request #3465 from kingdonb/powershell-completion-doc
Fix fluxcd/website#1347
2023-01-06 16:20:36 +05:30
Kingdon Barrett
ddd377b997 Fix fluxcd/website#1347
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2023-01-05 20:19:53 -05:00
Stefan Prodan
e01810037b Merge pull request #3457 from fluxcd/dependabot/github_actions/actions/cache-3.2.2
Bump actions/cache from 3.0.11 to 3.2.2
2023-01-02 18:44:05 +02:00
dependabot[bot]
f5563de144 Bump actions/cache from 3.0.11 to 3.2.2
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.11 to 3.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](9b0c1fce7a...4723a57e26)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 00:36:13 +00:00
Stefan Prodan
8ecaa56461 Merge pull request #3441 from fluxcd/check-crds-version
check: Show the latest stored version of CRDs
2022-12-23 12:09:27 +02:00
Stefan Prodan
9d38ea6ffc check: Show the latest stored version of CRDs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-23 11:44:28 +02:00
Stefan Prodan
f58b82fb4e Merge pull request #3437 from fluxcd/update-components
Update toolkit components
2022-12-22 15:52:18 +02:00
fluxcdbot
be361a44d5 Update toolkit components
- helm-controller to v0.28.1
  https://github.com/fluxcd/helm-controller/blob/v0.28.1/CHANGELOG.md
- notification-controller to v0.30.2
  https://github.com/fluxcd/notification-controller/blob/v0.30.2/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-22 15:34:56 +02:00
Stefan Prodan
12e065cc43 Merge pull request #3429 from fluxcd/cli-notification-v1beta2
Update CLI commands to Notification API v1beta2
2022-12-21 17:32:23 +02:00
Stefan Prodan
f9e69089ea Update CLI commands to Notification API v1beta2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-21 17:14:18 +02:00
Stefan Prodan
2eced064dd Merge pull request #3428 from fluxcd/update-components
Update notification-controller to v0.30.1
2022-12-21 16:56:23 +02:00
fluxcdbot
7be91884b7 Update toolkit components
- notification-controller to v0.30.1
  https://github.com/fluxcd/notification-controller/blob/v0.30.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-12-21 14:38:45 +00:00
Hidde Beydals
b2b610b55e Merge pull request #3427 from fluxcd/update-deps
Update dependencies
2022-12-21 12:09:40 +00:00
Stefan Prodan
21a943e6f9 e2e: Update Kubernetes to v1.23.13 on AMD64
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-21 13:49:13 +02:00
Hidde Beydals
cb1b117d17 tests/azure: update dependencies
- github.com/fluxcd/go-git/v5 to v5.0.0-20221219190809-2e5c9d01cfc4

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-21 10:50:10 +00:00
Hidde Beydals
96f177b101 Update dependencies
- github.com/distribution/distribution/v3 to v3.0.0-20221208165359-362910506bc2
- github.com/fluxcd/go-git/v5 to v5.0.0-20221219190809-2e5c9d01cfc4
- github.com/fluxcd/go-git-providers to v0.12.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-21 10:49:12 +00:00
Hidde Beydals
7621418b72 tests/azure: update toolkit components
- github.com/fluxcd/helm-controller/api to v0.28.0
- github.com/fluxcd/image-automation-controller/api to v0.28.0
- github.com/fluxcd/image-reflector-controller/api to v0.23.1
- github.com/fluxcd/kustomize-controller/api to v0.32.0
- github.com/fluxcd/notification-controller/api to v0.30.0
- github.com/fluxcd/source-controller/api to v0.33.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-12-21 10:31:33 +00:00
Stefan Prodan
7a94a3ac71 Merge pull request #3360 from fluxcd/update-components
Update toolkit components
2022-12-21 12:22:49 +02:00
fluxcdbot
58b799fa83 Update toolkit components
- helm-controller to v0.28.0
  https://github.com/fluxcd/helm-controller/blob/v0.28.0/CHANGELOG.md
- kustomize-controller to v0.32.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.32.0/CHANGELOG.md
- source-controller to v0.33.0
  https://github.com/fluxcd/source-controller/blob/v0.33.0/CHANGELOG.md
- notification-controller to v0.30.0
  https://github.com/fluxcd/notification-controller/blob/v0.30.0/CHANGELOG.md
- image-reflector-controller to v0.23.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.23.1/CHANGELOG.md
- image-automation-controller to v0.28.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.28.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-12-21 09:54:10 +00:00
Stefan Prodan
38635e0ec5 Merge pull request #3418 from somtochiama/fix-path-push
Fix path on `flux push`
2022-12-20 13:35:32 +02:00
Somtochi Onyekwere
d79e49f80b fix path on flux push
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-12-20 12:15:35 +01:00
Paulo Gomes
5e44b7b1b3 Merge pull request #3424 from pjbgf/cosign-revert
build: Revert sigstore/cosign-installer to v2.8.1
2022-12-19 13:54:23 +00:00
Paulo Gomes
131c05d9c7 build: Revert sigstore/cosign-installer to v2.8.1
Dependabot should stick to tagged versions if the existing hash relates
to the tag made in the comment.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-12-19 13:29:02 +00:00
Paulo Gomes
3ac8d54a30 Merge pull request #3422 from fluxcd/dependabot/github_actions/goreleaser/goreleaser-action-4.1.0
Bump goreleaser/goreleaser-action from 3.2.0 to 4.1.0
2022-12-19 13:28:32 +00:00
dependabot[bot]
c605f9a44f Bump goreleaser/goreleaser-action from 3.2.0 to 4.1.0
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 3.2.0 to 4.1.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](b508e2e3ef...8f67e590f2)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 13:07:50 +00:00
Paulo Gomes
eefd47d701 Merge pull request #3420 from fluxcd/dependabot/github_actions/actions/checkout-3.2.0
Bump actions/checkout from 3.1.0 to 3.2.0
2022-12-19 13:05:34 +00:00
dependabot[bot]
0014bc4c43 Bump actions/checkout from 3.1.0 to 3.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](93ea575cb5...755da8c3cf)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 12:32:31 +00:00
Paulo Gomes
ccf358f0ca Merge pull request #3421 from fluxcd/dependabot/github_actions/actions/setup-go-3.5.0
Bump actions/setup-go from 3.4.0 to 3.5.0
2022-12-19 12:31:58 +00:00
dependabot[bot]
bd284ab28b Bump actions/setup-go from 3.4.0 to 3.5.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](d0a58c1c4d...6edd4406fa)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 12:14:24 +00:00
Paulo Gomes
bed46f6b68 Merge pull request #3423 from fluxcd/dependabot/github_actions/github/codeql-action-2.1.37
Bump github/codeql-action from 2.1.36 to 2.1.37
2022-12-19 12:11:19 +00:00
dependabot[bot]
fdd3fd1d06 Bump github/codeql-action from 2.1.36 to 2.1.37
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.36 to 2.1.37.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](a669cc5936...959cbb7472)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 01:01:28 +00:00
Stefan Prodan
e81201b8cb Merge pull request #3415 from souleb/issue-3411
Fix dry-run still loading kubeconfig issue
2022-12-17 08:49:43 +02:00
Soule BA
2c1085d9ce Fix dry-run still loading kubeconfig issue
If this is implemented, it will not assume that access to a kubeconfig
is guaranteed even if just for retrieving configured namespace.

Signed-off-by: Soule BA <soule@weave.works>
2022-12-17 00:34:38 +01:00
Stefan Prodan
49eb1c5444 Merge pull request #3413 from aryan9600/update-deps
Update dependencies
2022-12-16 13:58:32 +02:00
Sanskar Jaiswal
81dc4adc69 tests/azure: update dependencies
- github.com/Azure/azure-event-hubs-go/v3 to v3.4.0
- github.com/fluxcd/notification-controller/api to v0.29.1
- github.com/fluxcd/pkg/git/gogit to v0.4.0
- go.uber.org/multierr to v1.9.0

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-12-16 16:06:19 +05:30
Sanskar Jaiswal
8e23989418 update dependencies
- github.com/Masterminds/semver/v3 to v3.2.0
- github.com/fluxcd/notification-controller/api to v0.29.1
- github.com/fluxcd/pkg/git/gogit to v0.4.0
- github.com/fluxcd/pkg/oci to v0.17.0
- github.com/onsi/gomega to v1.24.2
- golang.org/x/crypto to v0.4.0
- golang.org/x/term to v0.3.0

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-12-16 16:03:43 +05:30
Stefan Prodan
f532bd2d48 Merge pull request #3408 from souleb/issue-3391
Update fluxcd/pkg/kustomize dependency
2022-12-15 15:37:30 +02:00
Soule BA
da9df03675 Update fluxcd/pkg/kustomize dependency
This fixes the issue where only .yaml was accepted by `flux build/diff` for a kustomization file extension.

It also adds support for kustomize componenents.

Signed-off-by: Soule BA <soule@weave.works>
2022-12-15 12:51:39 +01:00
Stefan Prodan
91965ddfc9 Merge pull request #3389 from somtochiama/build-stdin
Push/Build artifacts from stdin
2022-12-15 11:33:39 +02:00
Somtochi Onyekwere
0bd78ca80c read manifests from stdin
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-12-15 01:36:34 +01:00
Stefan Prodan
96b96ac78e Merge pull request #3404 from fluxcd/azure-e2e-fixes
e2e: Fix Azure test suite
2022-12-14 12:44:43 +02:00
Stefan Prodan
a9a63b8423 Fix flux2-kustomize-helm-example test
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-14 12:20:18 +02:00
Stefan Prodan
8abb93e831 Merge pull request #3403 from somtochiama/fix-azure
Use proper file paths in Azure e2e tests
2022-12-14 11:11:41 +02:00
Somtochi Onyekwere
645f9df4f0 add detail to returned error
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-12-14 01:30:29 +01:00
Somtochi Onyekwere
6924a16ac7 use proper paths for committing
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-12-14 01:27:51 +01:00
Paulo Gomes
dc2a4c267b Merge pull request #3394 from fluxcd/dependabot/github_actions/sigstore/cosign-installer-b6757d8360bb6b9803c38b68e8cb7442baaf7eb5
Update sigstore/cosign-installer requirement to b6757d8360bb6b9803c38b68e8cb7442baaf7eb5
2022-12-12 10:57:23 +00:00
dependabot[bot]
d5e5a26f5c Update sigstore/cosign-installer requirement to b6757d8360bb6b9803c38b68e8cb7442baaf7eb5
Updates the requirements on [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) to permit the latest version.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](b6757d8360)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 10:27:54 +00:00
Paulo Gomes
df5ac34c9b Merge pull request #3377 from aryan9600/use-pkg-git
bootstrap: fallback to default known_hosts
2022-12-12 10:26:48 +00:00
Sanskar Jaiswal
319dbad795 bump go-git packages in tests/azure
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-12-12 15:33:34 +05:30
Sanskar Jaiswal
28feb8b1d7 bootstrap: fallback to default known_hosts
Use default known_hosts and ssh configuration when no private key file
is provided while bootstraping using ssh.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-12-12 15:33:34 +05:30
Paulo Gomes
f4d898cb92 Merge pull request #3393 from fluxcd/dependabot/github_actions/github/codeql-action-2.1.36
Bump github/codeql-action from 2.1.35 to 2.1.36
2022-12-12 09:12:23 +00:00
dependabot[bot]
75b5b0fd3c Bump github/codeql-action from 2.1.35 to 2.1.36
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.35 to 2.1.36.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b2a92eb56d...a669cc5936)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 00:29:53 +00:00
Paulo Gomes
6ee3439462 Merge pull request #3372 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-4.2.3
Bump peter-evans/create-pull-request from 4.2.2 to 4.2.3
2022-12-05 08:29:38 +00:00
dependabot[bot]
4eda5a7ccd Bump peter-evans/create-pull-request from 4.2.2 to 4.2.3
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](331d02c7e2...2b011faafd)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 08:08:45 +00:00
Paulo Gomes
ad94037516 Merge pull request #3371 from fluxcd/dependabot/github_actions/snyk/actions-1cc9026f51d822442cb4b872d8d7ead8cc69a018
Bump snyk/actions from a8dd587d8a94f5663fa3d67d51abd0cc66aff244 to 1cc9026f51d822442cb4b872d8d7ead8cc69a018
2022-12-05 08:06:32 +00:00
dependabot[bot]
882fb35601 Bump snyk/actions
Bumps [snyk/actions](https://github.com/snyk/actions) from a8dd587d8a94f5663fa3d67d51abd0cc66aff244 to 1cc9026f51d822442cb4b872d8d7ead8cc69a018.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](a8dd587d8a...1cc9026f51)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 07:47:09 +00:00
Paulo Gomes
48f10a6a20 Merge pull request #3370 from fluxcd/dependabot/github_actions/actions/setup-go-3.4.0
Bump actions/setup-go from 3.3.1 to 3.4.0
2022-12-05 07:46:47 +00:00
dependabot[bot]
2c35880cbf Bump actions/setup-go from 3.3.1 to 3.4.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](c4a742cab1...d0a58c1c4d)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 06:46:50 +00:00
Paulo Gomes
c8af9ced89 Merge pull request #3369 from fluxcd/dependabot/github_actions/github/codeql-action-2.1.35
Bump github/codeql-action from 2.1.33 to 2.1.35
2022-12-05 06:46:28 +00:00
dependabot[bot]
f89525f8bd Bump github/codeql-action from 2.1.33 to 2.1.35
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.33 to 2.1.35.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](678fc3afe2...b2a92eb56d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 00:43:23 +00:00
Paulo Gomes
ad11fbcd00 Merge pull request #3352 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-4.2.2
Bump peter-evans/create-pull-request from 4.2.0 to 4.2.2
2022-11-30 11:48:00 +00:00
dependabot[bot]
9db661ae63 Bump peter-evans/create-pull-request from 4.2.0 to 4.2.2
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.0 to 4.2.2.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](b4d51739f9...331d02c7e2)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 01:15:01 +00:00
Stefan Prodan
fff5cd50f0 Merge pull request #3350 from fluxcd/fix-nc-image
Set notification-controller container image to GHCR
2022-11-25 14:46:18 +02:00
Stefan Prodan
b3b50cf503 Set notification-controller image to GHCR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-25 12:41:44 +02:00
Stefan Prodan
cbebad9586 Merge pull request #3193 from bkreitch/process-getversion-error
Process getVersion error in bootstrap
2022-11-23 14:19:00 +02:00
Boris Kreitchman
c01023d8f8 Process getVersion error in bootstrap
Signed-off-by: Boris Kreitchman <bkreitch@gmail.com>
2022-11-23 13:37:20 +02:00
Stefan Prodan
df610c3cca Merge pull request #3345 from fluxcd/azure-e2e-refactoring
e2e: Refactor Azure test suite to use go-git
2022-11-23 12:37:13 +02:00
Somtochi Onyekwere
3b7c40bbb3 e2e: Refactor Azure test suite to use go-git
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-11-23 11:36:57 +02:00
Hidde Beydals
8674f31874 Merge pull request #3339 from fluxcd/update-deps
Update dependencies
2022-11-22 14:27:54 +00:00
Hidde Beydals
b518aad5ac tests/azure: update dependencies
- github.com/Azure/azure-event-hubs-go/v3 to v3.3.20
- github.com/fluxcd/helm-controller/api to v0.27.0
- github.com/fluxcd/image-automation-controller/api to v0.27.0
- github.com/fluxcd/image-reflector-controller/api to v0.23.0
- github.com/fluxcd/kustomize-controller/api to v0.31.0
- github.com/fluxcd/notification-controller/api to v0.29.0
- github.com/fluxcd/pkg/apis/meta to v0.18.0
- github.com/fluxcd/pkg/runtime to v0.24.0
- github.com/fluxcd/source-controller/api to v0.32.1
- github.com/stretchr/testify to v1.8.1
- k8s.io/api to v0.25.4
- k8s.io/apimachinery to v0.25.4
- k8s.io/client-go to v0.25.4
- sigs.k8s.io/controller-runtime to v0.13.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-22 14:07:28 +00:00
Hidde Beydals
12959dec88 Update dependencies
- github.com/distribution/distribution/v3 to v3.0.0-20221119093643-85d4039064cc
- github.com/fluxcd/go-git-providers to v0.11.0
- golang.org/x/crypto to v0.3.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-22 14:07:08 +00:00
Hidde Beydals
e381da6a08 Merge pull request #3294 from fluxcd/uninstall-err
Aggregate errors in uninstall functions
2022-11-22 13:57:56 +00:00
Hidde Beydals
b004fbfc41 Use k8s.io/apimachinery/pkg for error aggregation
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-22 13:29:35 +00:00
Philip Laine
8c56ccc5b0 Aggregate errors in uninstall functions
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-11-22 13:29:20 +00:00
Hidde Beydals
c8051eeeed Merge pull request #3326 from fluxcd/update-components
Update toolkit components
2022-11-22 13:27:57 +00:00
fluxcdbot
5d944b69df Update toolkit components
- helm-controller to v0.27.0
  https://github.com/fluxcd/helm-controller/blob/v0.27.0/CHANGELOG.md
- kustomize-controller to v0.31.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.31.0/CHANGELOG.md
- source-controller to v0.32.1
  https://github.com/fluxcd/source-controller/blob/v0.32.1/CHANGELOG.md
- notification-controller to v0.29.0
  https://github.com/fluxcd/notification-controller/blob/v0.29.0/CHANGELOG.md
- image-reflector-controller to v0.23.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.23.0/CHANGELOG.md
- image-automation-controller to v0.27.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.27.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-11-22 12:59:39 +00:00
Paulo Gomes
1fca76c4a8 Merge pull request #3323 from pjbgf/hermetic-actions
build: Pin GitHub Actions
2022-11-17 16:48:27 +00:00
Paulo Gomes
d0e6fcad3f build: Pin GitHub Actions
The main benefit of pinning GitHub actions is the determinism it brings
in terms of what version of a given action will be executed. This is
a step towards having hermetic builds.

Once pinned to a commit, dependabot will automatically issue PRs to update
to newer versions.

Pinned versions is the only security metric from OpenSSF scorecard that
this repository currently have a zero score.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-11-17 15:33:59 +00:00
Paulo Gomes
d4ba6c4f44 Merge pull request #3299 from aryan9600/use-pkg-git
Refactor bootstrap process to use `fluxcd/pkg/git`
2022-11-17 13:39:14 +00:00
Sanskar Jaiswal
35e1b5cbb9 add aws codecommit example and validation; azure devops example
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-11-17 17:42:44 +05:30
Sanskar Jaiswal
f8da3a1b44 make gpg signing more robust for bootstrap
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-11-17 17:30:49 +05:30
Sanskar Jaiswal
4ea253220a use fluxcd/go-git instead of go-git/go-git directly
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-11-17 17:30:49 +05:30
Sanskar Jaiswal
0a5048a56b refactor bootstrap process to use fluxcd/pkg/git
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-11-17 17:30:49 +05:30
Hidde Beydals
a06652a374 Merge pull request #3233 from fluxcd/rfc-artifact-revision-fmt
RFC-0005: Artifact `Revision` format and introduction of `Digest`
2022-11-17 11:52:55 +00:00
Hidde Beydals
86e3991998 RFC: change 0005 status to implementable
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
d9102150cf RFC: address more nits
- Properly refer to OCI repository name
- Ensure checksum examples are unique to help distinguish difference
  between Revision and Digest
- Slightly change proposal wordings to explicitly mention deprecation
  of `Checksum` field
- Add reference to OCI digests spec

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
fd08bae1c7 RFC: reword summary
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
4b2af2ede2 RFC: address review nits
Various typo and structural fixes.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
c6be0b9389 RFC: add assigned reference number (0005)
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
6ccdfa074f RFC: wording nit
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
8801029d95 RFC: avoid overlap between calculation and config
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
5faf6ebadc RFC: add design details artifact digest
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
f92d708051 RFC: add design details artifact revision
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
76c31c6303 RFC: outline design details
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
cf8ac4dd0e RFC: document alternatives
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
879041677c RFC: write down user stories
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
cac36365ae RFC: add additional user story about algo config
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
2c12385344 RFC: add revision format example for Buckets
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Hidde Beydals
fa217b8775 RFC: draft proposal for artifact revision fmt
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-11-17 11:22:41 +00:00
Stefan Prodan
6f7cdde1ba Merge pull request #3324 from fluxcd/kubectl-1.25.4
Update kubectl and remove nsswitch.conf in flux-cli image
2022-11-17 11:38:35 +02:00
Stefan Prodan
da9cc00a56 Update kubectl and remove nsswitch.conf in flux-cli image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-17 11:14:06 +02:00
Stefan Prodan
161c90eb8f Merge pull request #3317 from souleb/update-pkg-kustomize
Add a dry-run mode to flux build kustomization
2022-11-16 18:10:59 +02:00
Soule BA
ad5daee004 Add a dry-run mode to flux build kustomization
If implemented user will be able to use `flux build kustomization`
without any connection to the cluster.

Signed-off-by: Soule BA <soule@weave.works>
2022-11-16 16:06:30 +01:00
Soule BA
35ea91c111 Revert MakeSecureFSOnDisk to MakeFSOnDisk
The reason to this is because MakeSecureFSOnDisk is not consistent
between OS.

Signed-off-by: Soule BA <soule@weave.works>
2022-11-16 10:23:35 +01:00
Stefan Prodan
6763490ef6 Merge pull request #3288 from fluxcd/dependabot/github_actions/hashicorp/setup-terraform-2.0.3
Bump hashicorp/setup-terraform from 2.0.2 to 2.0.3
2022-11-15 12:46:36 +02:00
dependabot[bot]
93382f65bb Bump hashicorp/setup-terraform from 2.0.2 to 2.0.3
Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/hashicorp/setup-terraform/releases)
- [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/setup-terraform/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: hashicorp/setup-terraform
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-09 13:33:14 +00:00
Stefan Prodan
190c732c3a Merge pull request #3303 from fluxcd/e2e-arm64-flux-monitoring
monitoring: Use kube-prometheus-stack signed OCI Helm chart
2022-11-09 15:32:24 +02:00
Stefan Prodan
8bd13edc75 Add the monitoring stack to e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-09 14:10:56 +02:00
Stefan Prodan
98e0774f56 Use kube-prometheus-stack signed OCI Helm chart
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-09 14:05:46 +02:00
Philip Laine
c3a44e890d Merge pull request #3249 from fluxcd/bootstrap/files
Remove file reading from bootstrap package
2022-11-07 09:07:55 +01:00
Philip Laine
a4734d7e30 Remove file reading from bootstrap package
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-11-04 15:23:08 +01:00
Stefan Prodan
2c267c95e5 Merge pull request #3281 from fluxcd/e2e-arm64-refactoring
Refactor ARM64 e2e test suite
2022-11-04 15:19:22 +02:00
Stefan Prodan
78f9a6214c Refactor ARM64 e2e test suite
- Migrate the GitHub runners to Equinix c3.large.arm64 instances
- Run the test suite on all supported Kubernetes versions
- Add multi-tenancy smoke test

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-04 14:14:37 +02:00
Paulo Gomes
7ee90a34e5 Merge pull request #3269 from fluxcd/dependabot/github_actions/actions/setup-go-3
Bump actions/setup-go from 2 to 3
2022-10-31 08:49:48 +00:00
dependabot[bot]
1a6b09afb4 Bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-31 00:45:59 +00:00
Stefan Prodan
c7e158aaa7 Merge pull request #3081 from aryan9600/rfc-insecure-http
RFC-0004: Block insecure HTTP connections across Flux
2022-10-24 13:55:21 +03:00
Sanskar Jaiswal
98c7afd69c add last updated date and mark as implementable
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
f3da59e5af fix markdown formatting and update status conditions
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
a17210f387 add implementation history section
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
443212d3da rename flag and propose renaming insecure-kubeconfig-tls
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
7a5f60e23f address concerns about kustomize and helm controller
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
7a1d978339 add details about CLI in insecure HTTP RFC
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
6c7ef96354 add design details for insecure HTTP RFC
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
d2e7a37eb4 add user stories and alternatives for insecure HTTP RFC
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Sanskar Jaiswal
1d8105247a add RFC for blocking insecure HTTP connections across Flux
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-24 05:35:57 -04:00
Stefan Prodan
6d110cdfb1 Merge pull request #3229 from fluxcd/rfc-0002-cosign
RFC-0002: Add Cosign verification for Helm OCI charts
2022-10-24 12:24:16 +03:00
Stefan Prodan
d015895caa RFC-0002: Add Cosign verification for Helm OCI charts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-23 12:09:34 +03:00
Stefan Prodan
64e76a23c6 Merge pull request #3242 from fluxcd/kube-1.25.3
Update dependencies
2022-10-21 22:07:03 +03:00
Stefan Prodan
f5006aa239 Update dependencies
- Kubernetes packages to v1.25.3
- Fix CVE-2022-32149
- Sync tests go.mod with root

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-21 21:29:17 +03:00
Stefan Prodan
4bd06771ae Merge pull request #3187 from fluxcd/update-components
Update toolkit components
2022-10-21 20:59:27 +03:00
fluxcdbot
4643f8383e Update toolkit components
- helm-controller to v0.26.0
  https://github.com/fluxcd/helm-controller/blob/v0.26.0/CHANGELOG.md
- kustomize-controller to v0.30.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.30.0/CHANGELOG.md
- source-controller to v0.31.0
  https://github.com/fluxcd/source-controller/blob/v0.31.0/CHANGELOG.md
- notification-controller to v0.28.0
  https://github.com/fluxcd/notification-controller/blob/v0.28.0/CHANGELOG.md
- image-reflector-controller to v0.22.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.22.1/CHANGELOG.md
- image-automation-controller to v0.26.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.26.1/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-21 20:37:09 +03:00
Philip Laine
b82759b35a Merge pull request #3237 from fluxcd/move/bootstrap
Move bootstrap package from internal to pkg
2022-10-21 13:47:39 +02:00
Philip Laine
0343575146 Move bootstrap package from internal to pkg
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-10-21 11:54:28 +02:00
Stefan Prodan
e7847b75db Merge pull request #3236 from fluxcd/ci-refactor
ci: Refactor GitHub workflows
2022-10-21 10:56:24 +03:00
Stefan Prodan
bb1078d610 ci: Refactor GitHub workflows
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-21 09:46:10 +03:00
Stefan Prodan
6f6c097980 Merge pull request #3232 from eddie-knight/fix/workflow-permissions
Additional workflow permissions tweaks
2022-10-20 21:15:55 +03:00
Eddie Knight
73692df272 Additional workflow permissions tweaks
Signed-off-by: Eddie Knight <knight@linux.com>
2022-10-20 12:48:05 -05:00
Stefan Prodan
138cba6e57 Merge pull request #3231 from eddie-knight/fix/workflow-permissions
Adjusted workflow permissions
2022-10-20 20:35:08 +03:00
Eddie Knight
2abf932ee4 Updated scan & update permissions
Signed-off-by: Eddie Knight <knight@linux.com>
2022-10-20 12:09:34 -05:00
Eddie Knight
939a75115c Adjusted workflow permissions
Signed-off-by: Eddie Knight <knight@linux.com>
2022-10-20 11:04:49 -05:00
Stefan Prodan
9f41efb6f7 Merge pull request #3224 from developer-guy/feature/diff
Add `diff artifact` command
2022-10-20 13:46:15 +03:00
Batuhan Apaydın
c3d7cad53e feat: diff artifact capability added
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-10-20 13:23:50 +03:00
Stefan Prodan
463f9fbc64 Merge pull request #3218 from fluxcd/dependabot/github_actions/peter-evans/create-pull-request-4
Bump peter-evans/create-pull-request from 3 to 4
2022-10-19 17:19:08 +03:00
dependabot[bot]
4a51b111e6 Bump peter-evans/create-pull-request from 3 to 4
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3 to 4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 13:48:54 +00:00
Philip Laine
63ebd7fd09 Merge pull request #3217 from fluxcd/dependabot/github_actions/hashicorp/setup-terraform-2.0.2
Bump hashicorp/setup-terraform from 1 to 2.0.2
2022-10-19 15:48:10 +02:00
dependabot[bot]
c31367909e Bump hashicorp/setup-terraform from 1 to 2.0.2
Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 1 to 2.0.2.
- [Release notes](https://github.com/hashicorp/setup-terraform/releases)
- [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/setup-terraform/compare/v1...v2.0.2)

---
updated-dependencies:
- dependency-name: hashicorp/setup-terraform
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 13:26:45 +00:00
Stefan Prodan
0f0649a674 Merge pull request #3219 from fluxcd/dependabot/github_actions/github/codeql-action-2
Bump github/codeql-action from 1 to 2
2022-10-19 16:26:04 +03:00
dependabot[bot]
09cbf348a7 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 07:32:38 +00:00
Stefan Prodan
287bc520b1 Merge pull request #3220 from fluxcd/fix-dependabot
Only run e2e tests for Dependabot PRs
2022-10-18 10:31:58 +03:00
Stefan Prodan
65a2ceec5c Only run e2e tests for Dependabot PRs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-17 19:49:57 +03:00
Stefan Prodan
516399bf81 Merge pull request #3216 from fluxcd/dependabot
Enable Dependabot for GitHub Actions
2022-10-17 19:20:42 +03:00
Stefan Prodan
4ea70765af Enable Dependabot for GitHub Actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-17 18:57:09 +03:00
Stefan Prodan
d6372e396b Merge pull request #3213 from fluxcd/fossa-badge
Add FOSSA license scanning badge
2022-10-17 17:02:33 +03:00
Stefan Prodan
7b20ad5dd2 Add link to roadmap, adopters and ecosystem
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-17 16:38:20 +03:00
Stefan Prodan
3d962136a8 Add FOSSA license scanning badge
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-17 16:36:25 +03:00
Stefan Prodan
f3386505cf Merge pull request #3214 from eddie-knight/docs/artifact-hub-badge
Added ArtifactHub badge
2022-10-17 16:36:11 +03:00
Eddie Knight
f4c8da35e8 Added ArtifactHub badge
Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com>
2022-10-15 11:03:04 -05:00
Philip Laine
cc3f2c7bde Merge pull request #3197 from fluxcd/move-uninstall
Move uninstall code to pkg
2022-10-13 11:07:38 +02:00
Philip Laine
80b87729b6 Move uninstall code to pkg
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-10-12 19:25:14 +02:00
Philip Laine
2282223592 Merge pull request #3198 from fluxcd/discard-logger
Add nop logger
2022-10-12 14:14:51 +02:00
Philip Laine
f6c96aea48 Add discard logger
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-10-12 11:55:00 +02:00
Stefan Prodan
1fa48bf916 Merge pull request #3190 from developer-guy/feature/3180
Accept a file path as input for `flux build|push artifact`
2022-10-11 14:56:19 +03:00
Batuhan Apaydın
d49b77c8d2 chore: bump the pkg/oci package to v0.12.0
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-10-11 14:32:24 +03:00
Stefan Prodan
91132e9c87 Merge pull request #3174 from fluxcd/fix/azure-libgit2
Update libgit2 version in Azure e2e tests
2022-10-07 16:43:56 +03:00
Philip Laine
4680abe951 Update libgit2 version in Azure e2e tests
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-10-07 15:26:06 +02:00
Stefan Prodan
2963708a6c Merge pull request #3162 from somtochiama/fix-oci
Update golden file for `get source oci`
2022-10-06 13:50:16 +02:00
Somtochi Onyekwere
1f57cf3d31 Update oci golden file
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-09-30 06:04:38 +01:00
Stefan Prodan
80611ec70e Merge pull request #3161 from fluxcd/rfc-0003-implemented
Update RFC-0003 implementation history
2022-09-29 21:59:25 +03:00
Stefan Prodan
d37bb42995 Update RFC-0003 implementation history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-29 21:32:34 +03:00
Stefan Prodan
1bf63a94c2 Merge pull request #3149 from fluxcd/update-components
Update toolkit components
2022-09-29 21:27:56 +03:00
Stefan Prodan
cad251444c Update OCI golden files
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-29 21:06:57 +03:00
fluxcdbot
358c6d38b7 Update toolkit components
- helm-controller to v0.25.0
  https://github.com/fluxcd/helm-controller/blob/v0.25.0/CHANGELOG.md
- kustomize-controller to v0.29.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.29.0/CHANGELOG.md
- source-controller to v0.30.0
  https://github.com/fluxcd/source-controller/blob/v0.30.0/CHANGELOG.md
- notification-controller to v0.27.0
  https://github.com/fluxcd/notification-controller/blob/v0.27.0/CHANGELOG.md
- image-reflector-controller to v0.22.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.22.0/CHANGELOG.md
- image-automation-controller to v0.26.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.26.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-09-29 18:04:36 +00:00
Stefan Prodan
b8fd46d0df Merge pull request #3098 from Santosh1176/monitoring
[Grafana] Use `container_memory_working_set_bytes` to report memory consumption
2022-09-29 11:16:10 +03:00
Santosh Kaluskar
6a1ba3c545 monitoring: use container_memory_working_set_bytes
Signed-off-by: Santosh Kaluskar <dtshbl@gmail.com>
2022-09-29 07:49:13 +00:00
Stefan Prodan
33a874800b Merge pull request #3154 from fluxcd/rfc-0003-cosign
[RFC-0003] Add Cosign keyless specification
2022-09-29 09:42:20 +03:00
Stefan Prodan
f417352370 Add Cosign keyless specification
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-29 09:20:46 +03:00
Stefan Prodan
72d90b5692 Merge pull request #3153 from fluxcd/build-go1.19
Build with Go 1.19
2022-09-29 00:21:18 +03:00
Stefan Prodan
d7dadb4425 e2e: Update bootstrap test to Kubernetes 1.25.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-28 23:54:08 +03:00
Stefan Prodan
348408e16e Build with Go 1.19
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-28 22:05:48 +03:00
Stefan Prodan
04de52044a Merge pull request #3117 from carlosonunez-vmw/main
Maintain original scheme when using --token-auth
2022-09-28 10:51:06 +03:00
Carlos Nunez
45a00a0170 Maintain original scheme when using --token-auth
If you're using an HTTP-based Git server with Flux, you need to provide `--token-auth` to avoid triggering an SSH host key check (see [here](https://github.com/fluxcd/flux2/issues/2825#issuecomment-1151355914)). Unfortunately, doing this forces the URL in the `GitRepository` resource created during bootstrapping to always use `https`. This will cause Kustomization reconcile errors for servers that do not have HTTPS enabled or do not have the appropriate certs installed or available.

This pull request fixes this by keeping the repository URL scheme intact when using `--token-auth`.

Signed-off-by: Carlos Nunez <75340335+carlosonunez-vmw@users.noreply.github.com>
2022-09-27 22:14:29 -05:00
Stefan Prodan
1ac380a7f9 Merge pull request #3145 from fluxcd/component-label
Add component label for controllers and their CRDs
2022-09-26 14:45:26 +03:00
Stefan Prodan
2971d34a13 Add component label for controllers and their CRDs
Label each controller deployment, service, service account and CRDs with `app.kubernetes.io/component: <controller-name>`.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-26 14:08:32 +03:00
Stefan Prodan
90f0d81532 Merge pull request #3097 from fluxcd/oci-insecure-flag
Add `--insecure` flag to `flux create source oci`
2022-09-12 15:37:52 +03:00
Stefan Prodan
d5262404f3 Add insecure flag to flux create source oci
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-12 14:31:03 +03:00
Stefan Prodan
03c3cb860a Update Azure e2e dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-12 14:21:46 +03:00
Stefan Prodan
a1faa1d965 Merge pull request #3091 from fluxcd/update-components
Update toolkit components
2022-09-12 14:14:52 +03:00
fluxcdbot
c40d290e46 Update toolkit components
- helm-controller to v0.24.0
  https://github.com/fluxcd/helm-controller/blob/v0.24.0/CHANGELOG.md
- kustomize-controller to v0.28.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.28.0/CHANGELOG.md
- source-controller to v0.29.0
  https://github.com/fluxcd/source-controller/blob/v0.29.0/CHANGELOG.md
- notification-controller to v0.26.0
  https://github.com/fluxcd/notification-controller/blob/v0.26.0/CHANGELOG.md
- image-reflector-controller to v0.21.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.21.0/CHANGELOG.md
- image-automation-controller to v0.25.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.25.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-09-12 10:44:50 +00:00
Stefan Prodan
5106a71e6a Merge pull request #3079 from ManoManoTech/push-autologin
Support autologin when pushing OCI artifacts
2022-09-12 13:43:20 +03:00
Adrien Fillon
491acf57ad Setup CodeQL CI job with Go 1.18
Signed-off-by: Adrien Fillon <adrien.fillon@manomano.com>
2022-09-12 12:08:47 +02:00
Adrien Fillon
0694a9582f Support logging in directly to the provider when pushing OCI artifacts
I've noticed during CI, that the current command
already expected a configured Docker client to
push artifacts to authenticated registries.

Some users might not want to have the Docker client
in their process (like a CI job) or build an handcrafted
config.json file.

This would allow this kind of behavior:

```
flux push artifact oci://my-registry.dev/foo:v1 \
  --source xxx \
  --revision xxx \
  --path . \
  --creds $TOKEN # Authenticate via "Bearer $TOKEN" Authorization header
```

Or via Autologin:

```
flux push artifact oci://012345678901.dkr.ecr.us-east-1.amazonaws.com/foo:v1 \
  --source xxx \
  --revision xxx \
  --path . \
  --provider aws
```

This has been implemented for:

* flux push artifact
* flux list artifact
* flux tag artifact
* flux pull artifact

This will require another PR in https://github.com/fluxcd/pkg/pull/352

Signed-off-by: Adrien Fillon <adrien.fillon@manomano.com>
2022-09-12 12:08:47 +02:00
Stefan Prodan
0c817378cf Merge pull request #3085 from souleb/reconcile-repository
[bootstrap] Make sure we reconcile with the right reconciliation method
2022-09-12 12:47:27 +03:00
Soule BA
ec2aa13165 Make sure we reconcile with the right reconciliation method
Signed-off-by: Soule BA <soule@weave.works>
2022-09-12 09:34:24 +02:00
Stefan Prodan
c921cf0d54 Merge pull request #3087 from somtochiama/notify-finalize
Remove finalizers for notification controllers
2022-09-11 15:48:33 +03:00
Somtochi Onyekwere
11dd0d918c remove finalizers for notification controllers
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-09-11 13:16:53 +01:00
Stefan Prodan
467969de0f Merge pull request #3088 from fluxcd/flux-manifests
Publish the install manifests to GHCR and DockerHub as OCI artifacts
2022-09-09 15:23:34 +03:00
Stefan Prodan
bdc5ae4573 Publish install manifests to GHCR and DockerHub as OCI artifacts
Add workflow to build and push the install manifests to:
- ghcr.io/fluxcd/flux-manifests
- docker.io/fluxcd/flux-manifests
The OCI artifacts are signed with Cosign and GitHub OIDC (keyless).
The manifests pushed to GHCR have the container images set to ghcr.io/fluxcd/<controller-name> while the manifests pushed to DockerHub have the controller images set to docker.io/fluxcd/<controller-name>.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-09 14:49:58 +03:00
Stefan Prodan
1eb4b67013 Merge pull request #3082 from fluxcd/uninstall-oci-repos
Remove finalizers for OCI repositories on uninstall
2022-09-08 11:07:21 +03:00
Stefan Prodan
e777947539 Remove finalizers for OCI repositories on uninstall
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-08 10:43:31 +03:00
Stefan Prodan
70b906cae2 Merge pull request #3053 from dholbach/revert-3034-fix/broken-edit-page-links-2203
Revert "Fix broken "edit this page" links in Flux CLI section"
2022-09-06 16:52:19 +03:00
Daniel Holbach
c57afa1e56 Revert "Fix broken "edit this page" links in Flux CLI section"
Signed-off-by: Daniel Holbach <daniel@weave.works>
2022-09-06 15:20:42 +02:00
Stefan Prodan
73668d19d9 Merge pull request #3073 from acondrat/patch-1
Filter out non-running pods in Prometheus
2022-09-06 16:09:57 +03:00
Arcadie Condrat
82f847e21d Filter out non-running pods in Prometheus
Prometheus job generated by the PodMonitor does not exclude non-running pods. All the "completed" Pods are still going to be  listed as targets in Prometheus and marked as down. This issue is related to PodMonitor implementation and is discussed in prometheus-operator/prometheus-operator#4816

Signed-off-by: Arcadie Condrat <arcadie.condrat@gmail.com>
2022-09-05 11:34:39 +02:00
Stefan Prodan
753b2e6eda Merge pull request #3063 from somtochiama/update-runtime
Update `flux logs` to accomodate the new format
2022-09-01 19:17:49 +03:00
Somtochi Onyekwere
7b95e90a33 Update flux logs to accomodate the new format
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-31 17:58:43 +01:00
Stefan Prodan
7824229d7b Merge pull request #3052 from dholbach/update-flux-docs-structure
update to new doc links structure
2022-08-30 16:08:53 +03:00
Daniel Holbach
20557f9f15 update to new doc links structure
Signed-off-by: Daniel Holbach <daniel@weave.works>
2022-08-30 14:50:05 +02:00
Stefan Prodan
6430f2b4b0 Merge pull request #3048 from fluxcd/azure-e2e-updates
Update packages in Azure e2e tests
2022-08-30 10:29:46 +03:00
Stefan Prodan
92e136ed54 Update packages in Azure e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-08-29 16:50:26 +02:00
Stefan Prodan
e79b008878 Merge pull request #3050 from fluxcd/oci-rfc-updates
Status update for RFC-0002 and RFC-0003
2022-08-29 17:09:30 +03:00
Stefan Prodan
43cdea01d6 Status update for RFC-0002 and RFC-0003
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-29 16:31:51 +03:00
Stefan Prodan
6ddaedb4fc Merge pull request #3049 from fluxcd/kube-1.25
Update Kubernetes dependencies to v1.25.0
2022-08-29 15:24:31 +03:00
Stefan Prodan
b4fef0a6b9 Update Kubernetes dependencies to v1.25.0
- update `k8s.io` packages to match the Kubernetes v1.25.0 release
- update `kubectl` to v1.25.0 in the flux-cli container image
- update `go.mod` to Go 1.18

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-29 15:03:36 +03:00
Stefan Prodan
735ebd3336 Merge pull request #2999 from fluxcd/update-components
Update toolkit components
2022-08-29 14:28:37 +03:00
Stefan Prodan
a5a9158a24 Add provider to Helm OCI tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-29 14:09:42 +03:00
fluxcdbot
93fdd795da Update toolkit components
- helm-controller to v0.23.1
  https://github.com/fluxcd/helm-controller/blob/v0.23.1/CHANGELOG.md
- kustomize-controller to v0.27.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.27.1/CHANGELOG.md
- source-controller to v0.28.0
  https://github.com/fluxcd/source-controller/blob/v0.28.0/CHANGELOG.md
- notification-controller to v0.25.2
  https://github.com/fluxcd/notification-controller/blob/v0.25.2/CHANGELOG.md
- image-reflector-controller to v0.20.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.20.1/CHANGELOG.md
- image-automation-controller to v0.24.2
  https://github.com/fluxcd/image-automation-controller/blob/v0.24.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-08-29 10:57:30 +00:00
Stefan Prodan
18c944d18a Merge pull request #3034 from snebel29/fix/broken-edit-page-links-2203
Fix broken "edit this page" links in Flux CLI section #2203
2022-08-26 10:03:36 +03:00
Sven Nebel
2c9ef85f6d Fix broken "edit this page" links in Flux CLI section #2203
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>
2022-08-25 21:01:53 +01:00
Stefan Prodan
80669d71ef Merge pull request #3028 from snebel29/update/terraform-exec-dep
Update tests/azure github.com/hashicorp/terraform-exec to v0.16.1
2022-08-25 18:02:36 +03:00
Sven Nebel
b993d17148 Update tests/azure dependency
- Update "github.com/hashicorp/terraform-exec" to v0.16.1
- Replace "github.com/hashicorp/terraform-exec/tfinstall" with "github.com/hashicorp/hc-install"
- Fix typos and wording in README.md

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>
2022-08-25 15:13:47 +01:00
Stefan Prodan
c454dd481b Merge pull request #3025 from fluxcd/rfc-0002-auth
[RFC-0002] Add auth specification for Helm OCI
2022-08-25 15:09:45 +03:00
Stefan Prodan
07de9d9ffe [RFC-0002] Add auth specification for Helm OCI
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-25 12:16:02 +03:00
Stefan Prodan
9f26b09a06 Merge pull request #3019 from somtochiama/get-cmd
Improve error message in get cmd
2022-08-24 14:59:41 +03:00
Somtochi Onyekwere
ad0f3373b6 Improve error message in get cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-24 11:35:46 +01:00
Stefan Prodan
f880cce4f9 Merge pull request #3024 from fluxcd/validate-version
Add version validation to install commands
2022-08-24 13:27:27 +03:00
Stefan Prodan
8a0fd6ddf9 Add version validation to install commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-24 11:58:29 +03:00
Stefan Prodan
c56f338b12 Merge pull request #3014 from fluxcd/oci-mediatype
[RFC-0003] Select layer by OCI media type
2022-08-23 17:21:49 +03:00
Stefan Prodan
463d241a91 Update TODOs for RFC-0003
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-23 16:03:40 +03:00
Stefan Prodan
db0920ba32 Clarify the layer selection behaviour
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-23 16:03:37 +03:00
Stefan Prodan
16d3180e42 [RFC-0003] OCI select layer by media type
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-23 16:03:37 +03:00
Stefan Prodan
81d2ad8245 Merge pull request #2998 from somtochiama/filter-artifact
Add `--filter-semver` and `--filter-regex` flags to `list artifacts`
2022-08-23 11:00:22 +03:00
Somtochi Onyekwere
96d1c1b2bd Add --filter-semver and regex flags to list artifact
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-22 20:35:15 +01:00
Stefan Prodan
545949c67f Merge pull request #2996 from fluxcd/go-git-providers-up
Update dependencies
2022-08-17 17:52:52 +03:00
Stefan Prodan
342bb81687 Update kubectl to v1.24.3 in flux-cli image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-17 17:12:54 +03:00
Stefan Prodan
60b483569d Update dependencies
- fluxcd/go-git-providers v0.8.0
- google/go-containerregistry v0.11.0
- homeport/dyff v1.5.5
- spf13/cobra v1.5.0
- k8s.io/cli-runtime v0.24.3

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-17 17:12:48 +03:00
Stefan Prodan
b7a2fb4be0 Merge pull request #2997 from fluxcd/make-ghcr-default
Use ghcr.io in the static manifests
2022-08-17 17:11:02 +03:00
Stefan Prodan
5bdc083ce2 Use ghcr.io in the static manifests
Use the same container registry as `flux install` for the static install manifests.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-17 16:48:52 +03:00
Stefan Prodan
787b6953c8 Merge pull request #2995 from fluxcd/oci-ignore
Add `--ignore-paths` arg to `flux build|push artifact`
2022-08-17 15:33:01 +03:00
Stefan Prodan
40717fa4f4 Exclude VCS files by default from OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-17 13:49:38 +03:00
Stefan Prodan
899a1fffca Add --ignore-paths arg to flux build|push artifact
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-16 15:31:39 +03:00
Stefan Prodan
02b38ac8e0 Merge pull request #2945 from somtochiama/reset-test-arg
Reset flag after executing command in tests
2022-08-12 14:00:48 +03:00
Somtochi Onyekwere
5dcd599612 reset cmd flags
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-12 10:49:00 +01:00
Stefan Prodan
854ec02823 Merge pull request #2979 from fluxcd/oci-rfcs-update
Status update for RFC-0002 and RFC-0003
2022-08-11 18:25:39 +03:00
Stefan Prodan
9386b9e0c3 Status update for RFC-0002 and RFC-0003
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-11 17:34:37 +03:00
Stefan Prodan
f2d749069e Merge pull request #2966 from fluxcd/update-components
Update toolkit components
2022-08-11 17:29:33 +03:00
fluxcdbot
d4169aa4dd Update toolkit components
- kustomize-controller to v0.27.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.27.0/CHANGELOG.md
- source-controller to v0.26.1
  https://github.com/fluxcd/source-controller/blob/v0.26.1/CHANGELOG.md
- notification-controller to v0.25.1
  https://github.com/fluxcd/notification-controller/blob/v0.25.1/CHANGELOG.md
- image-reflector-controller to v0.20.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.20.0/CHANGELOG.md
- image-automation-controller to v0.24.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.24.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-08-11 14:03:13 +00:00
Stefan Prodan
c06072d5cf Merge pull request #2856 from fluxcd/oci
[RFC-0003] Add commands for managing OCI artifacts
2022-08-11 17:02:01 +03:00
Max Jonas Werner
7e2d235f53 Merge pull request #2971 from fluxcd/trace-ocirepo
Make `flux trace` work with OCIRepository
2022-08-10 14:56:26 +02:00
Max Jonas Werner
b810aea6cc Make flux trace work with OCIRepository
* Added support for OCIRepositories to `flux trace`
* Changed indentation to compensate new, longer field name "Source
  Revision"
* Added unit tests for the new output

closes #2970

Signed-off-by: Max Jonas Werner <max@e13.dev>
2022-08-10 14:37:28 +02:00
Stefan Prodan
75a879c770 OCI docs improvements
Co-authored-by: Kingdon Barrett <kingdon@weave.works>
Co-authored-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-10 12:02:30 +03:00
Stefan Prodan
d4c5a137a1 Add examples for pushing artifacts with GH Actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 13:51:14 +03:00
Stefan Prodan
d4718f6ff4 Improve artifact commands docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 13:27:45 +03:00
Stefan Prodan
ac9b3d193d Update controllers with OCI support
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:45:33 +03:00
Stefan Prodan
7c7e76f9f0 Use fluxcd/pkg/oci/client
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:45:00 +03:00
Stefan Prodan
08401f62b2 Add OCI provider arg
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:45:00 +03:00
Kingdon Barrett
69e26ca1d9 Pull artifact not push artifact
Fixup docs string to match pull command

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2022-08-09 12:45:00 +03:00
Somtochi Onyekwere
41aac68193 Add link to kubectl repo
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:59 +03:00
Somtochi Onyekwere
fcd38c9395 Fix cli description
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:59 +03:00
Somtochi Onyekwere
fe4b65972a Update cli description
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:59 +03:00
Somtochi Onyekwere
4c576bf599 Add create oci secret command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:59 +03:00
Stefan Prodan
70d30fd52e Update golden files to latest digest
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:59 +03:00
Stefan Prodan
803104578f Add make build-dev command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:59 +03:00
Stefan Prodan
030b6bc77c Update source-controller with OCI metadata
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:59 +03:00
Somtochi Onyekwere
009413affd Add test for annotations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:59 +03:00
Somtochi Onyekwere
9e76787e9f working golden files
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:58 +03:00
Somtochi Onyekwere
b78bbd5b9d fill test files
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:58 +03:00
Somtochi Onyekwere
3e15e83926 Add test for tag/list/build/pull/push artifacts
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:58 +03:00
Stefan Prodan
1b327e9d4e Show artifact digest in list output
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:58 +03:00
Stefan Prodan
7dd736954b Use OCI standard annotations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:58 +03:00
Stefan Prodan
6b98590461 Add --cert-ref to flux create source oci
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:58 +03:00
Stefan Prodan
8049634e4d Add oci:// prefix
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:58 +03:00
Somtochi Onyekwere
adc7981f22 Add tests for source oci command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-09 12:44:58 +03:00
Stefan Prodan
30e5389d02 Run e2e tests for PRs against oci branch
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
b6a78f42ea Update SC with OCI semver support
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
e4fb8e75f9 Add e2e tests for artifact commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
2f35367a7f Add list artifacts command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
2d8db4f20d Implement OCIRepository commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
12a491f538 Update controllers to OCI preview images
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
9503ecafb1 Add artifact commands
Implement build, push, pull and tag artifact commands.
For authentication purposes, all `flux <verb> artifact` commands are using the '~/.docker/config.json' config file and the Docker credential helpers.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:57 +03:00
Stefan Prodan
e927d39a27 Add OCI internal package
Implement OCI artifacts operations using crane

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-09 12:44:56 +03:00
Stefan Prodan
ac50aea21f Merge pull request #2964 from pjbgf/clean-up
Add validation to namespace flag
2022-08-08 15:53:55 +03:00
Paulo Gomes
c45536723c add validation to namespace flag
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-08-08 12:52:02 +01:00
Paulo Gomes
fb1de8c649 remove unused func
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-08-05 19:07:04 +01:00
Stefan Prodan
e1c082e5ac Merge pull request #2955 from somtochiama/logs-test
fix log filter and add tests for `flux logs`
2022-08-03 10:19:25 +03:00
Somtochi Onyekwere
1889b64b4e remove print statement
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-02 19:55:52 +01:00
Somtochi Onyekwere
0cfdc5d674 move struct definition
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-02 19:46:19 +01:00
Somtochi Onyekwere
96afee996a Add unit tests for flux logs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-02 19:44:23 +01:00
Stefan Prodan
da9747a406 Merge pull request #2951 from fluxcd/oci-oidc-auth
[RFC-0003] Add the provider field for OIDC auth
2022-08-02 13:03:56 +03:00
Stefan Prodan
36d219e05c [RFC-0003] Add the provider field for OIDC auth
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-02 11:46:20 +03:00
Hidde Beydals
ea2de24ade Merge pull request #2940 from fluxcd/fix-srcinfo-bin
AUR: further solve `.SRCINFO` issues
2022-07-28 16:27:01 +00:00
Hidde Beydals
f01911d0e2 AUR: further solve .SRCINFO issues
Due to the release CI job running on an Ubuntu machine, we do not have
easy access to `makepkg` to generate the `.SRCINFO` using `--printsrcinfo`
as this is a `pacman` specific utility, and instead we maintain a
template.

Historically seen, something went wrong here while the `PKGBUILD` file
became more complex and certain fields added there were not _also_
included in the `.SRCINFO` template.

This commit ensures everything is restored to working state, and
provides the proper fix for what was attempted in #2917. In addition,
checksums are now included in the file.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-07-28 15:48:27 +00:00
Hidde Beydals
43eb9327d5 Merge pull request #2937 from fluxcd/fix-srcinfo-bin
AUR: ensure `pkgname` is bottom entry in .SRCINFO
2022-07-28 07:41:02 +00:00
Hidde Beydals
ca212ac592 AUR: ensure pkgname is bottom entry in .SRCINFO
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-07-28 07:13:34 +00:00
Sunny
fe3e0efcf1 Merge pull request #2932 from fluxcd/update-components
Update toolkit components
2022-07-27 21:33:58 +05:30
fluxcdbot
ed7a880287 Update toolkit components
- source-controller to v0.25.11
  https://github.com/fluxcd/source-controller/blob/v0.25.11/CHANGELOG.md
- image-reflector-controller to v0.19.4
  https://github.com/fluxcd/image-reflector-controller/blob/v0.19.4/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-07-27 15:47:46 +00:00
Stefan Prodan
e94853f023 Merge pull request #2917 from morancj/aur-srcinfo
SRCINFO: fix path
2022-07-26 14:27:01 +02:00
Ciaran Moran
cbecd8ab56 SRCINFO: consistent style
Signed-off-by: Ciaran Moran <ciaran@weave.works>
2022-07-18 11:48:38 +01:00
Ciaran Moran
feaab54f70 SRCINFO: fix path
Signed-off-by: Ciaran Moran <ciaran@weave.works>
2022-07-18 11:29:15 +01:00
Paulo Gomes
02e12cf871 Merge pull request #2905 from fluxcd/update-components
Update toolkit components
2022-07-18 09:06:13 +01:00
fluxcdbot
7aeec0a0c4 Update toolkit components
- helm-controller to v0.22.2
  https://github.com/fluxcd/helm-controller/blob/v0.22.2/CHANGELOG.md
- kustomize-controller to v0.26.3
  https://github.com/fluxcd/kustomize-controller/blob/v0.26.3/CHANGELOG.md
- source-controller to v0.25.10
  https://github.com/fluxcd/source-controller/blob/v0.25.10/CHANGELOG.md
- notification-controller to v0.24.1
  https://github.com/fluxcd/notification-controller/blob/v0.24.1/CHANGELOG.md
- image-reflector-controller to v0.19.3
  https://github.com/fluxcd/image-reflector-controller/blob/v0.19.3/CHANGELOG.md
- image-automation-controller to v0.23.5
  https://github.com/fluxcd/image-automation-controller/blob/v0.23.5/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-07-15 18:02:07 +00:00
Stefan Prodan
abeea06e72 Merge pull request #2601 from fluxcd/rfc-kubernetes-oci
[RFC-0003] Flux OCI support for Kubernetes manifests
2022-07-08 12:11:29 +03:00
Stefan Prodan
4a55b828b1 Mark RFC-0003 as implementable
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 17:02:19 +03:00
Stefan Prodan
6b9c0a5e48 Add oci:// proto to the spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:45 +03:00
Stefan Prodan
e060873246 Add examples for flux build, push and list commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:42 +03:00
Stefan Prodan
143609b9fb Add specification for spec.url
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
a22438b7fa Add design details
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
34321983e7 Add OCI artifact type to alternatives
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
44762933b3 Add flux tag artifact command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
2912d1d437 Add serviceAccountName to auth spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
4885278691 Restructure the OCI auth spec
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
8a7c94180b Add client certificate authentication
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
183b9a7ee0 Add auto-login feature
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:41 +03:00
Stefan Prodan
0fc582d6fd Add user stories for publishing and reconciling OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:40 +03:00
Stefan Prodan
c7a6ed53ca Add proposal for adding OCI support for Kubernetes manifests to Flux
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-07-06 16:57:40 +03:00
Stefan Prodan
547e39d24c Merge pull request #2881 from fluxcd/update-components
Update toolkit components
2022-06-29 16:36:18 +03:00
fluxcdbot
115b58fe49 Update toolkit components
- kustomize-controller to v0.26.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.26.2/CHANGELOG.md
- source-controller to v0.25.9
  https://github.com/fluxcd/source-controller/blob/v0.25.9/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-29 13:14:11 +00:00
Stefan Prodan
613e270d00 Merge pull request #2851 from TianZong48/fix-logs-stream
logs: write into writer from io.Pipe instead of os.Stdout
2022-06-28 19:27:30 +03:00
TianZong48
c24e738973 logs: write into writer from io.Pipe instead os.Stdout
Signed-off-by: TianZong48 <tianzong48@gmail.com>
2022-06-28 23:27:32 +08:00
Stefan Prodan
e2fb6089c9 Merge pull request #2877 from sympatheticmoose/patch-1
Add the `--branch` arg to the basic auth example
2022-06-28 14:43:42 +03:00
David Harris
95eb7aede0 add branch to basic auth example
Without a reference specified, the create command will fail. 

Signed-off-by: David Harris <david.harris@weave.works>
2022-06-27 21:08:48 +01:00
Stefan Prodan
3cef177e24 Merge pull request #2839 from fluxcd/update-components
Update toolkit components
2022-06-24 16:36:58 +03:00
fluxcdbot
c430556498 Update toolkit components
- source-controller to v0.25.8
  https://github.com/fluxcd/source-controller/blob/v0.25.8/CHANGELOG.md
- image-reflector-controller to v0.19.2
  https://github.com/fluxcd/image-reflector-controller/blob/v0.19.2/CHANGELOG.md
- image-automation-controller to v0.23.4
  https://github.com/fluxcd/image-automation-controller/blob/v0.23.4/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-24 12:29:23 +00:00
Stefan Prodan
ff9c982df4 Merge pull request #2867 from fluxcd/image-finalizers
Remove image finalizers on uninstall
2022-06-24 12:46:28 +03:00
Stefan Prodan
724c93c23d Remove image finalizers on uninstall
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-24 11:34:53 +03:00
Hidde Beydals
769e20423d Merge pull request #2844 from fluxcd/fix-logs-multiple-containers
logs: select manager container when multiple exist
2022-06-23 14:14:58 +02:00
Hidde Beydals
d12e697769 logs: select manager container when multiple exist
This sets the container to `manager` which is used by all Flux
controllers as the container name.

The other options I thought about were selecting the first, or doing
something with image detection. But both can be sensitive to either
users adding their patch as a first entry, or e.g. mirroring the image
to a different name.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-23 13:52:08 +02:00
Stefan Prodan
874b05c5da Merge pull request #2829 from SomtochiAma/update-valuesFrom
Accept multiple values for `flux create hr --values-from`
2022-06-23 14:25:11 +03:00
Somtochi Onyekwere
1894b90d84 Accept multiple valuesFrom for create_helmrelease
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-23 09:09:22 +01:00
Stefan Prodan
cdf5bf3c9e Merge pull request #2862 from bplasmeijer/bugs/monitoring-configmap-in-wrong-namespace
Put the dashboard configmap in the right namespace for monitoring
2022-06-23 08:47:19 +03:00
bart-plasmeijer
5f35bd4e00 put the dashboard config map in the right namespace
Signed-off-by: Bart Plasmeijer <bart.plasmeijer@gmail.com>
2022-06-22 23:05:48 +02:00
Stefan Prodan
12504c76d0 Merge pull request #2859 from SomtochiAma/oci-success-msg
Return different success message for `oci` type - `reconcile_source_helm`
2022-06-22 18:37:11 +03:00
Somtochi Onyekwere
7346b1a762 Return a different success message for helm oci
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-22 12:03:20 +01:00
Stefan Prodan
f7d616d223 Merge pull request #2823 from fluxcd/check-crds
Add CRDs to `flux check` command
2022-06-10 12:00:45 +03:00
Stefan Prodan
443e5b5539 Fail check if no controllers or crds are found
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-09 09:27:27 +03:00
Stefan Prodan
f6c14c939d Add CRDs to flux check command
Verify that the Flux CRDs are registered on the cluster and print their version.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-09 09:17:15 +03:00
Stefan Prodan
a602c57e5d Merge pull request #2820 from fluxcd/update-pkgs
Update dependencies
2022-06-08 15:59:06 +03:00
Stefan Prodan
9ae41899a8 Update go-getter to fix CVEs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-08 15:33:47 +03:00
Stefan Prodan
cfdd5f0284 Update kubectl to v1.24.1 in flux-cli image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-08 15:27:08 +03:00
Stefan Prodan
04b0a0a7ae Update dependencies
- fluxcd/pkg/kustomize v0.5.2
- fluxcd/pkg/runtime v0.16.2
- fluxcd/pkg/ssa v0.17.0
- fluxcd/pkg/ssh v0.5.0
- cli-utils v0.31.2

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-08 15:26:33 +03:00
Stefan Prodan
83fcac1868 Merge pull request #2814 from fluxcd/update-components
Update toolkit components
2022-06-08 15:20:41 +03:00
fluxcdbot
efb0ecb4f9 Update toolkit components
- helm-controller to v0.22.1
  https://github.com/fluxcd/helm-controller/blob/v0.22.1/CHANGELOG.md
- kustomize-controller to v0.26.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.26.1/CHANGELOG.md
- source-controller to v0.25.5
  https://github.com/fluxcd/source-controller/blob/v0.25.5/CHANGELOG.md
- image-reflector-controller to v0.19.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.19.1/CHANGELOG.md
- image-automation-controller to v0.23.2
  https://github.com/fluxcd/image-automation-controller/blob/v0.23.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-08 12:02:56 +00:00
Stefan Prodan
7498d516d4 Merge pull request #2811 from fluxcd/rfc-0002-status-update
[RFC-0002] Update status and implementation history
2022-06-07 12:47:58 +03:00
Stefan Prodan
2fe3362c3d [RFC-0002] Update status and implementation history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-07 12:21:19 +03:00
Stefan Prodan
6473331399 Merge pull request #2809 from fluxcd/update-components
Update source-controller to v0.25.3
2022-06-06 16:12:30 +03:00
fluxcdbot
6f85363e58 Update toolkit components
- source-controller to v0.25.3
  https://github.com/fluxcd/source-controller/blob/v0.25.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-06 12:39:05 +00:00
Stefan Prodan
02c0d3bd0d Merge pull request #2807 from fluxcd/update-azure-deps
Update dependencies
2022-06-04 08:12:50 +03:00
Stefan Prodan
f1f4cc007a Update dependencies
- sync tests/azure with main go.mod
- update homeport/dyff to v1.5.4
- update k8s.io/apiextensions-apiserver to v0.24.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-03 17:51:43 +03:00
Stefan Prodan
7293771766 Merge pull request #2796 from fluxcd/update-components
Update toolkit components
2022-06-03 17:41:06 +03:00
fluxcdbot
25d065c211 Update toolkit components
- helm-controller to v0.22.0
  https://github.com/fluxcd/helm-controller/blob/v0.22.0/CHANGELOG.md
- source-controller to v0.25.2
  https://github.com/fluxcd/source-controller/blob/v0.25.2/CHANGELOG.md
- image-automation-controller to v0.23.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.23.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-03 14:01:51 +00:00
Stefan Prodan
bf14f47459 Merge pull request #2806 from fluxcd/monitoring-logs
monitoring: Add Grafana Loki HR and Flux logs dashboard
2022-06-03 13:24:37 +03:00
Stefan Prodan
8576073b9d monitoring: Add Grafana Loki HR and Flux logs dashboard
- add loki-stack HelmRelease to install Loki and Promtail in the monitoring namespace
- make the loki-stack HelmRelease depend on kube-prometheus-stack to install Loki's datasource and service monitors in the correct order
- add a Grafana dashboard for displaying and filtering the Flux controllers JSON logs

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-03 12:50:41 +03:00
Max Jonas Werner
cbe1331815 Merge pull request #2802 from fluxcd/kubeconfig-secret-ref
Add `--kubeconfig-secret-ref` to `flux create ks|hr`
2022-06-02 15:49:19 +02:00
Stefan Prodan
998b763cf9 Add --kubeconfig-secret-ref to flux create ks|hr
Allow specifying the name of the Kubernetes Secret that contains a key with the kubeconfig file for connecting to a remote cluster.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-02 16:10:31 +03:00
Stefan Prodan
15e8f106ce Merge pull request #2801 from fluxcd/e2e-arm64-kube-1.24
e2e: Update ARM64 runners to Kubernetes 1.24
2022-06-02 15:33:02 +03:00
Stefan Prodan
9aee262054 e2e: Update ARM64 runners to Kubernetes 1.24
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-02 15:18:01 +03:00
Stefan Prodan
c718336143 Merge pull request #2792 from SomtochiAma/flux-diff
Handle multi-doc yaml for flux build
2022-06-02 15:08:27 +03:00
Somtochi Onyekwere
355ed94852 check for correct kustomization in multi-doc yaml
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-02 11:23:58 +01:00
Stefan Prodan
56c5e784fb Merge pull request #2787 from vipulnewaskar7/main
Add `--allow-insecure-http` to `bootstrap git`
2022-06-02 13:19:33 +03:00
Vipul Newaskar
0a30bc1024 allow http git repos connections while bootstrap
Updated misleading error message

Signed-off-by: Vipul Newaskar <vipulnewaskar7@gmail.com>
2022-06-02 10:32:58 +05:30
Vipul Newaskar
a55548de07 allow http git repos connections while bootstrap
This change will allow user to bootstrap with http git urls
But user must explicitely set --allow-insecure-http=true

Signed-off-by: Vipul Newaskar <vipulnewaskar7@gmail.com>
2022-06-02 10:32:58 +05:30
Stefan Prodan
b84e613b5e Merge pull request #2781 from fluxcd/create-source-helm-oci
Add OCI support to `create source helm`
2022-06-01 20:29:40 +03:00
Max Jonas Werner
6b9e6cb9a5 Merge branch 'main' into create-source-helm-oci 2022-06-01 16:35:26 +02:00
Max Jonas Werner
f24c4034e2 Merge pull request #2775 from fluxcd/update-components
Update toolkit components
2022-06-01 16:35:02 +02:00
fluxcdbot
797352e4fa Update toolkit components
- kustomize-controller to v0.26.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.26.0/CHANGELOG.md
- source-controller to v0.25.0
  https://github.com/fluxcd/source-controller/blob/v0.25.0/CHANGELOG.md
- notification-controller to v0.24.0
  https://github.com/fluxcd/notification-controller/blob/v0.24.0/CHANGELOG.md
- image-reflector-controller to v0.19.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.19.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-06-01 14:08:16 +00:00
Max Jonas Werner
7d742924f6 bump SC version in azure test module
Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-06-01 16:06:45 +02:00
Max Jonas Werner
e19ea796b1 Add OCI support to create source helm
closes #2774

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-06-01 15:59:52 +02:00
Stefan Prodan
bcef28e80b Merge pull request #2782 from fluxcd/monitoring-refactoring
Refactor Flux Prometheus monitoring stack
2022-05-30 11:02:21 +03:00
Stefan Prodan
4acef9d508 Add Flux events to dashboard annotations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-29 17:46:02 +03:00
Stefan Prodan
8128fc190d Update kube-prometheus-stack chart to v35
- Automate kube-prometheus-stack helm release upgrades for the v35.x range
- Remove deprecated Grafana settings
- Set Prometheus retention to 24h
- Label Flux dashboards and PodMonitors with `app.kubernetes.io/component: monitoring`
- Change the `podMonitorSelector` to match the label `app.kubernetes.io/component: monitoring`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-29 16:14:18 +03:00
Stefan Prodan
2ba0c4435e Remove deprecated monitoring stack
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-29 16:09:57 +03:00
Stefan Prodan
b8164717da Merge pull request #2767 from takirala/tga/add-ignore-field
Add `--ignore-paths` flag to `flux create source (git|bucket)`
2022-05-28 16:02:34 +03:00
Tarun Gupta Akirala
ed88e9dec5 feat: add --ignore-paths flag to flux create source (git|bucket)
A new --ignore-paths flag is added to following commands:

flux create source git --ignore-paths ...
flux create source bucket --ignore-paths ...

A StringSliceVar is used which supports specifying the flag multiple
times to populate a list or either a comma seperated string value

A unit test with a golden file is added to validate the flag

Signed-off-by: Tarun Gupta Akirala <takirala@users.noreply.github.com>
2022-05-27 09:45:25 -07:00
Stefan Prodan
5ebb985b10 Merge pull request #2778 from fluxcd/go-git-providers
Update go-git-providers to v0.6.0
2022-05-27 17:43:32 +03:00
Stefan Prodan
7f5f80286e Update go-git-providers to v0.6.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-27 17:17:02 +03:00
Stefan Prodan
3cd0bc9672 Merge pull request #2773 from fluxcd/update-deps
Update dependencies
2022-05-27 14:52:11 +03:00
Stefan Prodan
95f896e92c Update fluxcd/pkg/ssh to v0.4.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-27 14:24:25 +03:00
Stefan Prodan
0b9e3d24ef Update GitHub actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-27 13:35:13 +03:00
Stefan Prodan
3f0efc9435 Update dependencies
- Update Kubernetes packages to v1.24
- Update go-yaml to v3.0.0 (fix CVE-2022-28948)
- Update fluxcd/pkg/runtime to v0.15.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-27 13:29:20 +03:00
Stefan Prodan
64205cf523 Merge pull request #2727 from thedataflows/thedataflows/grafana-dashboard
grafana: display exported ns, slight resizing, default sorting by state
2022-05-26 14:46:22 +03:00
Cristian Chiru
38c62d46c7 [grafana dashboard] display exported namespace, slight resizing, default sorting by state
Signed-off-by: Cristian Chiru <cristi.chiru@gmail.com>
2022-05-26 14:21:39 +03:00
Stefan Prodan
b1ac3a26f4 Merge pull request #2769 from fluxcd/go-1.18
Update Go to 1.18 in CI
2022-05-25 13:47:43 +03:00
Stefan Prodan
b795e612f7 Update Go to v1.18
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-25 11:43:30 +03:00
Stefan Prodan
a1a2286794 Update Alpine to v3.16
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-25 11:04:26 +03:00
Hidde Beydals
8c5d83d9fe Merge pull request #2764 from fluxcd/fix-rel-paths-custom-bootstrap
Ensure proper FS root is set while bootstrapping
2022-05-24 12:40:46 +02:00
Hidde Beydals
5130a154e4 Ensure proper FS root is set while bootstrapping
This ensures relative paths to e.g. bases can be used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-24 12:14:21 +02:00
Max Jonas Werner
938f2570ef Merge pull request #2747 from dholbach/update-maintainers-file
Move MAINTAINERS to f/community
2022-05-18 18:16:10 +02:00
Daniel Holbach
97a7b4450f Move MAINTAINERS to f/community
Signed-off-by: Daniel Holbach <daniel@weave.works>
2022-05-18 17:28:49 +02:00
Max Jonas Werner
46fbc7c71b Merge pull request #2748 from makkes/debug-e2e-failure
fix e2e tests
2022-05-18 17:28:28 +02:00
Max Jonas Werner
e35da1c890 trim prefix from server version
It's not part of the `flux check` output.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 17:08:50 +02:00
Max Jonas Werner
9af6175302 fix e2e check test
The output of `kubectl version` has changed with newer kubectl version
from

```
{
  "serverVersion": ...,
  "clientVersion": ...
}
```

to

```
{
  "serverVersion": ...,
  "clientVersion": ...,
  "kustomizeVersion": ...
}
```

So the `kustomizeVersion` field is new which causes the JSON
unmarshaling to fail.

We now just unmarshal it to `map[string]interface{}` and peel the
server git version out of that map manually w/o unmarshalling the JSON
into a custom type.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 16:51:18 +02:00
Max Jonas Werner
e1def4f8ac make e2e test easier to debug
Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 16:36:18 +02:00
Hidde Beydals
e09078f697 Merge pull request #2703 from aryan9600/fix-securefs-macos 2022-05-04 11:58:16 +02:00
Sanskar Jaiswal
7232ff9ea0 modify tmp dir generation to be absolute on all OSes
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-05-04 15:13:39 +05:30
Stefan Prodan
45876a723c Merge pull request #2701 from fluxcd/add-sa-read
Grant service account read-only access to controllers
2022-05-04 11:33:15 +03:00
Stefan Prodan
1ece35e4c5 Add leader election required permissions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-04 11:11:51 +03:00
Stefan Prodan
5dee903374 Grant service account read-only access to controllers
For image automation to use a service account to authenticate to container registries, the controllers needs read-only access to service accounts.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-04 10:47:04 +03:00
Stefan Prodan
4dd20af7e0 Merge pull request #2700 from fluxcd/fix-bootstrap-fs
MacOS: fix bootstrap manifest generation
2022-05-04 10:01:42 +03:00
Stefan Prodan
b9fbdfc9a4 Fix bootstrap manifest generation
Use the OS package to write the generated files on disk instead of Flux  secure FS package which is meant for read operations.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-04 09:41:26 +03:00
Hidde Beydals
ab00e348a4 Merge pull request #2698 from fluxcd/update-deps 2022-05-03 21:26:22 +02:00
Hidde Beydals
b5c0ae9d5a build: update various CI dependencies
- kind to v0.12.0
- kubectl to v1.23.6
- helm to v3.8.2
- runner to v2.291.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 21:07:35 +02:00
Hidde Beydals
8e4044eed9 Update dependencies
- github.com/fluxcd/pkg/runtime to v0.14.2
- github.com/google/go-cmp to v0.5.8
- golang.org/x/crypto to v0.0.0-20220427172511-eb4f295cb31f
- k8s.io/cli-runtime to v0.23.6
- k8s.io/kubectl to v0.23.6

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 21:07:35 +02:00
Hidde Beydals
7034ef46af Merge pull request #2695 from fluxcd/update-components 2022-05-03 20:45:53 +02:00
Hidde Beydals
8dfbe952ae tests/azure: update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 20:19:29 +02:00
fluxcdbot
f1e9da56dc Update toolkit components
- helm-controller to v0.21.0
  https://github.com/fluxcd/helm-controller/blob/v0.21.0/CHANGELOG.md
- kustomize-controller to v0.25.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.25.0/CHANGELOG.md
- source-controller to v0.24.4
  https://github.com/fluxcd/source-controller/blob/v0.24.4/CHANGELOG.md
- notification-controller to v0.23.5
  https://github.com/fluxcd/notification-controller/blob/v0.23.5/CHANGELOG.md
- image-reflector-controller to v0.18.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.18.0/CHANGELOG.md
- image-automation-controller to v0.22.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.22.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-05-03 18:17:11 +00:00
Hidde Beydals
f924c5f76d Merge pull request #2651 from fluxcd/customize-kustomize-fs 2022-05-03 14:25:27 +02:00
Hidde Beydals
57442e8faa kustomize: use FS from fluxcd/pkg
This switches to a secure FS implementation in most places, except for
where we can not make changes at this moment because it would break
behavior.

Not handled in this commit:

- Allowing the root for `manifestgen` packages to be configured.
- Allowing the user to define a working root while building locally.
- Defaulting to the secure FS implementation in
  `kustomization.MakeDefaultOptions`. Problem here is that constructing
  the secure FS could result in an error, which we can not surface
  without signature changes to the constructor func.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 13:52:51 +02:00
Hidde Beydals
95bfd3b3a4 Merge pull request #2686 from fluxcd/update-components 2022-04-28 11:03:09 +02:00
Hidde Beydals
2858e83fe1 tests/azure: update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-28 10:42:42 +02:00
fluxcdbot
5430152c7f Update toolkit components
- kustomize-controller to v0.24.4
  https://github.com/fluxcd/kustomize-controller/blob/v0.24.4/CHANGELOG.md
- source-controller to v0.24.3
  https://github.com/fluxcd/source-controller/blob/v0.24.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-28 08:35:38 +00:00
Stefan Prodan
3433079121 Merge pull request #2638 from pjbgf/paulo-maintainers
Add Paulo Gomes to maintainer's list
2022-04-27 15:32:19 +03:00
Paulo Gomes
151b84b8fe Add Paulo Gomes to maintainer's list
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-27 13:07:07 +01:00
Hidde Beydals
e3e01cb5da Merge pull request #2679 from fluxcd/update-components 2022-04-26 09:51:17 +02:00
Hidde Beydals
c4c890d4e9 tests/azure: update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-26 09:31:11 +02:00
fluxcdbot
64a473db2e Update toolkit components
- source-controller to v0.24.2
  https://github.com/fluxcd/source-controller/blob/v0.24.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-26 07:29:06 +00:00
Hidde Beydals
cc9bcbaefd Merge pull request #2668 from fluxcd/update-components 2022-04-22 12:26:17 +02:00
Hidde Beydals
787d491bd5 tests/azure: update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-22 12:09:27 +02:00
fluxcdbot
5c4991299c Update toolkit components
- kustomize-controller to v0.24.3
  https://github.com/fluxcd/kustomize-controller/blob/v0.24.3/CHANGELOG.md
- source-controller to v0.24.1
  https://github.com/fluxcd/source-controller/blob/v0.24.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-22 10:09:00 +00:00
Hidde Beydals
33ac3ef2c6 Merge pull request #2662 from fluxcd/update-components 2022-04-21 11:52:23 +02:00
Hidde Beydals
c7504442bd tests/azure: update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-21 11:31:07 +02:00
fluxcdbot
1a546a1d82 Update toolkit components
- kustomize-controller to v0.24.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.24.2/CHANGELOG.md
- notification-controller to v0.23.4
  https://github.com/fluxcd/notification-controller/blob/v0.23.4/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-21 09:29:20 +00:00
Hidde Beydals
713365a12c Merge pull request #2657 from fluxcd/update-kc 2022-04-20 18:08:22 +02:00
Hidde Beydals
5d8248d31d Update kustomize-controller to v0.24.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-20 17:34:12 +02:00
Hidde Beydals
5346c1cca3 Merge pull request #2652 from fluxcd/update-components 2022-04-20 12:28:48 +02:00
Hidde Beydals
baadaa05d2 tests/azure: Update toolkit components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-20 11:49:49 +02:00
fluxcdbot
224a1ce941 Update toolkit components
- helm-controller to v0.20.1
  https://github.com/fluxcd/helm-controller/blob/v0.20.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-20 09:46:28 +00:00
Hidde Beydals
52f1bfed4c Merge pull request #2646 from aryan9600/fix-mask-sops 2022-04-19 20:05:14 +02:00
Sanskar Jaiswal
5c9cbe676d handle secret types properly while masking sops data
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-04-19 23:12:00 +05:30
Hidde Beydals
e25bb74c05 Merge pull request #2649 from fluxcd/update-deps 2022-04-19 19:21:45 +02:00
Hidde Beydals
c2f465e246 Update dependencies
- github.com/ProtonMail/go-crypto to v0.0.0-20220407094043-a94812496cf5
- github.com/fluxcd/pkg/kustomize to v0.2.0
- github.com/fluxcd/pkg/runtime to v0.14.1
- github.com/fluxcd/pkg/ssa to v0.15.2
- golang.org/x/crypto to v0.0.0-20220411220226-7b82a4e95df4
- golang.org/x/term to v0.0.0-20220411215600-e5f449aeb171
- k8s.io/cli-runtime to v0.23.5
- k8s.io/kubectl to v0.23.5
- sigs.k8s.io/cli-utils to v0.29.4
- sigs.k8s.io/kustomize/api to v0.11.4
- sigs.k8s.io/kustomize/kyaml to v0.13.6

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 18:27:33 +02:00
Hidde Beydals
6bbbf16140 tests/azure: update dependencies
This does not include an update of `github.com/hashicorp/terraform-exec`
to `v0.16.1`, as it contains a breaking change. `tfinstall` has been
removed and needs to be replaced with `github.com/hashicorp/hc-install`.

- github.com/fluxcd/helm-controller/api to v0.20.0
- github.com/fluxcd/image-automation-controller/api to v0.22.0
- github.com/fluxcd/image-reflector-controller/api to v0.17.2
- github.com/fluxcd/kustomize-controller/api to v0.24.0
- github.com/fluxcd/notification-controller/api to v0.23.3
- github.com/fluxcd/pkg/apis/meta to v0.12.2
- github.com/fluxcd/pkg/runtime to v0.14.1
- github.com/fluxcd/source-controller/api to v0.24.0
- k8s.io/api to v0.23.5
- k8s.io/apimachinery to v0.23.5
- k8s.io/client-go to v0.23.5
- sigs.k8s.io/controller-runtime to v0.11.2

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 18:23:42 +02:00
Hidde Beydals
c5cdb70031 Merge pull request #2617 from fluxcd/update-components 2022-04-19 18:20:30 +02:00
fluxcdbot
2955cd70a8 Update toolkit components
- helm-controller to v0.20.0
  https://github.com/fluxcd/helm-controller/blob/v0.20.0/CHANGELOG.md
- kustomize-controller to v0.24.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.24.0/CHANGELOG.md
- source-controller to v0.24.0
  https://github.com/fluxcd/source-controller/blob/v0.24.0/CHANGELOG.md
- notification-controller to v0.23.3
  https://github.com/fluxcd/notification-controller/blob/v0.23.3/CHANGELOG.md
- image-reflector-controller to v0.17.2
  https://github.com/fluxcd/image-reflector-controller/blob/v0.17.2/CHANGELOG.md
- image-automation-controller to v0.22.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.22.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-04-19 15:45:35 +00:00
Stefan Prodan
7b4940914c Merge pull request #2597 from fluxcd/rfc-helm-oci
[RFC-0002] Flux OCI support for Helm
2022-04-13 11:01:25 +03:00
Stefan Prodan
30f977a7cb Assign RFC-0002 to Helm OCI proposal
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-13 10:27:11 +03:00
Stefan Prodan
e06fa24616 Add dedicated reconcilers to the design docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-12 15:09:51 +03:00
Stefan Prodan
20d7d0c78a Add image registry example to story 2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-12 15:08:31 +03:00
Stefan Prodan
606078c1b3 Add chart update automation to Git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-12 15:08:31 +03:00
Stefan Prodan
0135eb19d4 Add proposal for adding Helm OCI support to Flux Source API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-12 15:08:30 +03:00
Stefan Prodan
8b989190c4 Merge pull request #2631 from canidam/add-bootstrap-git-pass-from-stdin-and-env
bootstrap git: Allow the password to be specified with GIT_PASSWORD env var
2022-04-12 14:59:17 +03:00
Chen Anidam
a85ea59824 Read password of generic git bootstrap command from env or stdin
Signed-off-by: Chen Anidam <canidam@gmail.com>
2022-04-12 12:17:11 +03:00
Stefan Prodan
d012f0f2bc Merge pull request #2624 from kingdonb/docs-when-prune-enabled
Add detail to delete docs
2022-04-07 19:47:22 +03:00
Kingdon Barrett
7e2b63ea5d add detail to delete docs
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2022-04-07 08:29:57 -04:00
Stefan Prodan
cb53243fc1 Merge pull request #2611 from souleb/diff-local-kustomization
Add an option to diff with a local Flux Kustomization file
2022-04-05 19:40:11 +03:00
Soule BA
5536af9756 Add an option to diff with a local kustomization file
If implemented, users will be able to provide a local kustomization file
to `flux build/diff`.

Signed-off-by: Soule BA <soule@weave.works>
2022-04-05 17:21:11 +02:00
Stefan Prodan
28087c1d76 Merge pull request #2616 from SomtochiAma/resume-all-wait
Add cli flags for chart interval and reconcile strategy
2022-04-05 17:19:07 +03:00
Somtochi Onyekwere
b80f32ce7d Add cli flags for chart interval and reconcile strategy
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-04-05 12:56:50 +01:00
Stefan Prodan
8bad59ebde Merge pull request #2609 from darkowlzz/grafana-dashboard-labelvalues
monitoring-config: set grafana dashboards labelValues
2022-04-03 09:46:23 +03:00
Sunny
b44e4617e0 monitoring-config: grafana dashboards labelValue
Since kube-prometheus-stack helm chart v32.2.0, the `labelValue` has to
be set to "1" for the default grafana dashboard label selector to select
the flux dashboard configuration.

Also, update kube-prometheus-stack to v34.7.0, latest.

Refer: eba5b198f5

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-04-02 23:55:11 +05:30
Stefan Prodan
5d99e3d191 Merge pull request #2607 from souleb/issue-2598
[Diff] Update pkg/kustomize to v0.1.0
2022-04-01 17:45:01 +03:00
Soule BA
1807852b6b Update pkg/kustomize to v0.1.0
If implemented this fixes a bug where retrieving the groupVersion.Group
of a kustomization were returning an empty string.

Signed-off-by: Soule BA <soule@weave.works>
2022-04-01 10:27:37 +02:00
Hidde Beydals
4f4a5c0ba0 Merge pull request #2594 from fluxcd/update-components 2022-03-30 20:41:16 +02:00
fluxcdbot
24188e58ff Update toolkit components
- kustomize-controller to v0.22.3
  https://github.com/fluxcd/kustomize-controller/blob/v0.22.3/CHANGELOG.md
- source-controller to v0.22.5
  https://github.com/fluxcd/source-controller/blob/v0.22.5/CHANGELOG.md
- notification-controller to v0.23.2
  https://github.com/fluxcd/notification-controller/blob/v0.23.2/CHANGELOG.md
- image-automation-controller to v0.21.3
  https://github.com/fluxcd/image-automation-controller/blob/v0.21.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-30 17:39:09 +00:00
Stefan Prodan
e2be598988 Merge pull request #2584 from souleb/update-homeport-dyff
Diff: Update homeport/Dyff to v1.5.2
2022-03-29 10:16:39 +03:00
Soule BA
9e2a4f329b Update homeport/Dyff to v1.5.2
If implmented, this will provide an inline diff for configmaps with the
command `flux diff``.

Signed-off-by: Soule BA <soule@weave.works>
2022-03-29 08:52:53 +02:00
Stefan Prodan
574b86cbca Merge pull request #2534 from jooooel/joel/update_docs
Add coreutils (for Mac OS) as a dependency
2022-03-29 08:26:45 +03:00
jooooel
4b7042cc46 Add coreutils (for Mac OS) as a dependency
Signed-off-by: jooooel <jooooel@users.noreply.github.com>
2022-03-28 20:34:07 +02:00
Sunny
5ae4711f7b Merge pull request #2583 from fluxcd/update-components
Update toolkit components
2022-03-28 22:41:58 +05:30
fluxcdbot
97a53b1536 Update toolkit components
- source-controller to v0.22.4
  https://github.com/fluxcd/source-controller/blob/v0.22.4/CHANGELOG.md
- image-automation-controller to v0.21.2
  https://github.com/fluxcd/image-automation-controller/blob/v0.21.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-28 16:52:13 +00:00
Hidde Beydals
cc982cf3b1 Merge pull request #2577 from fluxcd/update-components 2022-03-25 19:10:52 +01:00
fluxcdbot
3f652f8b05 Update toolkit components
- helm-controller to v0.18.2
  https://github.com/fluxcd/helm-controller/blob/v0.18.2/CHANGELOG.md
- kustomize-controller to v0.22.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.22.2/CHANGELOG.md
- source-controller to v0.22.3
  https://github.com/fluxcd/source-controller/blob/v0.22.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-25 17:50:26 +00:00
Hidde Beydals
dcd86dec6e Merge pull request #2572 from fluxcd/client-rate-limit-args 2022-03-25 11:08:07 +01:00
Stefan Prodan
0d8194c800 Add the kube client qps and burst to the global args
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-25 10:43:59 +01:00
Stefan Prodan
150d9d7ae6 Merge pull request #2570 from fluxcd/update-components
Update toolkit components
2022-03-24 09:45:29 +02:00
Stefan Prodan
694f1797d2 Update packages for Azure e2e testing
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-24 09:23:35 +02:00
fluxcdbot
116be0cfed Update toolkit components
- kustomize-controller to v0.22.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.22.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-24 07:01:20 +00:00
Hidde Beydals
aa2b5ae18d Merge pull request #2569 from fluxcd/update-components 2022-03-23 21:47:35 +01:00
Hidde Beydals
e2ccbe2088 tests/azure: update toolkit components
- helm-controller to v0.18.1
  https://github.com/fluxcd/helm-controller/blob/v0.18.1/CHANGELOG.md
- source-controller to v0.22.2
  https://github.com/fluxcd/source-controller/blob/v0.22.2/CHANGELOG.md
- notification-controller to v0.23.1
  https://github.com/fluxcd/notification-controller/blob/v0.23.1/CHANGELOG.md
- image-reflector-controller to v0.17.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.17.1/CHANGELOG.md
- image-automation-controller to v0.21.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.21.1/CHANGELOG.md

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 21:33:34 +01:00
Hidde Beydals
775891fc88 build: ensure component update runs with make tidy
This to include the `-compat` flag.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 21:32:00 +01:00
fluxcdbot
c85954ddef Update toolkit components
- helm-controller to v0.18.1
  https://github.com/fluxcd/helm-controller/blob/v0.18.1/CHANGELOG.md
- source-controller to v0.22.2
  https://github.com/fluxcd/source-controller/blob/v0.22.2/CHANGELOG.md
- notification-controller to v0.23.1
  https://github.com/fluxcd/notification-controller/blob/v0.23.1/CHANGELOG.md
- image-reflector-controller to v0.17.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.17.1/CHANGELOG.md
- image-automation-controller to v0.21.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.21.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-23 21:30:38 +01:00
Hidde Beydals
dd6db2cbd9 Merge pull request #2566 from fluxcd/fix-resume-bucket 2022-03-23 14:50:41 +01:00
Stefan Prodan
5f74c7d294 Fix resume source bucket panic
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-23 15:33:57 +02:00
Hidde Beydals
ed87a632b0 Merge pull request #2565 from fluxcd/source-create-wait 2022-03-23 12:55:08 +01:00
Hidde Beydals
3edcd16b62 fix: wait for Source objects observed generation
This ensures the command will wait for the object to report a Ready
Condition with an ObservedGeneration matching the Generation of the
resource. Ensuring that when a "create" is actually a mutation, it waits
instead of prematurely assuming the Source to be Ready.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 12:38:42 +01:00
Hidde Beydals
b01d3aeecd Merge pull request #2561 from fluxcd/update-deps 2022-03-23 11:55:57 +01:00
Hidde Beydals
0717c8bdbb Update fluxcd/source-controller to v0.22.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 11:33:35 +01:00
Hidde Beydals
f1e4561bdd tests/azure: update dependencies
- github.com/Azure/azure-event-hubs-go/v3 to v3.3.17
- github.com/fluxcd/helm-controller/api to v0.18.0
- github.com/fluxcd/image-automation-controller/api to v0.21.0
- github.com/fluxcd/image-reflector-controller/api to v0.17.0
- github.com/fluxcd/kustomize-controller/api to v0.22.0
- github.com/fluxcd/notification-controller/api to v0.23.0
- github.com/fluxcd/pkg/runtime to v0.13.2
- github.com/hashicorp/terraform-exec to v0.15.0
- github.com/libgit2/git2go/v31 to v31.7.9
- github.com/stretchr/testify to v1.7.1
- go.uber.org/multierr to v1.8.0
- k8s.io/api to v0.23.4
- k8s.io/client-go to v0.23.4

For `github.com/hashicorp/terraform-exec`, a newer version (v0.16.0)
is availabe. This version however contains a breaking change (as it
removes the `tfinstall` module), which I did not want to deal with at
the moment.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 11:33:35 +01:00
Hidde Beydals
efe9a30523 Update dependencies
- github.com/Masterminds/semver/v3 to v3.1.1
- github.com/ProtonMail/go-crypto to v0.0.0-20220113124808-70ae35bab23f
- github.com/cyphar/filepath-securejoin to v0.2.3
- github.com/fluxcd/pkg/kustomize to v0.0.3
- github.com/fluxcd/pkg/runtime to v0.13.2
- github.com/fluxcd/pkg/ssa to v0.15.1
- github.com/fluxcd/pkg/ssh to v0.3.2
- github.com/fluxcd/pkg/untar to v0.1.0
- github.com/fluxcd/pkg/version to v0.1.0
- github.com/gonvenience/bunt to v1.3.3
- github.com/gonvenience/ytbx to v1.4.4
- github.com/google/go-containerregistry to v0.8.0
- github.com/homeport/dyff to v1.5.1
- github.com/olekukonko/tablewriter to v0.0.5
- github.com/spf13/cobra to v1.4.0
- golang.org/x/crypto to v0.0.0-20220321153916-2c7772ba3064
- k8s.io/kubectl to v0.23.4
- k8s.io/cli-runtime to v0.23.4
- sigs.k8s.io/cli-utils to v0.29.3

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 11:33:35 +01:00
Paulo Gomes
e5ede275f8 Update Source API to v1beta2
The creation of oldConditions, statusableConditions and
reconcilableConditions is an adhoc solution to deal with the upstream
changes on `pkg/apis/meta`, which are yet to be replicated across other
Flux API components.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-03-23 11:33:35 +01:00
fluxcdbot
a929d24924 Update toolkit components
- helm-controller to v0.18.0
  https://github.com/fluxcd/helm-controller/blob/v0.18.0/CHANGELOG.md
- kustomize-controller to v0.22.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.22.0/CHANGELOG.md
- source-controller to v0.22.0
  https://github.com/fluxcd/source-controller/blob/v0.22.0/CHANGELOG.md
- notification-controller to v0.23.0
  https://github.com/fluxcd/notification-controller/blob/v0.23.0/CHANGELOG.md
- image-reflector-controller to v0.17.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.17.0/CHANGELOG.md
- image-automation-controller to v0.21.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.21.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-23 11:33:35 +01:00
Stefan Prodan
368f2d3542 Merge pull request #2564 from fluxcd/dot-domain-nc
Use absolute domain name for the events address
2022-03-23 12:17:35 +02:00
Stefan Prodan
139bbbb87c Use absolute domain name for the events address
Add ending dot to the events address to be consistent with source controller address.
This will affect bootstrap and install by setting `--events-addr=http://notification-controller.flux-system.svc.cluster.local./`.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-23 11:57:46 +02:00
Stefan Prodan
51f5d85861 Merge pull request #2559 from fluxcd/fix-non-fast-forward
Retry bootstrap operations on Git conflict errors
2022-03-22 17:12:31 +02:00
Stefan Prodan
7756faec1f Retry bootstrap operations on Git conflict errors
When running bootstrap in-parallel for many clusters that target the same repository, the 2nd commit with the sync files fails with ` non-fast-forward update`. We now detect the conflict, and we retry the operations by creating a fresh clone from upstream.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-22 16:09:31 +02:00
Sunny
d9e3e3aa95 Merge pull request #2542 from fluxcd/update-components
Update toolkit components
2022-03-16 03:16:19 +05:30
fluxcdbot
ff65491bb6 Update toolkit components
- helm-controller to v0.17.2
  https://github.com/fluxcd/helm-controller/blob/v0.17.2/CHANGELOG.md
- notification-controller to v0.22.3
  https://github.com/fluxcd/notification-controller/blob/v0.22.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-15 20:41:25 +00:00
Stefan Prodan
8f514d8991 Merge pull request #2530 from fluxcd/components-extra-example
Add components-extra example usage to CLI help
2022-03-11 11:34:22 +02:00
Stefan Prodan
2e1000c31a Add components-extra example usage to CLI help
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-11 09:19:56 +02:00
Stefan Prodan
c5171a1f2e Merge pull request #2512 from souleb/introduce-printer-interface
Introduce a printer interface for flux resources
2022-03-07 13:55:33 +02:00
Soule BA
7359e63960 Introduce a printer interface for flux resource
If implemented, there will a common interface to print flux resource.

We are adding new way to print resource information e.g. diff of
objects.

Signed-off-by: Soule BA <soule@weave.works>
2022-03-07 12:15:35 +01:00
Stefan Prodan
307309504b Merge pull request #2484 from cuishuang/main
all: fix some typos
2022-03-02 14:23:04 +02:00
cuishuang
1fda202cf9 all: fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-02 19:36:08 +08:00
Sunny
7e634c154f Merge pull request #2483 from fluxcd/update-components
Update toolkit components
2022-03-01 21:18:05 +05:30
fluxcdbot
3c72e35381 Update toolkit components
- image-automation-controller to v0.20.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.20.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-03-01 15:07:34 +00:00
Stefan Prodan
7e23430882 Merge pull request #2467 from fluxcd/update-get-column-order
Update `get` subcommand column order
2022-02-28 15:34:38 +02:00
Sunny
2c4c3fd749 test: ignore golden template files with -update
Add a template values check in the `assertGoldenTemplateFile()` function
to only update golden files if they aren't templates. A note is printed
when an update to a template golden file is needed and `-update` flag
can't update it.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-28 08:56:08 +05:30
Sunny
edaf6ca522 Add test flag -update to update the golden files
Test flag `-update` can be used to update all the golden files whenever
the CLI output changes.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 08:58:19 +05:30
Sunny
21f0d5d82c Move MESSAGE to the end of get subcommand output
Message content could be long compared to other fields. Moving it to
the end helps improve the visibility of the other fields.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 04:21:47 +05:30
Stefan Prodan
059751b3c9 Merge pull request #2462 from fluxcd/update-components
Update notification-controller to v0.22.2
2022-02-23 15:53:19 +02:00
fluxcdbot
05479756d8 Update toolkit components
- notification-controller to v0.22.2
  https://github.com/fluxcd/notification-controller/blob/v0.22.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-23 13:37:43 +00:00
Stefan Prodan
34e19cb638 Merge pull request #2440 from fluxcd/diagrams
Add e2e sequence diagrams
2022-02-23 13:52:55 +02:00
Stefan Prodan
5312f81c8e Add e2e sequence diagrams
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-23 13:28:25 +02:00
Stefan Prodan
7f02898539 Merge pull request #2460 from fluxcd/update-components
Update toolkit components
2022-02-23 13:27:31 +02:00
fluxcdbot
8aabc544f1 Update toolkit components
- helm-controller to v0.17.1
  https://github.com/fluxcd/helm-controller/blob/v0.17.1/CHANGELOG.md
- kustomize-controller to v0.21.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.21.1/CHANGELOG.md
- notification-controller to v0.22.1
  https://github.com/fluxcd/notification-controller/blob/v0.22.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-23 09:00:51 +00:00
Stefan Prodan
3b62955e81 Merge pull request #2450 from SomtochiAma/resume-all-wait
Add `--wait` flag to flux `resume` cmd
2022-02-21 12:26:53 +02:00
Somtochi Onyekwere
9c76ba903b add wait flag to flux resume cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-21 11:07:55 +01:00
Stefan Prodan
b4118b73ed Merge pull request #2448 from SomtochiAma/metadata-client
Use `metadata.Client` for reconcile operations
2022-02-21 12:02:53 +02:00
Somtochi Onyekwere
82a8697f28 Add gvk to rest of api type
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-21 10:40:35 +01:00
Stefan Prodan
5b9a1ce5c6 Merge pull request #2452 from souleb/fix-stringData-diff
Diff: fix stringData Secret issue
2022-02-21 11:20:24 +02:00
Soule BA
32ad462ebe Fix stringData Secret issue
This commit migrate to the last version of pkg/ssa v0.14.1 that contains a fix
for stringData secrets. The test case was changed accordingly to
    validate a stringData drift.

A progress-bar flag option has also been added in order to be able to
disable it.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-18 17:18:16 +01:00
Stefan Prodan
1ff8c2806c Merge pull request #2441 from andrewjjenkins/fix-trace-test-tz
Fix failure in TestTrace/* when timezone isn't UTC
2022-02-17 13:51:46 +02:00
Andrew Jenkins
437a7a2852 Fix failure in TestTrace/* when timezone isn't UTC
The TestTrace/Deployment and TestTrace/HelmRelease test cases fail in
environments where the timezone isn't UTC, because they compare a local time
string to the golden file, which has time in UTC.  Here is an example:

```
--- FAIL: TestTrace (0.12s)
    --- FAIL: TestTrace/Deployment (0.08s)
        main_test.go:337: Mismatch from golden file 'testdata/trace/deployment.golden': Mismatch from expected value (-want +got):
              strings.Join({
                ... // 88 identical bytes
                " Flux\n---\nHelmRelease:    podinfo\nNamespace:      podinfo-8\nRevi",
                "sion:       6.0.0\nStatus:         Last reconciled at 2021-07-16 ",
            -   "15:42:20 +0000 UTC",
            +   "09:42:20 -0600 MDT",
                "\nMessage:        Release reconciliation succeeded\n---\nHelmChart:",
                "      podinfo-podinfo\nNamespace:      flux-system-9\nChart:      ",
                "    podinfo\nVersion:        6.0.0\nRevision:       6.0.0\nStatus: ",
                "        Last reconciled at 2021-07-16 ",
            -   "15:32:09 +0000 UTC",
            +   "09:32:09 -0600 MDT",
                "\nMessage:        Fetched revision: 6.0.0\n---\nHelmRepository: pod",
                "info\nNamespace:      flux-system-9\nURL:            https://stefa",
                "nprodan.github.io/podinfo\nRevision:       8411f23d07d3701f0e96e7",
                "d9e503b7936d7e1d56\nStatus:         Last reconciled at 2021-07-",
            -   "1",
                "1",
            -   " 00:25:46 +0000 UTC",
            +   "0 18:25:46 -0600 MDT",
                "\nMessage:        Fetched revision: 8411f23d07d3701f0e96e7d9e503b",
                "7936d7e1d56\n",
              }, "")
```

This commit fixes the issue by converting the golden test times to local
time before comparing. The utility function toLocalTime() is added to
trace_test.go, and then it is used to provide localized times as
template parameters to the golden files.

Signed-off-by: Andrew Jenkins <andrew@aspenmesh.io>
2022-02-16 09:36:00 -07:00
Stefan Prodan
412db70773 Merge pull request #2444 from fluxcd/update-components
Update toolkit components
2022-02-16 15:20:38 +02:00
fluxcdbot
a1bb6babed Update toolkit components
- helm-controller to v0.17.0
  https://github.com/fluxcd/helm-controller/blob/v0.17.0/CHANGELOG.md
- kustomize-controller to v0.21.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.21.0/CHANGELOG.md
- notification-controller to v0.22.0
  https://github.com/fluxcd/notification-controller/blob/v0.22.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-16 12:57:45 +00:00
Stefan Prodan
568c536c3c Merge pull request #2443 from SomtochiAma/log-bug
Validate that object name adheres to RFC 1123 for `flux create` commands
2022-02-16 14:57:00 +02:00
Somtochi Onyekwere
d7129d6b55 Remove validation from sub-commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-16 11:04:05 +01:00
Somtochi Onyekwere
4a893b13f8 validate that object name adheres to RFC 1123 for flux create commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-16 10:51:03 +01:00
Stefan Prodan
8c2983c958 Merge pull request #2439 from SomtochiAma/log-bug
Use text/template library instead of html/template for logs
2022-02-15 09:30:58 +02:00
Somtochi Onyekwere
a30ffdb176 Use text/template
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-14 23:59:20 +01:00
Stefan Prodan
7a306e69ab Merge pull request #2426 from foot/support-dot-prefixed-paths
Add support for Kustomizations with dot-prefixed paths
2022-02-14 12:32:25 +02:00
Simon Howe
23c4c2f1aa Adds test for parent directory
Signed-off-by: Simon Howe <footless@gmail.com>
2022-02-14 10:51:20 +01:00
Simon Howe
aac07f03d8 Adds test for using dot to represent pwd
Signed-off-by: Simon Howe <footless@gmail.com>
2022-02-14 10:48:58 +01:00
Simon Howe
f4418920fb Adds support for dot-prefixed paths in git
- in `flux bootstrap` and `flux create kustomization` etc.
- E.g. for example `--path=.flux` should work now
- Previous behaviour is to strip off any leading "." and leave you with
  "./flux" in the kustomizations / folder structure generated by `flux
  bootstrap`

Signed-off-by: Simon Howe <footless@gmail.com>
2022-02-14 09:10:18 +01:00
Stefan Prodan
7752206152 Merge pull request #2427 from souleb/issue-2411
Bootstrap bitbucket-server: Make sure we retrieve the right project
2022-02-12 15:40:29 +02:00
Soule BA
c950f8f817 Make sure bootstrap bitbucket-server retrieve the right project
When fetching a project by name, a list is returned. If implented, this
will make sure we return the right project from the list.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-12 13:31:11 +01:00
Stefan Prodan
9276345fe7 Merge pull request #2425 from souleb/adding-a-simple-spinner
Add a simple spinner when running flux diff kustomization
2022-02-12 14:25:51 +02:00
Soule BA
01f910e257 Add a simple spinner when running flux diff kustomization
If implemented, users will see a spinner run while the diff is on-going.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-11 18:11:28 +01:00
Stefan Prodan
de5f00016b Merge pull request #2418 from fluxcd/fix-bootstrap
Fix bootstrap: Reset schema cache after applying CRDs
2022-02-10 18:44:53 +02:00
Stefan Prodan
877729aca3 Fix bootstrap: Reset schema cache after applying CRDs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-10 18:09:06 +02:00
Stefan Prodan
f65d87b191 Merge pull request #2416 from fluxcd/update-components
Update kustomize-controller to v0.20.2
2022-02-10 16:55:01 +02:00
fluxcdbot
3b1d706b05 Update toolkit components
- kustomize-controller to v0.20.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.20.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-10 10:45:36 +00:00
Stefan Prodan
b0552fa0de Merge pull request #2415 from fluxcd/iac-namespace-arg
Add GitRepository namespace arg to `flux create image update`
2022-02-10 12:44:58 +02:00
Stefan Prodan
cbca583f4b Add GitRepository namespace arg to flux create image update
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-10 10:52:51 +02:00
Stefan Prodan
a0520de7aa Merge pull request #2397 from fluxcd/ssa-v0.13.0
Fix bootstrap CRD wait race condition
2022-02-07 14:59:05 +02:00
Stefan Prodan
4602b72778 Fix bootstrap CRD wait race condition
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-07 14:28:56 +02:00
Stefan Prodan
e69a6ed91a Merge pull request #2398 from fluxcd/update-components
Update toolkit components
2022-02-07 14:28:20 +02:00
Stefan Prodan
9d6a037935 Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-07 14:09:23 +02:00
fluxcdbot
41df03f600 Update toolkit components
- kustomize-controller to v0.20.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.20.1/CHANGELOG.md
- source-controller to v0.21.2
  https://github.com/fluxcd/source-controller/blob/v0.21.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-07 11:45:14 +00:00
Stefan Prodan
ca92464ef6 Merge pull request #2392 from souleb/issue-2387
Mask dockerconfigjson secret types and support StringData secrets
2022-02-07 11:18:11 +02:00
Soule BA
2e9fd33ce5 Mask dockerconfigjson secret types and support StringData secrets
If implemented, flux diff kustomization will managed correctly sops
managed dockerconfigjson secrets.
Sops encrypted secret with stringData maps are supported too.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-07 09:45:38 +01:00
Stefan Prodan
cf3f729f98 Merge pull request #2389 from souleb/fix-deleted-mess-diff
Fix wrong deletion message on flux diff
2022-02-07 10:09:51 +02:00
Soule BA
8b444283e6 Fix wrong deletion message on flux diff
If implemented, when an error happens when dry-running an object, we
return early. This match pkg ssa implementation

Signed-off-by: Soule BA <soule@weave.works>
2022-02-07 00:06:33 +01:00
Stefan Prodan
4b4e6b1be3 Merge pull request #2382 from SomtochiAma/commit-sha
Use `client.Patch` for suspend/resume operations
2022-02-04 13:39:52 +02:00
Somtochi Onyekwere
d3d271defe use client.Patch for suspend/resume operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-04 12:06:39 +01:00
Stefan Prodan
9bddabf4ff Merge pull request #2380 from souleb/fix-panic-orgref-var
Fix panic on bootstrap when orgRef is not retrieved
2022-02-04 10:29:26 +02:00
Soule BA
959ea6875a Fix panic on bootstrap when orgRef is not retrieved
If implemented, not retrieving an orgRef will always return an error

Signed-off-by: Soule BA <soule@weave.works>
2022-02-04 09:08:38 +01:00
Stefan Prodan
7b7eb011b0 Merge pull request #2377 from souleb/issue-2363
Fix `flux build/diff` when parsing SOPS encrypted secrets
2022-02-04 10:06:14 +02:00
Soule BA
997e6be3a2 Make sure to trim all sops data
If implemented this fixes #2363 and make sure we can build with sops
encrypted data

Signed-off-by: Soule BA <soule@weave.works>
2022-02-04 08:38:29 +01:00
Stefan Prodan
51af4bbf52 Merge pull request #2364 from robwittman/rwittman/add-github-gpg-signing
Add GPG signing to Github/Gitlab/Bitbucket bootstrap
2022-02-04 09:26:50 +02:00
Robert Wittman
e33198e750 Replace github boostrap GPG options
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:09:10 -05:00
Robert Wittman
e3f5a8fee3 Add GPG options to Gitlab and BitBucket bootstraps
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:07:55 -05:00
Robert Wittman
f8b58f8be9 Add GPG signing to Github bootstrap
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:03:35 -05:00
Stefan Prodan
55542a8086 Merge pull request #2376 from fluxcd/fix-azure-test
e2e: Fix Azure image update automation test
2022-02-03 17:04:01 +02:00
Stefan Prodan
70c8c0445c e2e: Fix Azure image update automation test
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-03 16:38:25 +02:00
Stefan Prodan
29c0bb4ce2 Merge pull request #2375 from souleb/issue-2365
Add contextual error code for flux diff kustomization
2022-02-03 16:35:45 +02:00
Soule BA
b86b195450 Add contextual error code for flux diff kustomization
If implemented, calling the diff command on kustomization will return 0,
1(if changes are identified), >1 for errors.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-03 13:41:57 +01:00
Hidde Beydals
edf15894f8 Merge pull request #2368 from fluxcd/update-e2e-pkgs 2022-02-02 11:41:07 +01:00
Stefan Prodan
74878a9aef Update dependencies
Use Azure e2e dependencies and bump fluxcd/pkg/ssa to v0.12.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-02 11:50:39 +02:00
Stefan Prodan
82824b4fc6 Merge pull request #2345 from fluxcd/update-components
Update toolkit components
2022-02-01 12:39:35 +02:00
Stefan Prodan
141d71c39d Use CrossNamespaceSourceReference for image automations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-01 12:12:59 +02:00
fluxcdbot
e9d6f271b5 Update toolkit components
- helm-controller to v0.16.0
  https://github.com/fluxcd/helm-controller/blob/v0.16.0/CHANGELOG.md
- kustomize-controller to v0.20.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.20.0/CHANGELOG.md
- source-controller to v0.21.1
  https://github.com/fluxcd/source-controller/blob/v0.21.1/CHANGELOG.md
- notification-controller to v0.21.0
  https://github.com/fluxcd/notification-controller/blob/v0.21.0/CHANGELOG.md
- image-reflector-controller to v0.16.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.16.0/CHANGELOG.md
- image-automation-controller to v0.20.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.20.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-02-01 09:48:15 +00:00
Stefan Prodan
8d4dee2aee Merge pull request #2356 from fluxcd/fix-diff-test-kubernetes-1.23.3
Adapt diff test to match Kubernetes 1.23.3 API response
2022-01-31 11:36:07 +02:00
Stefan Prodan
246af92386 Adapt diff test to match Kubernetes 1.23.3 API response
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-28 20:37:16 +02:00
Stefan Prodan
7c9957a18f Merge pull request #2348 from pjbgf/add-pkg-config
Add pkg-config to arm runners
2022-01-27 15:48:48 +02:00
Paulo Gomes
9e7018383a Add pkg-config to arm runners
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-27 13:28:46 +00:00
Stefan Prodan
920d6e5404 Merge pull request #2347 from stealthybox/fix-2346-usage-output
Fix output usage for `flux get <sources|images>`
2022-01-27 09:58:56 +02:00
leigh capili
57962347f2 Output Usage for flux get <sources|images>
Signed-off-by: leigh capili <leigh@null.net>
2022-01-26 16:03:22 -07:00
Stefan Prodan
6f053c45df Merge pull request #2343 from fluxcd/check-kubernetes-1.20.6
Set minimum supported version to Kubernetes 1.20.6
2022-01-26 12:22:13 +02:00
Stefan Prodan
f154326391 Set minimum supported version to Kubernetes 1.20.6
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 11:21:32 +02:00
Stefan Prodan
776a7fc9c0 Merge pull request #2342 from fluxcd/flux-cli-non-root
Run the CLI as non-root
2022-01-26 10:39:10 +02:00
Stefan Prodan
08412b72bc Run the CLI as non-root
Run the Flux CLI inside the container under the nobody user and group.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 09:51:50 +02:00
Stefan Prodan
030e166f43 Merge pull request #2336 from souleb/upgrade-go-git-provider
Upgrade go-git-providers to v0.5.3
2022-01-25 12:14:50 +02:00
Soule BA
d92dfc56b8 Upgrade go-git-providers to v0.5.3
Fixes bug reported on #2332

Signed-off-by: Soule BA <soule@weave.works>
2022-01-25 10:28:14 +01:00
Stefan Prodan
365d2d102d Merge pull request #2316 from pjbgf/warn-pod-security
[security] Enable pod security warnings for flux-system
2022-01-21 13:53:11 +02:00
Paulo Gomes
f7853c4ddf Enable pod security warnings for flux-system
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-21 11:23:56 +00:00
Hidde Beydals
0a6d5d9267 Merge pull request #2317 from souleb/update-diff-license-header 2022-01-20 17:42:51 +01:00
Soule BA
10b761e4e7 Add license Header to internal/build files
This adds an up to date license header to the files.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 16:58:12 +01:00
Stefan Prodan
c6f2b410bc Merge pull request #2167 from souleb/flux-build-kustomization
Preview local changes with flux build/diff kustomization
2022-01-20 14:50:02 +02:00
Soule BA
306f8f5715 Add graceful shutdown when interrupted
If implemented this permit restoring a clean state in case of signal
interruption.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 13:21:07 +01:00
Soule BA
f7d9ee90cd Add e2e tests for build/diff kustomization
Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:57 +01:00
Soule BA
9376c9a946 Add a diff kustomization feature
If implemented it will permit queriying the Kubernetes API to fetch the specified
Flux Kustomization, then uses the specified path to build the overlay.
It will then ssa-dry-run apply and output the diff using homeport/dyff

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:56 +01:00
Soule BA
70fb87bc93 Add a build kustomization feature
If implemented it will permit queriying the Kubernetes API to fetch the specified
Flux Kustomization, then uses the specified path to build
the overlay.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:56 +01:00
Stefan Prodan
63e54f3575 Merge pull request #2297 from SomtochiAma/commit-sha
Shorten Git SHA commit in `flux get` commands output
2022-01-20 12:36:18 +02:00
Somtochi Onyekwere
1e2a497108 Shorten sha commit
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-01-20 11:13:25 +01:00
Stefan Prodan
5d95a6e750 Merge pull request #2305 from fluxcd/kubectl-1.23.1
Update kubectl to 1.23.1 in flux-cli container image
2022-01-18 19:01:09 +02:00
Stefan Prodan
af00610a61 Update kubectl to 1.23.1 in flux-cli container image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-18 18:34:16 +02:00
Stefan Prodan
809cb79828 Merge pull request #2304 from fluxcd/fix-release-notes-gen
ci: Fix release notes generator
2022-01-18 18:33:23 +02:00
Stefan Prodan
e44a58cba0 ci: Fix release notes generator
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-18 18:13:59 +02:00
Stefan Prodan
10046187a6 Merge pull request #2301 from fluxcd/cosign
Sign the release artifacts checksums and images
2022-01-18 14:56:47 +02:00
Stefan Prodan
a402461f9c Sign the release artifacts checksums and images
- add the Flux manifests and API schemas to checksums
- sign the checksum.txt with Cosign and GitHub OIDC
- sign the flux-cli container images with Cosign and GitHub OIDC

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-18 14:31:37 +02:00
Stefan Prodan
8a6771c9a9 Merge pull request #2300 from fluxcd/ci-fixes
Fix Azure e2e tests and GoReleaser buildx directive
2022-01-17 11:03:05 +02:00
Stefan Prodan
7173bd5945 Fix GoReleaser buildx directive
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-17 10:37:31 +02:00
Stefan Prodan
8e09ade41c Fix Azure e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-17 10:36:03 +02:00
Stefan Prodan
6ceb8d8338 Merge pull request #2295 from fluxcd/sbom-spdx
Publish Flux Software Bill of Materials (SBOM)
2022-01-17 10:33:02 +02:00
Stefan Prodan
11296cd94f Publish Flux Software Bill of Materials (SBOM) in SPDX format
- generate SBOM for Flux Go modules with Syft
- publish the SBOM SPDX JSON files to GitHub releases with GoReleaser

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-14 16:36:49 +02:00
Aurel Canciu
677dca0bc4 Merge pull request #2296 from fluxcd/fix-pkgbuild-envtest
Fix Archlinux PKGBUILD check() run on ARM
2022-01-14 13:55:26 +01:00
Aurel Canciu
8e7b957164 Fix Archlinux PKGBUILD check() run on ARM
The check() run started to fail after #2288 since ENVTEST_ARCH was not
set correctly on ARM/ARM64. This should fix the problem for the flux-go
and flux-scm AUR packages.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-14 13:20:19 +01:00
Stefan Prodan
8f93e2a9d4 Merge pull request #2294 from fluxcd/ci-del-repo
Improve the bootstrap e2e test workflow
2022-01-14 11:48:22 +02:00
Stefan Prodan
62755b4b75 Wait 60s for image automation before failing the test
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-14 10:30:36 +02:00
Stefan Prodan
dcfb745b1f Improve the bootstrap e2e cleanup
Delete the repository regardless of the bootstrap test exit code.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-13 20:44:02 +02:00
Stefan Prodan
f38b83231c Merge pull request #2291 from fluxcd/update-components
Update kustomize-controller to v0.19.1
2022-01-13 20:33:47 +02:00
fluxcdbot
269f5e2575 Update toolkit components
- kustomize-controller to v0.19.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.19.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-01-13 18:17:27 +00:00
Stefan Prodan
893596383a Merge pull request #2290 from fluxcd/ssa-v0.10.0
Update dependencies
2022-01-13 19:56:47 +02:00
Stefan Prodan
8c67708829 Update dependencies
- sigs.k8s.io/cli-utils v0.27.0
- github.com/fluxcd/pkg/ssa v0.10.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-13 19:37:14 +02:00
Stefan Prodan
c1528503b6 Merge pull request #2141 from schrej/feature/trace-simpler-arguments
Simplify arguments of flux trace command
2022-01-13 19:36:56 +02:00
Jakob Schrettenbrunner
d3c56eb3d3 trace: fix lint warning
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
2022-01-13 15:52:47 +01:00
Jakob Schrettenbrunner
b10eee87ee Simplify arguments of flux trace command
It now accepts arguments in the forms <resource>/<name>
and <resource> <name> instead of requiring api version and
kind as flags.

Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
2022-01-13 15:52:47 +01:00
Hidde Beydals
83de469967 Merge pull request #2267 from tomalexander/add_git_build_dep 2022-01-13 15:22:23 +01:00
Tom Alexander
192978125f build/aur: fix the make target for the manifests
Signed-off-by: Tom Alexander <tom@fizz.buzz>
2022-01-13 14:58:46 +01:00
Tom Alexander
b4b3551e39 build/aur: add Git as flux-scm build dependency
Without git installed, makepkg fails to fetch the source. This breaks
the build for people who build their aur packages inside temporary
containers (for example aurutils with the -c flag).

Signed-off-by: Tom Alexander <tom@fizz.buzz>
2022-01-13 14:58:33 +01:00
Stefan Prodan
7f580e89d0 Merge pull request #2288 from aryan9600/aryan9600/setup-testenv
Fix makefile envtest setup and usage
2022-01-13 13:10:17 +02:00
Sanskar Jaiswal
81a087095a fix makefile envtest setup and usage
Refactor logic to install helper tools into one function in the
Makefile. Add support for envtest to help install tools like kubectl,
etcd which helps users run tests more conveniently.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-01-13 16:09:11 +05:30
Hidde Beydals
bcabde3bdb Merge pull request #2231 from achetronic/fix-bootstrap-https-port-overwrite 2022-01-13 11:02:22 +01:00
Alby Hernández
c190d80d4a Avoid overwriting the host port on http requests
Remove the overwrite of the repositoryURL.Host variable to include Git
servers deployed on non-standard https ports

Co-authored-by: Sebastián Vargas <develolux@gmail.com>

Signed-off-by: Alby Hernández <me@achetronic.com>
Signed-off-by: Alby Hernández <alby.hernandez@system73.com>
2022-01-13 10:32:10 +01:00
Stefan Prodan
11081e8cb2 Merge pull request #2285 from souleb/issue-2284
Update go-git-provider to fix GitLab bootstrap regression bug
2022-01-12 18:19:23 +02:00
Soule BA
c5890f08ef reverting go-git-provider to fix #2284
Signed-off-by: Soule BA <soule@weave.works>
2022-01-12 16:51:35 +01:00
Stefan Prodan
926d8a1c37 Merge pull request #2234 from souleb/issue-2207
Use provided SSH hostname to sync with SSH
2022-01-12 13:18:52 +02:00
Soule BA
da6dfd5a1b Use provided ssh hostname to sync with ssh
Signed-off-by: Soule BA <soule@weave.works>
2022-01-12 11:52:17 +01:00
Stefan Prodan
4318152141 Merge pull request #2281 from Skarlso/add_bindir_to_action
Add optional bindir input to Flux GitHub Action
2022-01-12 12:03:04 +02:00
Gergely Brautigam
759145704f Update the action to include an optional bindir
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
2022-01-12 10:38:19 +01:00
Stefan Prodan
5cab8f4b11 Merge pull request #2280 from fluxcd/go-git-providers-v0.5.1
Update Git providers
2022-01-12 11:11:36 +02:00
Stefan Prodan
a0ce4b23d2 Update Git providers
- go-git-providers v0.5.1
- go-github v41.0.0
- go-gitlab v0.54.3

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-12 10:34:58 +02:00
Hidde Beydals
6d88a0c3ac Merge pull request #2278 from fluxcd/update-components 2022-01-11 18:22:19 +01:00
fluxcdbot
db44bcd88e Update toolkit components
- notification-controller to v0.20.1
  https://github.com/fluxcd/notification-controller/blob/v0.20.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-01-11 14:36:35 +00:00
Hidde Beydals
585ae5090d Merge pull request #2272 from fluxcd/x-crypto-patch 2022-01-10 19:32:32 +01:00
Hidde Beydals
fe46793c40 Update golang.org/x/crypto to latest main
This includes the full commit tree to solve both CVE-2020-29652 and
CVE-2021-43565:
8b5274cf68...5770296d90

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-01-10 19:02:47 +01:00
Stefan Prodan
be146b1cc9 Merge pull request #2271 from fluxcd/update-components-pkg
Update toolkit components and packages
2022-01-10 19:16:21 +02:00
Aurel Canciu
e46c7bd519 Update golang.org/x/crypto to fix CVE-2020-29652
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-10 17:47:23 +01:00
Aurel Canciu
f3d143e5ee Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-10 16:30:38 +01:00
Stefan Prodan
fc059df8ff Update controller-runtime dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-10 16:54:53 +02:00
fluxcdbot
6c047d1e2a Update toolkit components
- helm-controller to v0.15.0
  https://github.com/fluxcd/helm-controller/blob/v0.15.0/CHANGELOG.md
- kustomize-controller to v0.19.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.19.0/CHANGELOG.md
- source-controller to v0.20.1
  https://github.com/fluxcd/source-controller/blob/v0.20.1/CHANGELOG.md
- image-reflector-controller to v0.15.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.15.0/CHANGELOG.md
- image-automation-controller to v0.19.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.19.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2022-01-10 14:35:39 +00:00
Stefan Prodan
f6afe7f0ec Merge pull request #2144 from schrej/feature/cli-runtime
Use k8s.io/cli-runtime for kubernetes flags
2022-01-10 11:39:15 +02:00
Jakob Schrettenbrunner
ca7d2e783f Use k8s.io/cli-runtime for kubernetes flags
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
2022-01-07 16:01:24 +01:00
Max Jonas Werner
0b133ca9f2 Merge pull request #2212 from fluxcd/rfc-0001-extra
[RFC-0001] Memorandum on the authorization model
2021-12-21 13:01:56 +01:00
Michael Bridgen
ede6785e6b RFC on authorisation model
This gives a baseline for future changes, e.g., expanding where
namespace ACLs are used, switching access control to
untrusted-by-default.

The "Security considerations" section  was adapted from

    https://github.com/fluxcd/flux2/pull/2086

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-12-17 19:17:25 +00:00
Stefan Prodan
6d9f39d8ea Merge pull request #2223 from fluxcd/arm64-helm
Add the Helm CLI to the GitHub ARM64 runners setup
2021-12-17 13:16:02 +02:00
Stefan Prodan
fb637ea955 Add the Helm CLI to the GitHub ARM64 runners setup
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-12-17 12:33:27 +02:00
Aurel Canciu
e07558f5b7 Merge pull request #2213 from fluxcd/fix-bundle.sh
Fix ./manifests/scripts/bundle.sh path resolution
2021-12-13 14:23:25 +02:00
Aurel Canciu
b75dbf8c70 Fix ./manifests/scripts/bundle.sh path resolution
The script now uses the path of the script file itself to determine the
manifests directory paths. This fixes an issue when building the AUR
packages where the check() phase would fail because the git repository
of the package would be used and this would generate invalid paths.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-12-13 12:57:33 +01:00
Stefan Prodan
062c1e59a9 Merge pull request #2208 from grafjo/bump_kube_prometheus_stack_23_2_0
Update kube-prometheus-stack to 23.2.0
2021-12-13 12:33:45 +02:00
Johannes Graf
ba5eea861e bump kube-prometheus-stack to 23.2.0
this release contains the prometheus operator in version 0.52.1

see https://github.com/fluxcd/flux2/issues/2192
https://github.com/fluxcd/flux2/pull/2193 for issues

Signed-off-by: Johannes Graf <graf@synyx.de>
2021-12-13 00:34:25 +01:00
Stefan Prodan
ff7df54899 Merge pull request #2178 from fluxcd/update-components
Update toolkit components
2021-12-09 21:00:42 +02:00
fluxcdbot
b75ce95086 Update toolkit components
- helm-controller to v0.14.1
  https://github.com/fluxcd/helm-controller/blob/v0.14.1/CHANGELOG.md
- kustomize-controller to v0.18.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.18.2/CHANGELOG.md
- source-controller to v0.19.2
  https://github.com/fluxcd/source-controller/blob/v0.19.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-12-09 17:24:34 +00:00
Hidde Beydals
a86d94745a Merge pull request #2159 from fluxcd/trace-short-styling 2021-12-09 18:23:53 +01:00
Hidde Beydals
c13de6089a cmd: start trace short description with T
This fixes a styling issue:

```
$ flux --help

Command line utility for assembling Kubernetes CD pipelines the GitOps
way.

Usage:
  flux [command]

...

Available Commands:
  ...
  suspend     Suspend resources
  trace       trace an in-cluster object throughout the GitOps delivery
pipeline
  uninstall   Uninstall Flux and its custom resource definitions
...
```

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-12-09 17:35:53 +01:00
Stefan Prodan
3cb748a47e Merge pull request #2153 from fluxcd/e2e-calico-v3.20
e2e: Update Calico to v3.20
2021-12-09 17:59:19 +02:00
Stefan Prodan
3e6e93fab4 e2e: Update Calico to v3.20
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-12-09 17:26:37 +02:00
Stefan Prodan
5832811930 Merge pull request #2195 from Nalum/issue-2192
Removing Kubernetes API Request Duration Graph
2021-12-09 16:22:44 +02:00
Luke Mallon (Nalum)
6f0ea04ff3 [refactor] Update JSON from Grafana export
Signed-off-by: Luke Mallon (Nalum) <luke.mallon@weave.works>
2021-12-09 09:46:35 +00:00
Stefan Prodan
26ea167524 Merge pull request #2194 from kingdonb/fixup-monitoring-guide
monitoring: Pin kube-prometheus-stack  to v19.3.0
2021-12-09 10:04:31 +02:00
Kingdon Barrett
1393e7a62b pin monitoring release version at 19.3.0
Something in kube-prometheus-stack 20.0.0 has broken our example.
See https://github.com/fluxcd/flux2/pull/2193 for more information.

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-12-08 16:06:27 -05:00
Stefan Prodan
7e1fd499ca Merge pull request #2191 from fluxcd/equinix-runners
Run the ARM64 e2e tests on Equinix hardware
2021-12-08 18:35:42 +02:00
Stefan Prodan
309fd86b45 Run ARM64 e2e tests on Equinix hardware
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-12-08 18:07:43 +02:00
Max Jonas Werner
e14357f694 Merge pull request #2162 from dholbach/update-max
update Max email
2021-12-01 14:01:17 +01:00
Daniel Holbach
29f0adc587 update Max email
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-12-01 12:14:42 +01:00
Stefan Prodan
3ab578747d Merge pull request #2085 from fluxcd/rfc-template
[RFC-0000] Introduce the Flux RFC template
2021-11-30 18:52:58 +02:00
Stefan Prodan
2c3cb1a664 Add template to RFC-0000
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-30 17:26:57 +02:00
Stefan Prodan
99a0c47277 Add RFC process
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-30 16:25:40 +02:00
Stefan Prodan
c5b2c6709a Add status, creation and last update date fields to RFC template
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-30 15:03:45 +02:00
Stefan Prodan
8354ac937c Introduce the Flux RFC template
The RFC template is heavily inspired by Rust RFCs and Kubernetes KEPs.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-30 15:03:45 +02:00
Daniel Holbach
aa5ad65286 Merge pull request #2147 from dholbach/change-relu-email
update Aurel's email
2021-11-26 14:54:54 +01:00
Daniel Holbach
05adb44416 update Aurel's email
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-11-26 14:29:54 +01:00
Hidde Beydals
adf5a5278f Merge pull request #2135 from fluxcd/revert-json-schemas 2021-11-24 11:54:23 +01:00
Hidde Beydals
bb04ca36b2 Pin crdjsonschema action to commit
Pinned to commit before https://github.com/fluxcd/pkg/pull/189 due to
introduction faulty behavior.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-11-24 11:37:01 +01:00
Hidde Beydals
fc94b1af7a Revert "Merge pull request #2107 from chanwit/json_schemas"
This reverts commit 75a18b4548, reversing
changes made to e72214e266.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-11-24 11:36:53 +01:00
Hidde Beydals
d9886035c8 Merge pull request #2120 from fluxcd/update-components 2021-11-24 10:47:37 +01:00
Hidde Beydals
0e122863dd Update toolkit components tests
- helm-controller to v0.14.0
- kustomize-controller to v0.18.1
- source-controller to v0.19.0
- notification-controller to v0.19.0
- image-reflector-controller to v0.14.0
- image-automation-controller to v0.18.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-11-24 10:31:17 +01:00
fluxcdbot
3089f67946 Update toolkit components
- helm-controller to v0.14.0
  https://github.com/fluxcd/helm-controller/blob/v0.14.0/CHANGELOG.md
- kustomize-controller to v0.18.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.18.1/CHANGELOG.md
- source-controller to v0.19.0
  https://github.com/fluxcd/source-controller/blob/v0.19.0/CHANGELOG.md
- notification-controller to v0.19.0
  https://github.com/fluxcd/notification-controller/blob/v0.19.0/CHANGELOG.md
- image-reflector-controller to v0.14.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.14.0/CHANGELOG.md
- image-automation-controller to v0.18.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.18.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-11-23 16:06:57 +00:00
Stefan Prodan
3654e221a9 Merge pull request #2123 from SomtochiAma/gitlab-custom-ca
Fix GitHub bootstrap when using custom TLS CA
2021-11-23 17:31:56 +02:00
Somtochi Onyekwere
a26dd05c49 Remove extra space
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-23 16:17:10 +01:00
Stefan Prodan
6c844369be Merge pull request #2121 from SomtochiAma/gitlab-custom-ca
bootstrap: Add support for self-signed TLS certs by supplying a custom CA
2021-11-23 16:54:47 +02:00
Somtochi Onyekwere
a03574f8c3 Add caBundle to bitbucket
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-23 12:37:39 +01:00
Somtochi Onyekwere
43c6a1531a Add caBundle to gogit provider config
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-23 12:02:06 +01:00
Hidde Beydals
aed7341b34 Merge pull request #2113 from fluxcd/remove-ioutil 2021-11-22 17:32:30 +01:00
Stefan Prodan
8731f00347 Remove deprecated io/ioutil from flux tree
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-22 17:53:43 +02:00
Stefan Prodan
75a18b4548 Merge pull request #2107 from chanwit/json_schemas
Publish OpenAPI JSON schemas for Visual Studio Code IntelliSense
2021-11-22 14:54:50 +02:00
Chanwit Kaewkasi
716b41e91b publish json schemas as a single URL
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>

This change publishes the auto-generated JSON schemas as a single URL,
so that it is consumable by a tool like VS Code.

The CRD generator creates 2 files, a tar.gz for Kubeval,
and another one is a JSON file. The JSON file is a combination of
all schemas, put under the "oneOf" operator.
2021-11-22 18:32:54 +07:00
Stefan Prodan
e72214e266 Merge pull request #2070 from souleb/bootstrap-stash
bootstrap: add BitBucket Server (previously known as Stash) support
2021-11-22 11:08:34 +02:00
Soule BA
46f9fc194c Add stash provider bootstrap support
The new command set is:
  flux bootstrap bitbucket-server --owner=<project> --username=<user> --repository=<repository name> --hostname=<domain> --token-auth

There is a parity in the capabilities with the other providers.

Signed-off-by: Soule BA <soule@weave.works>
2021-11-18 11:23:44 +01:00
Stefan Prodan
6c5f27be02 Merge pull request #2101 from SomtochiAma/e2e-image-test
Update test files to use ecdsa key
2021-11-17 12:45:21 +02:00
Somtochi Onyekwere
e96652bdaa Update keys to ECDSA format
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-17 11:16:36 +01:00
Somtochi Onyekwere
b7007a35d7 update test files to use ecdsa key
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-17 10:49:30 +01:00
Stefan Prodan
e4dc56b59d Merge pull request #2096 from fluxcd/e2e-image-automation
Add e2e test for image automation
2021-11-17 11:07:38 +02:00
Stefan Prodan
b05059a9c4 Add e2e test for image automation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-16 19:24:57 +02:00
Stefan Prodan
121783976a Merge pull request #2091 from vespian/prozlach/bump_alpine
Update Alpine to v3.14
2021-11-16 14:58:56 +02:00
Pawel Rozlach
5a9424d0b1 Update Alpine to v3.14
Signed-off-by: Pawel Rozlach <vespian@users.noreply.github.com>
2021-11-16 13:42:59 +01:00
Stefan Prodan
e2a3800664 Merge pull request #2080 from fluxcd/update-components
Update toolkit components
2021-11-12 17:22:43 +02:00
fluxcdbot
56815a3624 Update toolkit components
- helm-controller to v0.13.0
  https://github.com/fluxcd/helm-controller/blob/v0.13.0/CHANGELOG.md
- kustomize-controller to v0.18.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.18.0/CHANGELOG.md
- source-controller to v0.18.0
  https://github.com/fluxcd/source-controller/blob/v0.18.0/CHANGELOG.md
- image-reflector-controller to v0.13.2
  https://github.com/fluxcd/image-reflector-controller/blob/v0.13.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-11-12 15:06:46 +00:00
Stefan Prodan
ca6e0ff36e Merge pull request #2076 from fluxcd/update-components
Update toolkit components
2021-11-11 18:30:54 +02:00
fluxcdbot
4c60d1657d Update toolkit components
- helm-controller to v0.12.2
  https://github.com/fluxcd/helm-controller/blob/v0.12.2/CHANGELOG.md
- image-reflector-controller to v0.13.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.13.1/CHANGELOG.md
- image-automation-controller to v0.17.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.17.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-11-11 16:09:12 +00:00
Hidde Beydals
cdd90cfa75 Merge pull request #2075 from jack-evans/missed-trailing-separator 2021-11-11 15:14:04 +01:00
Jack Evans
05b053e2e9 remove trailing --- for install and bootstrap consistency
Signed-off-by: Jack Evans <jack.evans1@ibm.com>
2021-11-11 13:49:50 +00:00
Stefan Prodan
46c75c1af2 Merge pull request #2062 from drazul/main
Edit grafana dashboard to be able to filter by namespace
2021-11-11 13:18:58 +02:00
Daniel AguadoAraujo
80cf5fa729 Add new variable to filter by exported namespace.
Edit definition of namespace variable to use grafana custom promql function `label_values`.
Rename variable namespace to operator_namespace.
Rename variable exported_namespace to namespace

Signed-off-by: Daniel AguadoAraujo <daniel.aguadoaraujo@gfk.com>
2021-11-11 11:20:39 +01:00
Stefan Prodan
789aa322f1 Merge pull request #2071 from fluxcd/flux-tree-exclude-remote-clusters
Skip remote clusters in flux tree cmd
2021-11-10 11:41:16 +02:00
Stefan Prodan
f03c24565f Skip remote clusters in flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-09 18:52:51 +02:00
Stefan Prodan
b6a95be5d0 Merge pull request #2068 from fluxcd/update-components
Update toolkit components
2021-11-09 18:22:55 +02:00
fluxcdbot
0f9e8ed3f7 Update toolkit components
- kustomize-controller to v0.17.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.17.0/CHANGELOG.md
- image-automation-controller to v0.17.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.17.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-11-09 15:55:28 +00:00
Stefan Prodan
50af0ba93c Merge pull request #2066 from jack-evans/consistent-comments
Make flux bootstrap and install comments consistent
2021-11-09 17:54:48 +02:00
Jack Evans
923a5882de make flux bootstrap and install generation more consistent
Signed-off-by: Jack Evans <jack.evans1@ibm.com>
2021-11-09 15:18:32 +00:00
Stefan Prodan
83dc3e6093 Merge pull request #2064 from fluxcd/updates-deps
Update dependencies
2021-11-08 19:31:47 +02:00
Stefan Prodan
43edb62f87 Update dependencies
- github.com/fluxcd/go-git-providers v0.3.1
- github.com/fluxcd/pkg/ssa v0.3.1
- github.com/manifoldco/promptui v0.9.0
- sigs.k8s.io/controller-runtime v0.10.2

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-08 18:00:29 +02:00
Stefan Prodan
21e5acc0e0 Merge pull request #2038 from fluxcd/makkes/prompt-for-tokens
Prompt for access tokens in 'bootstrap' command
2021-11-08 16:58:35 +02:00
Max Jonas Werner
be1ce74dc5 fix: trim CRLF from password read from stdin
bufio's reader.ReadString includes any CRLF characters and we don't
want these in the resulting token because this leads to errors in the
authentication like this:

```
✗ failed to get Git repository
"https://github.com/kingdon-ci/jenkins-infra": Get
"https://api.github.com/repos/kingdon-ci/jenkins-infra": net/http:
invalid header field value "Bearer gho_NNNNNsecrettokenMMMMM\n" for
key Authorization
```

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-11-07 15:09:31 +01:00
Max Jonas Werner
31771f3575 fix: improve wording
Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-11-07 15:09:31 +01:00
Max Jonas Werner
ffcd7d8059 feat: prompt for access tokens in 'bootstrap' command
This change adds functionality to both, `bootstrap github` and
`bootstrap gitlab` to prompt the user for the personal access tokens
if those can't be derived from the shell environment. Echoing is
turned off for better privacy.

Instead of having to interactively type the token or manually paste it
from the clipboard, users can also pipe it to Flux which comes in
handy e.g. when executing Flux remotely over an SSH connection:

```
$ echo 'asdf' | flux bootstrap github
```

Otherwise, Flux will prompt the user:

```
$ flux bootstrap github
Please type your GitHub personal access token:
```

closes #2011

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-11-07 15:09:30 +01:00
Stefan Prodan
4bc4aa1397 Merge pull request #2050 from fluxcd/do-not-edit-warn
Add `DO NOT EDIT` warn to bootstrap sync manifests
2021-11-04 18:47:50 +02:00
Stefan Prodan
04faba95cd Add DO NOT EDIT warn to bootstrap sync manifests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-04 18:03:40 +02:00
Sunny
f712dadab5 Merge pull request #2051 from fluxcd/update-components
Update toolkit components
2021-11-04 21:31:17 +05:30
fluxcdbot
58b3150ce3 Update toolkit components
- source-controller to v0.17.2
  https://github.com/fluxcd/source-controller/blob/v0.17.2/CHANGELOG.md
- image-automation-controller to v0.16.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.16.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-11-04 14:07:27 +00:00
Stefan Prodan
e7225db397 Merge pull request #2046 from vespian/prozlach/support_http_proxy_envs
Use full domain name for notification-controller
2021-11-04 11:43:47 +02:00
Pawel Rozlach
8ec5492d87 fix: use full domain name for notification-controller
Signed-off-by: Pawel Rozlach <vespian@users.noreply.github.com>
2021-11-03 10:37:29 +01:00
Stefan Prodan
c2c64a70c4 Merge pull request #2042 from fluxcd/ecdsa-default
Set ECDSA as the default algorithm for `flux create source git`
2021-11-02 17:42:49 +02:00
Stefan Prodan
4621576f40 Set ECDSA as the default algorithm for flux create source git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-02 17:21:10 +02:00
Stefan Prodan
3b609e9b03 Merge pull request #2041 from fluxcd/bootstrap-ecdsa-default
bootstrap: Set ECDSA as the default SSH key algorithm
2021-11-02 17:15:57 +02:00
Stefan Prodan
4f2ebd78be Set ECDSA as the default algorithm for flux create secret git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-02 16:49:17 +02:00
Stefan Prodan
88dacebc94 bootstrap: Set ECDSA as the default SSH key algorithm
Motivation: RSA SHA-1 SSH keys are no longer accepted by GitHub https://github.blog/2021-09-01-improving-git-protocol-security-github/.
Given this we are switching the default from RSA to ECDSA for `git`, `github` and `gitlab` variants of `flux bootstrap`.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-02 16:22:16 +02:00
Stefan Prodan
92e7d1ad1e Merge pull request #2036 from fluxcd/part-of-selector
Switch to `app.kubernetes.io/part-of` label selector
2021-11-01 18:37:03 +02:00
Stefan Prodan
d5d8c340c8 Switch to app.kubernetes.io/part-of label selector
Use `app.kubernetes.io/part-of: flux` label instead of `app.kubernetes.io/instance` to select the in-cluster objects used in flux version, check, logs and uninstall commands.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 18:02:49 +02:00
Stefan Prodan
b8a85b809a Merge pull request #2035 from fluxcd/source-fetch-timeout
Add fetch timeout arg to create source commands
2021-11-01 16:06:12 +02:00
Stefan Prodan
61be0775af Add fetch timeout arg to create source commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 15:37:58 +02:00
Stefan Prodan
404ffa5a91 Merge pull request #2034 from fluxcd/default-namespace-from-env
Set default ns with `FLUX_SYSTEM_NAMESPACE` env var
2021-11-01 14:56:47 +02:00
Stefan Prodan
f2de7e04b8 Set default ns with FLUX_SYSTEM_NAMESPACE env var
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 14:21:44 +02:00
Stefan Prodan
8b3e3b1dd7 Merge pull request #2033 from fluxcd/update-issue-template
Add flux version to issue template
2021-11-01 13:07:35 +02:00
Stefan Prodan
81e91ac3f5 Add flux version to issue template
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 12:46:52 +02:00
Stefan Prodan
b9bde94d08 Merge pull request #2032 from fluxcd/tree-completion
Enable completion for flux tree cmd
2021-11-01 12:40:36 +02:00
Stefan Prodan
37746023c1 Enable completion for flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 12:19:06 +02:00
Stefan Prodan
d3e529b8a4 Merge pull request #2015 from SomtochiAma/test-export-cmd
Add unit tests for export
2021-11-01 12:18:55 +02:00
Somtochi Onyekwere
eb69083ef5 Add unit tests for export
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-01 10:46:07 +01:00
Hidde Beydals
96aac387c9 Merge pull request #2028 from fluxcd/update-components 2021-10-30 15:34:11 +02:00
fluxcdbot
870f18c621 Update toolkit components
- source-controller to v0.17.1
  https://github.com/fluxcd/source-controller/blob/v0.17.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-30 13:11:56 +00:00
Hidde Beydals
57b33e29f7 Merge pull request #2024 from kingdonb/fix-error-message-quoting 2021-10-29 18:11:39 +02:00
Kingdon Barrett
94b7917679 Fix quoting around reconciliation error message
While fixing an unrelated issue, I noticed:
    ✗ GitRepository reconciliation failed: ''PGP public keys secret error: expected pointer, but got nil

the single quote should surround the readyCond.Message

Signed-off-by: Kingdon Barrett <yebyen@gmail.com>
2021-10-29 11:21:56 -04:00
Hidde Beydals
98fa0c4271 Merge pull request #2023 from fluxcd/update-components-test 2021-10-28 17:30:10 +02:00
Hidde Beydals
8282907bce Update toolkit components tests
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-28 17:01:24 +02:00
Hidde Beydals
323f4f5e5f Merge pull request #2022 from fluxcd/update-components 2021-10-28 17:00:39 +02:00
fluxcdbot
744b3ebd0a Update toolkit components
- source-controller to v0.17.0
  https://github.com/fluxcd/source-controller/blob/v0.17.0/CHANGELOG.md
- image-automation-controller to v0.16.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.16.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-28 14:46:49 +00:00
Stefan Prodan
3fdba35993 Merge pull request #2021 from fluxcd/e2e-retry-gh-get
e2e: Retry the GitHub API calls
2021-10-28 11:23:15 +03:00
Stefan Prodan
ebdf9ed379 e2e: Retry the GitHub API calls
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-28 10:56:52 +03:00
Stefan Prodan
a572274c5c Merge pull request #1932 from SomtochiAma/test-bootstrap
Add test for customizing bootstrap
2021-10-28 09:53:43 +03:00
Somtochi Onyekwere
6a6bba8669 Add test for customizing bootstrap
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-27 15:45:23 +01:00
Stefan Prodan
1d1d4bbf4b Merge pull request #2008 from fluxcd/expand-hr-in-tree-ks
Expand Helm releases in flux tree cmd
2021-10-26 18:04:53 +03:00
Stefan Prodan
d9bb4c631e Add flux tree to e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-26 17:34:01 +03:00
Stefan Prodan
722962c138 Expand Helm releases in flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-26 15:54:31 +03:00
Stefan Prodan
c98ff6ae87 Merge pull request #1988 from darkowlzz/update-maintainers
Add @darkowlzz to maintainers list
2021-10-25 19:36:16 +03:00
Sunny
cbef6a4cad Add @darkowlzz to maintainers list
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-10-25 21:48:59 +05:30
Stefan Prodan
f887a2c029 Merge pull request #1998 from fluxcd/tree-cmd
Add flux tree command
2021-10-25 16:51:01 +03:00
Stefan Prodan
078cfe92c2 Add JSON and YAML output options to flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-25 13:45:27 +03:00
Stefan Prodan
80ef184b60 Add flux tree command
The `flux tree kustomization` command prints the resources reconciled by the given Kustomization.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-25 13:45:13 +03:00
Hidde Beydals
f2475988bd Merge pull request #2000 from wingkwong/refak/ioutil 2021-10-24 18:53:13 +02:00
WONG, Wing Kam
45526108e0 Remove use of deprecated io/ioutil
Signed-off-by: WONG, Wing Kam <wingkwong.code@gmail.com>
2021-10-24 22:17:20 +08:00
Stefan Prodan
414c0bbbdc Merge pull request #1997 from johngmyers/contrib-slack
Update Slack channel in CONTRIBUTING.md
2021-10-23 11:05:54 +03:00
John Gardiner Myers
6873a710d9 Update Slack channel in CONTRIBUTING.md
Signed-off-by: John Gardiner Myers <jgmyers@proofpoint.com>
2021-10-22 10:59:49 -07:00
Hidde Beydals
8a44006384 Merge pull request #1996 from fluxcd/e2e-azure-update 2021-10-22 16:39:59 +02:00
Hidde Beydals
1b6061066a e2e/azure: update dependencies
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-22 16:07:04 +02:00
Hidde Beydals
3a8a5982c6 Merge pull request #1977 from fluxcd/libgit2-semver-e2e 2021-10-22 16:00:30 +02:00
Stefan Prodan
ccff578492 e2e: Add test for libgit2 tag semver range
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-22 15:40:54 +02:00
Hidde Beydals
e2402e3d84 Merge pull request #1993 from fluxcd/update-components 2021-10-22 15:40:20 +02:00
fluxcdbot
f13b1629cf Update toolkit components
- source-controller to v0.16.1
  https://github.com/fluxcd/source-controller/blob/v0.16.1/CHANGELOG.md
- notification-controller to v0.18.1
  https://github.com/fluxcd/notification-controller/blob/v0.18.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-22 13:11:43 +00:00
Stefan Prodan
72a97bb70a Merge pull request #1983 from SomtochiAma/test-create-secret-export
Add unit tests for create secret export
2021-10-22 15:01:10 +03:00
Somtochi Onyekwere
67b393ce09 Add test for create secret
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-22 12:34:36 +01:00
Stefan Prodan
48e89b95bb Merge pull request #1985 from makkes/add-myself-to-maintainers
Add Max Jonas Werner to maintainer list
2021-10-22 12:38:19 +03:00
Max Jonas Werner
2159ed62d0 Add Max Jonas Werner to maintainer list
Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-10-22 10:56:32 +02:00
Stefan Prodan
8bb65719cd Merge pull request #1984 from fluxcd/fix-bootstrap-path-check
Fix bootstrap path check
2021-10-22 11:43:53 +03:00
Stefan Prodan
4352915945 Fix bootstrap path check
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-22 10:55:31 +03:00
Stefan Prodan
ebd145f7f7 Merge pull request #1982 from fluxcd/poll-interval
Add poll interval flag to flux check cmd
2021-10-22 10:44:13 +03:00
Stefan Prodan
cd52a0eef3 Add poll interval flag to flux check cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-22 09:57:54 +03:00
Stefan Prodan
69e4a86fe2 Merge pull request #1978 from darkowlzz/release-docs-improvements
Minor improvements in the release procedure docs
2021-10-21 17:00:29 +03:00
Sunny
52d89a2ee1 Minor improvements in the release procedure docs
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-10-21 18:09:52 +05:30
Stefan Prodan
5c60e792d9 Merge pull request #1976 from fluxcd/e2e-run-docs
Install envtest before running the unit tests
2021-10-21 10:32:04 +03:00
Stefan Prodan
77c9611784 Improve the test suite docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 09:57:38 +03:00
Stefan Prodan
66780bbf54 Install envtest before running the unit tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 09:56:33 +03:00
Stefan Prodan
a8932e677e Merge pull request #1975 from johngmyers/fix-compile
Fix inadequate quoting of KUBEBUILDER_ASSETS
2021-10-21 08:58:24 +03:00
John Gardiner Myers
e12988a8f9 Fix inadequate quoting of KUBEBUILDER_ASSETS
Signed-off-by: John Gardiner Myers <jgmyers@proofpoint.com>
2021-10-20 15:23:13 -07:00
Philip Laine
6ee4abe79e Merge pull request #1970 from fluxcd/fix/azure-e2e-cleanup
Fix infrastructure clean up on Azure e2e test failure
2021-10-20 17:18:41 +02:00
Philip Laine
948e050d60 Fix infrastructure clean up on test failure
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2021-10-20 16:11:54 +02:00
Stefan Prodan
87feb45751 Merge pull request #1961 from fluxcd/ks-wait
Add wait flag to create kustomization cmd
2021-10-19 16:34:58 +03:00
Stefan Prodan
77aa81a064 Add wait flag to create kustomization cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-19 16:18:09 +03:00
Stefan Prodan
a4a1db0915 Update fluxcd packages
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-19 16:17:38 +03:00
Stefan Prodan
57b9610af7 Merge pull request #1946 from fluxcd/update-components
Update toolkit components
2021-10-19 16:13:33 +03:00
fluxcdbot
c3384c6499 Update toolkit components
- helm-controller to v0.12.1
  https://github.com/fluxcd/helm-controller/blob/v0.12.1/CHANGELOG.md
- kustomize-controller to v0.16.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.16.0/CHANGELOG.md
- notification-controller to v0.18.0
  https://github.com/fluxcd/notification-controller/blob/v0.18.0/CHANGELOG.md
- image-reflector-controller to v0.13.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.13.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-19 12:53:27 +00:00
Stefan Prodan
5389859260 Merge pull request #1948 from darkowlzz/fix-install-make-target
Makefile: set install target as phony
2021-10-19 15:08:36 +03:00
Sunny
84c585cf61 Makefile: set install target as phony
`install/` directory results in make install target always up to date.
Mark `install` as phony to be able to run it.

Replace `cmd/flux` with `./cmd/flux` for install to work and add
`CGO_ENABLED=0` like in other build and install targets.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-10-14 23:37:20 +05:30
Stefan Prodan
ca496d393d Merge pull request #1943 from fluxcd/add-copyright
Add missing copyright headers
2021-10-14 16:36:34 +03:00
Stefan Prodan
3d4ca831dc Add missing copyright headers
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-14 16:14:28 +03:00
Stefan Prodan
7ace8de753 Merge pull request #1942 from fluxcd/part-of-flux-label
Add part-of label to the static manifests
2021-10-14 16:08:02 +03:00
Stefan Prodan
928d3e2185 Add part-of label to the static manifests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-14 15:40:36 +03:00
Stefan Prodan
cbf2b90320 Merge pull request #1938 from fluxcd/fix-rbac-for-irc-ns-access
Allow namespaces readonly access in crd-controller RBAC ClusterRole
2021-10-14 15:16:28 +03:00
Aurel Canciu
69dce73e51 Allow namespaces readonly crd-controller rbac
Readonly access to namespaces is needed by the
image-reflector-controller to support the cross-namespace accessFrom
functionality introduced in image-reflector-controller#162.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-10-13 19:35:31 +02:00
Stefan Prodan
75d4f87dec Merge pull request #1937 from SomtochiAma/resume-docs
Fix description for resume --all
2021-10-13 18:41:43 +03:00
Somtochi Onyekwere
4f7d89e825 Fix description for resume --all
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-13 16:25:15 +01:00
Stefan Prodan
da87e16321 Merge pull request #1935 from fluxcd/update-components
Update toolkit components
2021-10-13 15:04:51 +03:00
Stefan Prodan
f7aa3e7e1b Update github.com/fluxcd/pkg/ssa to v0.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-13 14:43:35 +03:00
fluxcdbot
deacfd6c03 Update toolkit components
- kustomize-controller to v0.15.5
  https://github.com/fluxcd/kustomize-controller/blob/v0.15.5/CHANGELOG.md
- notification-controller to v0.17.1
  https://github.com/fluxcd/notification-controller/blob/v0.17.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-13 11:16:40 +00:00
Stefan Prodan
3e8d1ae1d5 Merge pull request #1732 from timja/kustomize-substitute-fixes
Avoid substitution issue in kustomize credentials sync
2021-10-13 14:16:03 +03:00
Tim Jacomb
08f5ca39b0 Avoid substitution issue in kustomize credentials sync
Signed-off-by: Tim Jacomb <tim.jacomb@hmcts.net>
2021-10-13 11:50:16 +01:00
Stefan Prodan
31da363495 Merge pull request #1925 from fluxcd/update-components
Update kustomize-controller to v0.15.4
2021-10-12 13:32:09 +03:00
fluxcdbot
2ecd99d317 Update toolkit components
- kustomize-controller to v0.15.4
  https://github.com/fluxcd/kustomize-controller/blob/v0.15.4/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-12 10:15:51 +00:00
Stefan Prodan
59c3d84182 Merge pull request #1847 from OakNorthAI/let-user-set-version-to-install
feature: let user specify what version of flux-cli they want to install
2021-10-12 13:15:11 +03:00
Jakub Baron
641d5378f8 Merge branch 'main' into let-user-set-version-to-install 2021-10-11 12:39:37 +01:00
Stefan Prodan
08512e5c43 Merge pull request #1919 from fluxcd/fix-ssa
Fix SSA upstream bugs for Kubernetes < 1.22
2021-10-10 18:43:41 +03:00
Stefan Prodan
8f7f7b23e8 Downgrade e2e tests to Kubernetes v1.19
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-10 16:43:21 +03:00
Stefan Prodan
2eb6ba5a48 Apply SSA fix to flux install and bootstrap
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-10 16:08:16 +03:00
Stefan Prodan
03df386f9e Update kustomize-controller to v0.15.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-10 16:07:36 +03:00
Stefan Prodan
5e741da69c Merge pull request #1915 from fluxcd/azure-e2e-fixes
Improve Azure e2e failure tracing
2021-10-09 12:06:39 +03:00
Stefan Prodan
3bea028cc9 Add debug logs to Azure tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-09 11:28:12 +03:00
Hidde Beydals
10475b24c4 Merge pull request #1914 from fluxcd/fix-event-hub-test 2021-10-09 08:57:07 +02:00
Stefan Prodan
a5238e867c Adapt event test for kustomize-controller v0.15
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 22:22:36 +03:00
Stefan Prodan
0e747790f9 Merge pull request #1908 from fluxcd/ssa
Implement server-side apply
2021-10-08 21:33:32 +03:00
Stefan Prodan
2b4d6150d4 Update kustomize-controller to v0.15.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:13:59 +03:00
Stefan Prodan
e22ad96164 Update kubectl to v1.22.2 in the multi-arch image
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:11:09 +03:00
Stefan Prodan
f54907e66e Remove kubectl dependency from brew and aur pkgs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:11:08 +03:00
Stefan Prodan
fb713e9632 Mark the validation arg as deprecated
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:11:08 +03:00
Stefan Prodan
0b659e3f09 Update kustomize-controller API to v1beta2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:11:06 +03:00
Stefan Prodan
4c99117c7c Update Kubernetes version minimum requirements
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:10:36 +03:00
Stefan Prodan
83c3e8c2fc Replace kubectl with Go server-side apply
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 21:10:31 +03:00
Stefan Prodan
92277225df Merge pull request #1907 from fluxcd/update-components
Update toolkit components
2021-10-08 21:09:17 +03:00
fluxcdbot
622ed88a11 Update toolkit components
- helm-controller to v0.12.0
  https://github.com/fluxcd/helm-controller/blob/v0.12.0/CHANGELOG.md
- kustomize-controller to v0.15.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.15.1/CHANGELOG.md
- source-controller to v0.16.0
  https://github.com/fluxcd/source-controller/blob/v0.16.0/CHANGELOG.md
- notification-controller to v0.17.0
  https://github.com/fluxcd/notification-controller/blob/v0.17.0/CHANGELOG.md
- image-automation-controller to v0.15.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.15.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-10-08 17:54:00 +00:00
Stefan Prodan
d9414f25d5 Merge pull request #1913 from SomtochiAma/gpg-signing
Add check for empty gpg key ring path
2021-10-08 20:53:25 +03:00
Hidde Beydals
5249d17a95 Use proper GPG terminology
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 19:35:39 +02:00
Somtochi Onyekwere
25283d357e Add check for empty path and better error messaging
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-08 19:19:21 +02:00
Somtochi Onyekwere
e926321094 Check if path is empty
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-08 19:19:21 +02:00
Stefan Prodan
9c1542c3f3 Merge pull request #1912 from fluxcd/irc-v0.12.0
Update image-reflector-controller to v0.12.0
2021-10-08 20:16:32 +03:00
Stefan Prodan
25d06a53bc Update image-reflector-controller to v0.12.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 19:26:31 +03:00
Stefan Prodan
4d904e8216 Merge pull request #1854 from SomtochiAma/gpg-signing
Allow users to use gpg signing for bootstrap commits
2021-10-08 19:21:27 +03:00
Somtochi Onyekwere
0beab87f5b Add gpg key path and passphrase as args
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-08 16:59:08 +01:00
Stefan Prodan
b9ceceada4 Merge pull request #1881 from philnichol/add-git-ref-options-to-manifestgen
Add tag, semver and commit args to manifestgen
2021-10-07 13:51:39 +03:00
Phil Nichol
ac7ccf7b94 added tag,semver,commit to manifestgen
Signed-off-by: Phil Nichol <35630607+philnichol@users.noreply.github.com>
2021-10-07 10:06:27 +01:00
Stefan Prodan
5aa9ae511f Merge pull request #1898 from superbrothers/stdout
Fix "get" commands to use stdout instead of stderr
2021-10-06 10:48:33 +03:00
Kazuki Suda
dd81ed896b Fix "get" subcommands to use stdout instead of stderr
Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com>
2021-10-06 10:46:37 +09:00
Stefan Prodan
e6bbed162d Merge pull request #1893 from SomtochiAma/flux-version
Add flux version command
2021-10-05 13:02:11 +03:00
Somtochi Onyekwere
3ee8747fdc Add flux version command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-05 10:29:00 +01:00
Stefan Prodan
0651064999 Merge pull request #1855 from darklore/shell-completion-homebrew
Add shell completion installation to homebrew formula
2021-10-05 12:19:04 +03:00
darklore
4661e4519d Add shell completion installation to homebrew formulae
Signed-off-by: Katsunori Tanaka <zodiac.brave.story@gmail.com>
2021-10-05 03:11:24 +09:00
Stefan Prodan
19caeb178f Merge pull request #1816 from fluxcd/azure/e2e
Add Azure E2E tests
2021-10-04 15:42:56 +03:00
Philip Laine
d8235ea21b Add Azure E2E tests
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2021-10-04 14:15:58 +02:00
Stefan Prodan
5067df179e Merge pull request #1886 from SomtochiAma/fix-flux-logs
Filter pods from each deployment for flux logs
2021-10-03 17:11:08 +03:00
Somtochi Onyekwere
50a1e32da3 Sort pods from each deployment to get first and ready pod
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-03 14:30:31 +01:00
Stefan Prodan
fb85cafcc5 Merge pull request #1874 from SomtochiAma/helm-reconcile
Add better checks for reconciliation in reconcile run command
2021-10-03 10:30:16 +03:00
Somtochi Onyekwere
d06a2936cc Better checks for reconciliation in reconcile run command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-01 08:24:13 +01:00
Stefan Prodan
7c77a9723a Merge pull request #1877 from fluxcd/multi-arch-kubectl
Use multi-arch image for kubectl
2021-09-30 11:19:41 +03:00
Stefan Prodan
8a3e5790f5 Use multi-arch image for kubectl
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 11:04:04 +03:00
Hidde Beydals
dd093a775a Merge pull request #1869 from SomtochiAma/team-access-github 2021-09-28 09:42:29 +02:00
Somtochi Onyekwere
a096bd2d71 Allow users to define team roles
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-09-27 21:16:12 +01:00
Hidde Beydals
2eddcde609 Merge pull request #1849 from SomtochiAma/bootstrap-git
Set username only when it isn't default
2021-09-22 16:14:30 +02:00
Somtochi Onyekwere
1849e1768a Set username when it isn't default
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-09-22 09:46:04 +01:00
Hidde Beydals
bbe62d029c Merge pull request #1846 from SomtochiAma/crd-panic-0.17.2 2021-09-21 20:19:43 +02:00
Somtochi Onyekwere
68a89d3cd4 Check for nil pointer before setting createNamespace in helmrelease
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-09-21 14:37:20 +01:00
Jakub Baron
b16f1fc260 feature: let user specify what version of flux-cli they want to install
Signed-off-by: Jakub Baron <jakub.baron@oaknorth.com>
2021-09-21 12:36:47 +01:00
Somtochi Onyekwere
64f39e160b Check if helmRelease.Spec.Install is nil
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-09-21 11:04:21 +01:00
Stefan Prodan
3a76c26822 Merge pull request #1844 from fluxcd/fail-manifests-build-properly
Update Makefile target in release workflow
2021-09-20 18:33:05 +03:00
Michael Bridgen
9d9fff5796 Update Makefile target in release workflow
There's another location which uses the "manifests directory" target
directly, but isn't run when testing a PR: the release workflow.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-09-20 16:06:01 +01:00
Stefan Prodan
0a92c61b09 Merge pull request #1830 from makkes/fix-create-hr
fix: don't set 'Install' field by default in 'create hr'
2021-09-20 17:11:30 +03:00
Max Jonas Werner
546be76f55 fix: don't set 'Install' field by default in 'create hr'
This fixes the case where you create a HelmRelease with `--export` and
the `install: {}` field being there, adding no value to the manifest.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-09-20 14:42:29 +02:00
Stefan Prodan
d770f3f53f Merge pull request #1838 from superbrothers/dynamic-completions
Add dynamic completion suppport
2021-09-20 09:42:54 +03:00
Kazuki Suda
254cc131ae Add dynamic completion suppport
This commit adds dynamic completion support for the following commands
and flags:

- `flux delete ...` command
- `flux export ...` command
- `flux get ...` command
- `flux reconcile ...` command
- `flux resume ...` command
- `flux suspend ...` command
- `--namespace` flag
- `--context` flag

Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com>
2021-09-18 17:27:47 +09:00
Stefan Prodan
70509ffcb4 Merge pull request #1833 from superbrothers/fix-971
Fix `flux completion zsh` to work with `source` only
2021-09-18 11:14:44 +03:00
Kazuki Suda
4cc2326c7f Fix flux completion zsh to work with source only
Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com>
2021-09-17 17:49:47 +09:00
Michael Bridgen
0133caaec4 Merge pull request #1828 from fluxcd/fail-manifests-build-properly
Use a file to record successful manifests build
2021-09-16 14:33:58 +01:00
Michael Bridgen
7ae4f28920 Use a file to record successful manifests build
Using the directory cmd/flux/manifests as a prerequisite causes a
problem: if the script that creates the files within fails, the next
invocation of make will see the directory and assume it
succeeded. Since the executable expects certain files to be present,
but they are not explicit prerequisites of the recipe for building the
binary, this results in a successful build but a broken `flux`
executable.

Instead, depend on a file that's explicitly updated when the script
has succeeded, and which itself depends on the inputs.

A couple of the CI workflows run

    make cmd/flux/manifests

before doing other things, presumably as a way to avoid running the
whole test suite in a CI pipeline for some purpose other than testing,
so these needed changing as well.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-09-16 14:03:13 +01:00
Stefan Prodan
b1eb0270e9 Merge pull request #1811 from fluxcd/replace-promptui-lgpl
Replace promptui pkg with a fork free of LGPL
2021-09-13 14:47:10 +03:00
Stefan Prodan
03b6de1169 Replace promptui pkg with a fork free of LGPL
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-13 14:27:06 +03:00
Stefan Prodan
9d3f75d111 Merge pull request #1810 from fluxcd/pass-version-to-build
Add version arg to make build
2021-09-13 14:17:27 +03:00
Stefan Prodan
5c41924b2f Add version arg to make build
Allow specifying the version when building the CLI binary with Make. This is useful for projects that distribute their own Flux CLI binary.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-13 13:59:52 +03:00
Stefan Prodan
7cf7cf2f1e Merge pull request #1801 from fluxcd/update-components
Update toolkit components
2021-09-09 16:46:43 +03:00
fluxcdbot
2679731bde Update toolkit components
- kustomize-controller to v0.14.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.14.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-09-09 13:14:44 +00:00
Stefan Prodan
ad73370cd7 Merge pull request #1791 from 23technologies/feat/fix-secretRef-bucket-creation
Fix Bucket SecretRef mapping
2021-09-07 14:20:13 +03:00
Fynn Späker
18acae57bd Fix SecretRef
Signed-off-by: Fynn Späker <spaeker@23technologies.cloud>
2021-09-07 12:15:35 +02:00
Hidde Beydals
b427356eca Merge pull request #1782 from makkes/bootstrap-with-custom-ca
feat: enable bootstrap with custom CA locally
2021-09-03 15:54:09 +02:00
Max Jonas Werner
2e6ca16a4a chore: use os.ReadFile instead of deprecated ioutil.ReadFile
Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-09-03 12:20:57 +02:00
Max Jonas Werner
e98f1142a6 feat: enable bootstrap with custom CA locally
When a user provided the `--ca-file` flag to the `bootstrap` command,
the given CA file wasn't taken into account for cloning the repository
locally. It was just passed along to the CR that is created so Flux
can make use of it when cloning the repository in-cluster.

However, users may not want to add a custom CA to their local host's
trust chain and may expect the `--ca-file` flag to be respected also
for cloning the repository locally. This is what this commit
accomplishes.

closes #1775

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-09-01 15:38:53 +02:00
Hidde Beydals
06fa8f75c9 Merge pull request #1696 from allenporter/flux-cmd-create
Add tests for create source git
2021-08-30 17:43:09 +02:00
Allen Porter
8cbd4e8172 Add test for "flux create source git"
The create source tests are more interesting than the existing tests as they
create objects then wit for the flux source reconciler to complete. The tests
simulate this with a background goroutine that waits for an object to be
created then uses a test specific function to update it.

The tests set a timeout so that if there is a failure they timeout somewhat
quickly rather than hanging for a longer period of time.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-30 07:44:03 -07:00
Stefan Prodan
83c7994266 Merge pull request #1761 from fluxcd/improve-readme
Simplify readme
2021-08-27 16:31:23 +03:00
Stefan Prodan
43843581b6 Simplify readme
- remove install instruction as they get out of sync with the docs website
- make the get started guide the first link under docs

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-27 16:07:25 +03:00
Stefan Prodan
7e03d64e8a Merge pull request #1757 from Schildkroete23/main
Be able to create a git source without human interaction.
2021-08-27 16:06:34 +03:00
Daniel Petró
c6f4d71187 Be able to create a git source without human interaction.
Signed-off-by: Daniel Petró <daniel.petro@icloud.com>
2021-08-27 13:01:35 +02:00
Stefan Prodan
69c3b90fea Merge pull request #1755 from fluxcd/update-components
Update toolkit components
2021-08-26 15:35:01 +03:00
fluxcdbot
75309b4c93 Update toolkit components
- kustomize-controller to v0.14.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.14.0/CHANGELOG.md
- notification-controller to v0.16.0
  https://github.com/fluxcd/notification-controller/blob/v0.16.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-08-26 12:11:29 +00:00
Stefan Prodan
433f13a7ed Merge pull request #1754 from ttulka/logs-since-2
Add `logs` flags `--since` and `--since-time`
2021-08-26 15:10:58 +03:00
Tomas Tulka
8896a1e73e tidy
Signed-off-by: Tomas Tulka <tomas.tulka@gmail.com>
2021-08-26 10:56:25 +02:00
Tomas Tulka
54758b1692 add --since and --since-time
Signed-off-by: Tomas Tulka <tomas.tulka@gmail.com>
2021-08-25 22:10:47 +02:00
Stefan Prodan
375e00c79c Merge pull request #1748 from allenporter/ioutil
Remove use of deprecated io/ioutil
2021-08-25 08:41:50 +03:00
Allen Porter
e2454d91f1 Remove use of deprecated io/ioutil
Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-24 13:06:17 -07:00
Stefan Prodan
6894f6f3bf Merge pull request #1743 from allenporter/flux-envtest
Use shared envTest for unit tests
2021-08-24 11:56:23 +03:00
Allen Porter
d45501a129 Use shared envTest for unit tests
Speed up unit tests by using a shared envTest. This requires each
test to use its own namespace to avoid clobbering objects for
other tests. Tests previously took around 8 seconds each, and now
the initial test takes 2 seconds with follow up tests taking less
than a second each.

Also update existing tests that use a fixed namespace to use a
generated namespace.

Share gold file template function with yaml files.

Remove the testClusterMode, and instead rely on MainTest to do
the appropriate test setup and rootArgs flag setup. Move the
rootArg flag setup out of NewTestEnvKubeManager to avoid
side effects.

A follow up change can be to push the individual setups
from NewTestEnvKubeManager() into their respective TestMain since
the harness share little code.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-24 01:01:14 -07:00
Stefan Prodan
def92e14ee Merge pull request #1740 from allenporter/flux-test-cleanup
Rename trace test golden files
2021-08-23 19:50:28 +03:00
Allen Porter
11708d4189 Rename trace test golden files
Rename trace test golden files to match the convention used by other tests

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-23 09:29:27 -07:00
Stefan Prodan
2bc64bf419 Merge pull request #1739 from allenporter/flux-cmd-test-func
Make test harness more flexible with functions
2021-08-23 19:25:31 +03:00
Allen Porter
3a3bdc62c8 Make test harness more flexible with functions
Replace the 4 arguments to cmdTestCase with a function that
can let tests run arbitrary logic if it is more complex than
what is provided by the test harness. Move the existing logic
into functions that the test can use for common assertions on
golden files and golden values.

These changes were pulled out of PR #1696 to make a smaller review.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-23 08:57:43 -07:00
Stefan Prodan
72294b2a56 Merge pull request #1733 from fluxcd/arm64-e2e
Move arm64 e2e to Go tests
2021-08-19 15:47:52 +03:00
Stefan Prodan
94940a20ef Move arm64 e2e to Go tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-19 15:16:45 +03:00
Stefan Prodan
219ff2ef7d Merge pull request #1729 from timja/patch-1
Avoid substitution issue in kustomize for azure credentials sync
2021-08-19 13:10:54 +03:00
Tim Jacomb
bc2de741b8 Avoid substitution issue in kustomize for azure credentials sync
Signed-off-by: Tim Jacomb <tim.jacomb@hmcts.net>
2021-08-19 07:53:58 +01:00
Stefan Prodan
5eabd4e898 Merge pull request #1726 from allenporter/flux-envtest
Remove fakeclient and use testenv for flux cmd tests
2021-08-19 08:33:16 +03:00
Allen Porter
e8d6d5fe5c Remove fakeclient and use testenv for flux cmd tests
Remove use of the fake client, and replace with a real client connected to the
testEnv.

This required fixes to the yaml files as the testEnv has stricter verifcation
of objects. This also meant it was not possible to test a GitRepository with
a missing artifact since that is not a valid state.

The tests are slower than before, taking around 7-10 seconds each because the
 testEnv is setup and destroyed for every test. These will be sped up in a
 follow up PR.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-18 18:53:53 -07:00
Stefan Prodan
55bd93ff79 Merge pull request #1727 from fluxcd/make-envtest
Wire kubebuilder assets to envtest bin
2021-08-18 17:55:02 +03:00
Stefan Prodan
b34b2d779b Wire kubebuilder assets to envtest bin
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-18 17:35:46 +03:00
Stefan Prodan
103ed2be65 Merge pull request #1719 from chanwit/e2e_check_pre
Add e2e test case fo check --pre
2021-08-18 16:42:53 +03:00
Chanwit Kaewkasi
cc32c1be07 add e2e test for check --pre with templating support
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-08-18 18:28:37 +07:00
Stefan Prodan
a3ba9817a3 Merge pull request #1720 from dholbach/update-calendar
Update links to calendar and resources
2021-08-17 17:10:40 +03:00
Daniel Holbach
6d5f1b17ad update links to calendar and resources
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-08-17 14:43:04 +02:00
Stefan Prodan
0d5d5fce46 Merge pull request #1721 from fluxcd/test-ref
Refactor e2e tests
2021-08-17 15:31:29 +03:00
Stefan Prodan
375edffd15 Add image scanning e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-17 15:15:42 +03:00
Stefan Prodan
d1982e64b2 Refactor e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-17 13:55:14 +03:00
Stefan Prodan
cec8b5336c Merge pull request #1697 from chanwit/e2e_install
Implement testEnv for e2e tests
2021-08-16 20:39:31 +03:00
Chanwit Kaewkasi
8f78263455 implement testEnv for e2e tests
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-08-17 00:07:09 +07:00
Stefan Prodan
cb96bca6aa Merge pull request #1672 from souleb/main
Adds a watch flag to the get command
2021-08-06 16:16:34 +03:00
Soule BA
c18d0b9217 Adds a watch flag to the get command
The new flag fetch and display the request ressource and then continue
watching the ressource until timeout or cancellation.

A single ressource/ressource type is supported.

Signed-off-by: Soule BA <soule@weave.works>
2021-08-06 13:44:06 +02:00
Hidde Beydals
d1970185b9 Merge pull request #1690 from fluxcd/update-components
Update toolkit components
2021-08-05 19:03:02 +02:00
fluxcdbot
794d3ee2f5 Update toolkit components
- helm-controller to v0.11.2
  https://github.com/fluxcd/helm-controller/blob/v0.11.2/CHANGELOG.md
- kustomize-controller to v0.13.3
  https://github.com/fluxcd/kustomize-controller/blob/v0.13.3/CHANGELOG.md
- source-controller to v0.15.4
  https://github.com/fluxcd/source-controller/blob/v0.15.4/CHANGELOG.md
- notification-controller to v0.15.1
  https://github.com/fluxcd/notification-controller/blob/v0.15.1/CHANGELOG.md
- image-reflector-controller to v0.11.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.11.1/CHANGELOG.md
- image-automation-controller to v0.14.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.14.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-08-05 16:48:34 +00:00
Hidde Beydals
daeef98dfb Merge pull request #1688 from allenporter/flux-test-main
Replace init() with TestMain()
2021-08-05 18:46:56 +02:00
Allen Porter
4146df1f02 Replace init() with TestMain()
Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-04 08:14:22 -07:00
Hidde Beydals
78f4dfa48d Merge pull request #1687 from allenporter/flux-cmd-ioutil
Remove deprecated io/ioutil usage
2021-08-04 16:58:51 +02:00
Allen Porter
8b68d7d7e2 Remove deprecated io/ioutil usage
Issue #1658

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-04 07:46:25 -07:00
Stefan Prodan
ba1bba17ad Merge pull request #1683 from charles-woshicai/print-success-message
feat: display success message while create secrets via `flux` cli.
2021-08-04 17:40:17 +03:00
Charles Cai
70f2b5028f feat: display success message while create secrets via flux cli.
Signed-off-by: Charles Cai <charles.cai@sap.com>
2021-08-04 21:31:57 +08:00
Hidde Beydals
4f4f0d70a4 Merge pull request #1609 from fluxcd/patch-reconcile-req
Request reconcile using patch instead of update
2021-08-04 13:29:01 +02:00
Hidde Beydals
9607b07e65 Request reconcile using patch instead of update
This should prevent the generation of the object getting bumped, as
observed on a GKE K8s 1.18 cluster using the  logic before this commit.

We only want to generation to increase when there are actual changes to
the `spec` of a resource, as some controllers use the `generation`
value to make assumptions about what they should do during a
reconciliation.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-08-04 13:08:36 +02:00
Stefan Prodan
3570fab0f9 Merge pull request #1682 from fluxcd/refactor-tests
Refactor test helpers
2021-08-04 11:15:33 +03:00
Stefan Prodan
dd0f17d7a5 Refactor test helpers
- move test helpers to main
- add support for inline golden values
- add test for `flux --version`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-04 10:47:33 +03:00
Stefan Prodan
2290880389 Merge pull request #1671 from allenporter/flux-trace
Add tests for flux trace command
2021-08-04 10:18:54 +03:00
Allen Porter
351d287d88 Add tests for flux trace command
Add tests for flux trace command that fake out the kubernetes client,
load objects from a yaml file and create them in the client, and
assert on the output of the trace command to an expected golden file.

This is a follow up from the suggestions in PR https://github.com/fluxcd/flux2/pull/1626 which suggested that additional
testing would be helpful. This test approach is modeled after the helm command tests.

This required some changes to the kubernetes client setup to make it
possible to use a fake. If we agree this pattern makes sense, it can be
applied to other commands.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-03 06:35:13 -07:00
Hidde Beydals
eba6706f15 Merge pull request #1668 from dmitrika/chore/remove-deprecated-ioutil
chore: remove deprecated io/ioutil
2021-07-30 21:11:56 +02:00
Dmitry Rybin
7f425efa6b chore: remove deprecated io/ioutil
Signed-off-by: Dmitry Rybin <ayrowa@yandex.ru>
2021-07-30 20:51:46 +02:00
Stefan Prodan
d40685ab62 Merge pull request #1653 from fluxcd/gh-bug-template
Provide suggestion for some fields in bug report
2021-07-28 18:21:45 +03:00
Hidde Beydals
f795e3eeb8 Provide suggestion for some fields in bug report
This commit adds suggestion for some of the required fields because
there can be a few exceptions in which these values can not be
provided. For example when the `flux` binary can not be installed, or
the set of controllers has been installed with just an `install.yaml`
file.

We use this approach instead of making the fields optional because it
guides people to provide the information whenever they can, which
should result in higher quality bug reports.

As a tiny addition, the reference to "Flux v2" has been renamed to just
"Flux" as we are slowly transitioning "Flux v1" into "Flux Legacy".

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-07-27 13:25:17 +02:00
Hidde Beydals
d3944c0204 Merge pull request #1651 from fluxcd/gh-bug-template
Transform GitHub issue template to new format
2021-07-26 16:04:40 +02:00
Hidde Beydals
4086ab15fa Transform GitHub issue template to new format
This will help users to provide bug reports of high quality, as the
requested information is now rendered into dedicated fields, while
allowing us to mark fields as "required".

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-07-26 15:38:38 +02:00
Hidde Beydals
446a367094 Merge pull request #1626 from allenporter/flux-trace 2021-07-23 16:03:44 +02:00
Allen Porter
bd250c9871 Fix template optional field check in trace
Signed-off-by: Allen Porter <allen@thebends.org>
2021-07-22 20:20:21 -07:00
Allen Porter
91b3788362 Fix trace for optional GitRepository.Spec.Reference
Check for existence of GitRepository.Spec.Reference when displaying a trace to
avoid error:

✗ template: tmpl:28:21: executing "tmpl" at <.GitRepository.Spec.Reference.Tag>: nil pointer evaluating *v1beta1.GitRepositoryRef.Tag

Fixes issue #1621
Manually tested using the use cases highlighted in the issue.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-07-22 20:20:21 -07:00
Hidde Beydals
658dbb9ea8 Merge pull request #1628 from darkowlzz/utils-tests
internal/utils: Add unit tests
2021-07-22 12:15:55 +02:00
Sunny
1257b9cbc8 internal/utils: Add unit tests
Add unit tests for various utils functions.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-07-19 02:05:49 +05:30
Stefan Prodan
0ae39d5a0a Merge pull request #1594 from chanwit/status-selector
Add status-selector flag for get commands to filter results based on status conditions
2021-07-08 10:49:58 +03:00
Chanwit Kaewkasi
d8911e0c77 add an example to the status-selector flag's description
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-07-07 14:21:26 +07:00
Chanwit Kaewkasi
1be006a45f implement status selector
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-07-06 22:59:03 +07:00
Stefan Prodan
b95e75ddb4 Merge pull request #1591 from fluxcd/update-components
Update kustomize-controller to v0.13.2
2021-07-06 11:15:14 +03:00
fluxcdbot
15a5f75fe7 Update toolkit components
- kustomize-controller to v0.13.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.13.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-07-06 07:53:43 +00:00
Stefan Prodan
b01e27f50f Merge pull request #1590 from alex-petrov-vt/iss1585
Add no-header flag for get commands to omit printing the header
2021-07-06 10:53:16 +03:00
Alex Petrov
b1a9583262 Add no-header flag for get commands to omit printing the header
Signed-off-by: Alex Petrov <alex.petrov.vt@gmail.com>
2021-07-05 20:04:37 -04:00
Stefan Prodan
dd5e6377f8 Merge pull request #1579 from paulfantom/patch-1
Update podmonitor example
2021-07-02 14:36:12 +03:00
Paweł Krupa
fcb73554c9 Update podmonitor.yaml
`targetPort` is deprecated since prometheus-operator 0.38.0 as per https://github.com/prometheus-operator/prometheus-operator/blob/master/CHANGELOG.md#0380--2020-03-20

Signed-off-by: paulfantom <pawel@krupa.net.pl>
2021-07-01 17:27:54 +02:00
Stefan Prodan
5c4b3d1080 Merge pull request #1575 from dminca/feature/simplify-panel-label
fix Control Plane dashboard legend
2021-06-30 18:27:00 +03:00
Daniel-Andrei Minca
c98cd10621 fix Control Plane dashboard legend
The legend was not showing the Pod name, instead the whole resource in
the dashboard

As a result, use the correct Prometheus label

Resolves:
Related:
Signed-off-by: Daniel-Andrei Minca <mandrei17@gmail.com>
2021-06-30 16:10:53 +02:00
Stefan Prodan
e4af8ddcc8 Merge pull request #1574 from fluxcd/update-components
Update kustomize-controller to v0.13.1
2021-06-30 15:29:30 +03:00
fluxcdbot
b5ce02b8cf Update toolkit components
- kustomize-controller to v0.13.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.13.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-30 12:08:03 +00:00
Stefan Prodan
cd42b3fb44 Merge pull request #1569 from fluxcd/update-components
Update source-controller to v0.15.3
2021-06-29 18:17:53 +03:00
fluxcdbot
6dedb767c3 Update toolkit components
- source-controller to v0.15.3
  https://github.com/fluxcd/source-controller/blob/v0.15.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-29 14:29:00 +00:00
Stefan Prodan
4de3268f3b Merge pull request #1570 from fluxcd/ci-debug
e2e: Update Kubernetes to v1.21.1
2021-06-29 17:28:10 +03:00
Stefan Prodan
a72ff06d79 e2e: Update Kubernetes to v1.21.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-29 17:15:59 +03:00
Stefan Prodan
cf239deb3d Print pods status on e2e failures
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-29 15:57:09 +03:00
Stefan Prodan
8735229745 Merge pull request #1555 from fluxcd/trace-cmd
Implement flux trace command
2021-06-29 11:22:45 +03:00
Stefan Prodan
3f081ba2d9 Add flux trace to e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-29 11:01:20 +03:00
Stefan Prodan
3f613341cb Extend tracing to owner references
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-29 11:01:01 +03:00
Stefan Prodan
4305b8a77d Implement flux trace command
The trace command allows Flux users to point the CLI to a Kubernetes object in-cluster and get a detailed report about the GitOps pipeline that manages that particular object.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-29 11:01:00 +03:00
Stefan Prodan
fab91d44c3 Merge pull request #1568 from fluxcd/image-v1beta1
Use image API v1beta1
2021-06-29 11:00:26 +03:00
Michael Bridgen
34484734d8 Use image API v1beta1
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-06-28 16:20:05 +01:00
Stefan Prodan
10c58bb007 Merge pull request #1567 from fluxcd/update-components
Update toolkit components
2021-06-28 17:58:05 +03:00
fluxcdbot
1c1fd62a91 Update toolkit components
- image-reflector-controller to v0.11.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.11.0/CHANGELOG.md
- image-automation-controller to v0.14.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.14.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-28 14:45:58 +00:00
Stefan Prodan
637ac1e3fe Merge pull request #1559 from fluxcd/gh-action-arm
Add ARM and ARM64 support to flux GitHub Action
2021-06-25 15:19:12 +03:00
Stefan Prodan
f52387e849 Add ARM and ARM64 support to flux GitHub Action
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-25 13:32:39 +03:00
Stefan Prodan
9efc4986f9 Merge pull request #1553 from fluxcd/bootstrap-libgit2-test
Add libgit2 test to bootstrap workflow
2021-06-22 18:49:38 +03:00
Stefan Prodan
fdc366ec1c Increase wait time for the helm e2e test
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-22 18:37:04 +03:00
Stefan Prodan
d455db444c Add libgit2 test to bootstrap workflow
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-22 18:24:10 +03:00
Stefan Prodan
17418c9858 Merge pull request #1554 from fluxcd/update-components
Update toolkit components
2021-06-22 18:21:13 +03:00
fluxcdbot
5da7eb7d0d Update toolkit components
- source-controller to v0.15.2
  https://github.com/fluxcd/source-controller/blob/v0.15.2/CHANGELOG.md
- image-automation-controller to v0.13.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.13.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-22 14:00:42 +00:00
Stefan Prodan
9da977ee7a Merge pull request #1547 from fluxcd/gh-amr64-runner
Add provisioning script for ARM64 GitHub runners
2021-06-21 09:41:44 +03:00
Stefan Prodan
8e4b2ead9b Add provisioning script for ARM64 GitHub runners
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-19 14:58:57 +03:00
Hidde Beydals
fd364828a1 Merge pull request #1544 from fluxcd/create-target-namespace
Add create target namespace arg to helmrelease cmd
2021-06-18 17:00:05 +02:00
Hidde Beydals
afa58d8c08 Merge pull request #1541 from fluxcd/update-components
Update toolkit components
2021-06-18 16:58:35 +02:00
Stefan Prodan
179062876e Add create target namespace arg to helmrelease cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-18 17:39:31 +03:00
fluxcdbot
a796f3609f Update toolkit components
- helm-controller to v0.11.1
  https://github.com/fluxcd/helm-controller/blob/v0.11.1/CHANGELOG.md
- source-controller to v0.15.1
  https://github.com/fluxcd/source-controller/blob/v0.15.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-18 13:44:52 +00:00
Hidde Beydals
b7c6db74d2 Merge pull request #1542 from fluxcd/update-deps
Update source-controller to v0.15.1
2021-06-18 15:21:57 +02:00
Hidde Beydals
4f7b040405 Update source-controller to v0.15.1
This includes an introduction of a `--pass-credentials` flag for the
`flux create source helm` command to allow configuring the new
option introduced.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-18 15:04:48 +02:00
Stefan Prodan
34ca29830e Merge pull request #1540 from fluxcd/e2e-arm64
Run conformance tests on ARM64 Kubernetes clusters
2021-06-18 14:14:39 +03:00
Stefan Prodan
78f1b634fa Run end-to-end tests on Ampere ARM64
GitHub self-hosted runner info:
- Owner: Stefan Prodan
- VM: Oracle Cloud VM.Standard.A1.Flex 4CPU 24GB RAM
- OS: Linux 5.4.0-1045-oracle #49-Ubuntu SMP aarch64
- Packages: docker, kind, kubectl, kustomize

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-18 13:07:58 +03:00
Stefan Prodan
044bc64ad9 Merge pull request #1528 from NissesSenap/bug/arc-sync
Remove resourceNames in integration secrets
2021-06-18 10:25:22 +03:00
Edvin N
091f439498 Merge branch 'main' into bug/arc-sync 2021-06-18 08:47:58 +02:00
Stefan Prodan
a17b0a1ce0 Merge pull request #1535 from fluxcd/update-components
Update source-controller to v0.15.0
2021-06-17 20:29:52 +03:00
fluxcdbot
354cd5e177 Update toolkit components
- source-controller to v0.15.0
  https://github.com/fluxcd/source-controller/blob/v0.15.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-17 17:05:08 +00:00
Stefan Prodan
4e8f1221f7 Merge pull request #1534 from fluxcd/skip-deploy-key-prompt
Allow disabling the deploy key prompt for bootstrap git
2021-06-17 16:49:00 +03:00
Stefan Prodan
6b179aa7d9 Allow disabling the deploy key prompt for bootstrap git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-17 15:20:49 +03:00
Edvin Norling
f748114dfa Remove resourceNames in integration secrets
* Solves #1524
* We remove resourceName due to the following:
  Note: You cannot restrict create or deletecollection requests by resourceName.
  For create, this limitation is because the object name is not known at authorization time.
* Fix typo in azure-registry cronjob
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2021-06-16 14:45:30 +02:00
Stefan Prodan
5de83f015a Merge pull request #1519 from fluxcd/kustomize-v4
Update to Kustomize v4
2021-06-15 11:40:49 +03:00
Stefan Prodan
a6620e478a Update to Kustomize v4
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-15 11:25:57 +03:00
Stefan Prodan
c7fcffdd8e Merge pull request #1490 from fluxcd/update-components
Update toolkit components
2021-06-14 18:22:15 +03:00
fluxcdbot
160f59a984 Update toolkit components
- helm-controller to v0.11.0
  https://github.com/fluxcd/helm-controller/blob/v0.11.0/CHANGELOG.md
- kustomize-controller to v0.13.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.13.0/CHANGELOG.md
- source-controller to v0.14.0
  https://github.com/fluxcd/source-controller/blob/v0.14.0/CHANGELOG.md
- notification-controller to v0.15.0
  https://github.com/fluxcd/notification-controller/blob/v0.15.0/CHANGELOG.md
- image-reflector-controller to v0.10.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.10.0/CHANGELOG.md
- image-automation-controller to v0.12.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.12.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-14 15:02:31 +00:00
Stefan Prodan
d38d487c2a Merge pull request #1505 from fluxcd/fix-yq-example
Fix yq example for create secret git
2021-06-11 14:00:44 +03:00
Stefan Prodan
db28907543 Fix yq example for create secret git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-11 12:58:46 +03:00
Stefan Prodan
c4261399b5 Merge pull request #1472 from fluxcd/go-git-v5.4.2
Update go-git to v5.4.2
2021-06-02 20:58:39 +03:00
Stefan Prodan
b4edb46269 Update go-git to v5.4.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-02 20:20:02 +03:00
Stefan Prodan
a20ed0e630 Merge pull request #1471 from fluxcd/update-components
Update toolkit components
2021-06-02 20:17:46 +03:00
fluxcdbot
cea869e285 Update toolkit components
- kustomize-controller to v0.12.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.12.2/CHANGELOG.md
- source-controller to v0.13.2
  https://github.com/fluxcd/source-controller/blob/v0.13.2/CHANGELOG.md
- image-automation-controller to v0.11.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.11.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-06-02 16:46:24 +00:00
Stefan Prodan
e12db14d1e Merge pull request #1469 from stealthybox/integrations-fixes
Fix and Refactor integrations
2021-06-02 18:38:47 +03:00
leigh capili
296bf3cc6c Fix eventhub integration config patches
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:02 -06:00
leigh capili
1789aa180d Remove unused kustomizeconfigs from integrations
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:02 -06:00
leigh capili
bd255800db Template AzureIdentityBinding using $(AZ_IDENTITY_NAME) for integrations
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:02 -06:00
leigh capili
1355962b3c Fix GCP integration container image
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:01 -06:00
leigh capili
bb0114e379 Remove per-cloud /kbin/kubectl patches
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:01 -06:00
leigh capili
f9622a5b9e Add /kbin/kubectl to _base integrations
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:01 -06:00
leigh capili
3a74fcd75c Add Makefile to test integrations
Signed-off-by: leigh capili <leigh@null.net>
2021-06-01 14:42:00 -06:00
Stefan Prodan
7265276cc2 Merge pull request #1454 from fluxcd/gofish
Add GoFish as an install option for Flux CLI
2021-05-28 13:08:47 +03:00
Stefan Prodan
b98027b528 Add GoFish as an install option for Flux CLI
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-28 12:57:02 +03:00
Stefan Prodan
b6ae7d2cdd Merge pull request #1453 from fluxcd/update-components
Update source-controller to v0.13.1
2021-05-28 12:49:09 +03:00
fluxcdbot
aa887c61c3 Update toolkit components
- source-controller to v0.13.1
  https://github.com/fluxcd/source-controller/blob/v0.13.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-28 09:30:21 +00:00
Hidde Beydals
700cef0989 Merge pull request #1349 from fluxcd/fix-throttling
Avoid throttling when some Flux CRDs are not registered
2021-05-26 17:42:22 +02:00
Stefan Prodan
3ed3e553e7 Avoid throttling when some Flux CRDs are not registered
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-26 18:29:04 +03:00
Hidde Beydals
d68158ddc9 Merge pull request #1408 from fluxcd/update-components
Update toolkit components
2021-05-26 17:06:31 +02:00
fluxcdbot
9f83a69242 Update toolkit components
- kustomize-controller to v0.12.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.12.1/CHANGELOG.md
- source-controller to v0.13.0
  https://github.com/fluxcd/source-controller/blob/v0.13.0/CHANGELOG.md
- notification-controller to v0.14.1
  https://github.com/fluxcd/notification-controller/blob/v0.14.1/CHANGELOG.md
- image-automation-controller to v0.10.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.10.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-26 14:53:26 +00:00
Hidde Beydals
bf69dbd43d Merge pull request #1449 from fluxcd/update-go-git
Update go-git to v5.4.1
2021-05-26 16:15:36 +02:00
Hidde Beydals
465ea5ccfd Update go-git to v5.4.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-05-26 15:56:50 +02:00
Stefan Prodan
92ef39e2ad Merge pull request #1411 from NissesSenap/feature/azure-eventhub
Add example manifests for Azure eventhub credentials renewal
2021-05-25 16:35:12 +03:00
Edvin Norling
0404790df9 How to automatically renew Azure eventhub
To use JWT to communicate with Azure eventhub we need to renew the JWT credentials
from time to time. This example yaml helps out with that
* Supports both deployment and cronjob based renewal
  * static service principal
  * aad-pod-identity in azure

Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2021-05-25 13:43:18 +02:00
Stefan Prodan
f880e93df4 Merge pull request #1415 from allymparker/main
Fix service account name in registry-credentials-sync deployment kustomization
2021-05-14 20:06:59 +03:00
Ally Parker
4697b1101d Fix service account
Signed-off-by: Ally Parker <ally.parker@red-gate.com>
2021-05-14 16:40:30 +01:00
Stefan Prodan
50ff2accd2 Merge pull request #1412 from fluxcd/enable-crd-upgrades
Enable CRDs upgrade for kube-prometheus-stack
2021-05-12 19:06:49 +03:00
Stefan Prodan
c7d876eb8f Enable CRDs upgrade for kube-prometheus-stack
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-12 18:40:00 +03:00
Stefan Prodan
eda392dfcd Merge pull request #1399 from SomtochiAma/kube-prometheus
Replace monitoring stack with kube-prometheus-stack
2021-05-12 09:21:34 +03:00
Somtochi Onyekwere
3b91e14f6d Use kube-prometheus-stack for monitoring
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-05-12 06:53:21 +01:00
Hidde Beydals
17e3c57d7e Merge pull request #1405 from fluxcd/update-components
Update toolkit components
2021-05-10 18:10:50 +02:00
fluxcdbot
1c744a0f97 Update toolkit components
- helm-controller to v0.10.1
  https://github.com/fluxcd/helm-controller/blob/v0.10.1/CHANGELOG.md
- source-controller to v0.12.2
  https://github.com/fluxcd/source-controller/blob/v0.12.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-10 15:58:12 +00:00
Hidde Beydals
99bdb20aeb Merge pull request #1404 from fluxcd/private-key-password 2021-05-10 16:02:06 +02:00
Hidde Beydals
fbe7050cb8 Switch to crypto/ssh for parsing of private keys
This changes the logic for the parsing of private keys, as already
done for the source-controller, so that it is able to recognize and
work with a wider range of key formats instead of returning a vague
error:

```console
$ flux bootstrap git [..]
✗ ssh: this private key is passphrase protected
```

A patch for this was already submitted and merged in `go-git/go-git`,
but is not made available in a release yet:
https://github.com/go-git/go-git/pull/298

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-05-10 15:30:25 +02:00
Hidde Beydals
12ea028aa9 Merge pull request #1379 from tjakobsson/fix-git-bootstrap-hostname
Use proper Host configuration for SSH
2021-05-10 15:23:59 +02:00
Tobias Jakobsson
ea62cb5fc9 Use proper Host configuration for SSH
This removes the usage of Hostname() which does not honor configured SSH
port to be used.

Resolves: #1377
See also: #1101, #1102

Signed-off-by: Tobias Jakobsson <jakobsson.tobias@gmail.com>
2021-05-10 15:04:09 +02:00
Stefan Prodan
d27c2164b2 Merge pull request #1394 from fluxcd/update-components
Update image-automation-controller to v0.9.1
2021-05-06 17:27:23 +03:00
fluxcdbot
ef8f5cb87d Update toolkit components
- image-automation-controller to v0.9.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-06 14:15:14 +00:00
Stefan Prodan
378a2c2a0e Merge pull request #1393 from fluxcd/git-ref-required
Make the Git ref required
2021-05-06 16:30:16 +03:00
Stefan Prodan
2597ad0f73 Make the Git ref required
Remove the default branch value from `flux create source git` and validate that one of the ref options are specified.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-06 15:28:55 +03:00
Stefan Prodan
0df34bed59 Merge pull request #1391 from SomtochiAma/grafana-dash
Update Prometheus labels and dashboard
2021-05-06 15:05:49 +03:00
Somtochi Onyekwere
be65cf8052 Change labels in prometheus and grafana dashboard
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-05-06 12:33:41 +01:00
Stefan Prodan
8922753591 Merge pull request #1390 from Callisto13/string-slice-var
Switch StringArrayVar flags to use StringSliceVar
2021-05-06 14:27:51 +03:00
Claudia Beresford
87e11ed653 Switch StringArrayVar flags to use StringSliceVar
StringSliceVar allows for more flexibility when passing vars to list
flags.
Both formats will be supported:
- '--foo=one --foo=two'
- '--foo=one,two'

Signed-off-by: Claudia Beresford <claudiaberesford@gmail.com>
2021-05-06 10:09:36 +01:00
Stefan Prodan
ab34771b3d Merge pull request #1384 from fluxcd/go-git-providers-v0.1.0
Update go-git-providers to v0.1
2021-05-06 11:31:00 +03:00
Stefan Prodan
e733c4f55a Update go-git-providers to v0.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-06 11:03:52 +03:00
Daniel Holbach
37b60666c4 Merge pull request #1389 from dholbach/fix-1388
Remove ' command' from Flux CLI docs title
2021-05-06 10:00:56 +02:00
Daniel Holbach
734d736bdf Remove ' command' from Flux CLI docs title
Fixes: #1388

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-05-06 08:52:36 +02:00
Daniel Holbach
8ca65059f7 Merge pull request #1381 from dholbach/toolkit-website-followup
Update more toolkit.fluxcd.io redirects
2021-05-04 22:16:41 +02:00
Daniel Holbach
086f174463 Update more toolkit.fluxcd.io redirects
Following up on #1380 some more docs links which
	now live under fluxcd.io itself.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-05-04 17:04:44 +02:00
Daniel Holbach
48fd70fc09 Merge pull request #1380 from fluxcd/fix-links
Migrate the GitOps toolkit links to the new docs website
2021-05-04 16:59:09 +02:00
Stefan Prodan
606266e976 Migrate the GitOps toolkit links to the new docs website
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-04 17:46:25 +03:00
Stefan Prodan
f7006a8172 Merge pull request #1369 from fluxcd/update-components
Update toolkit components
2021-04-29 15:05:43 +03:00
fluxcdbot
653dcc8d78 Update toolkit components
- kustomize-controller to v0.12.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.12.0/CHANGELOG.md
- image-reflector-controller to v0.9.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-29 10:07:39 +00:00
Stefan Prodan
8df140c713 Merge pull request #1365 from dholbach/fix-1221
Remove content which has moved to f/website
2021-04-29 10:24:01 +03:00
Daniel Holbach
089af9cc90 remove docs/index.md as well - it has been pulled into f/website now too
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 17:18:00 +02:00
Daniel Holbach
695fb55b13 Remove Flux CLI docs
They are imported into the docs like so:
	https://github.com/fluxcd/website/blob/main/hack/import-flux2-assets.sh#L139

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 12:10:48 +02:00
Daniel Holbach
ec21eedd56 remove content which has moved to f/website
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 12:07:34 +02:00
Stefan Prodan
5ba3774fd5 Merge pull request #1358 from SomtochiAma/suspend-all
Add suspend/resume  --all cmd
2021-04-28 12:58:46 +03:00
Somtochi Onyekwere
12a2100fcf Adds suspend and resume all cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-28 10:44:51 +01:00
Daniel Holbach
68074d3543 Merge pull request #1364 from dholbach/update-install-url
Update install script URL
2021-04-27 16:40:33 +02:00
Daniel Holbach
18849e36c7 Update install script URL
As we don't pass '-L' to curl, the redirect is
	not followed.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 16:26:06 +02:00
Hidde Beydals
671fe274da Merge pull request #1363 from dholbach/explain-docs
Explain where the docs went
2021-04-27 15:28:21 +02:00
Daniel Holbach
af1d9102b9 explain where docs are
keep netlify config for now (disabled in the app), but only make it ship the _redirects file
add rule for 'install.sh'
move _redirects file into docs/ directory
document redirects and Netlify

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 15:16:30 +02:00
Daniel Holbach
9dc10ef7d1 Merge pull request #1361 from dholbach/fix-1135
Stop deploy to Github pages
2021-04-27 14:32:57 +02:00
Daniel Holbach
86a3cf20e7 Stop deploying to Github pages
Fixes: #1135

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 14:20:28 +02:00
Daniel Holbach
27a42ecd8e Merge pull request #1360 from dholbach/add-redirects
add redirects file
2021-04-27 14:19:17 +02:00
Daniel Holbach
ae7a59fbb4 try out redirects file
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 13:55:16 +02:00
Hidde Beydals
598dfc32e8 Merge pull request #1359 from dholbach/add-components-docs-script
Copy docs assets for Netlify build
2021-04-27 11:36:31 +02:00
Daniel Holbach
a40d124e23 add script to copy docs assets for Netlify build
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 11:22:55 +02:00
Daniel Holbach
9df3fcab18 Merge pull request #1353 from dholbach/netlify-build
Specify netlify build
2021-04-27 11:09:33 +02:00
Daniel Holbach
b6ce969d1b Specify netlify build
Addresses: #1135

	Follow https://www.starfallprojects.co.uk/posts/deploy-mkdocs-netlify/
	to eventually fix #1135.

	I realise this litters the main directory somewhat, but I hope
	that once the publication fully works and we turn the site into
	redirects, we can remove these files again. So only a temporary
	measure.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 09:16:06 +02:00
Stefan Prodan
6a37649ee6 Merge pull request #1352 from SomtochiAma/handle-error
Remove redundant getCommand for image repository
2021-04-26 17:50:56 +03:00
Somtochi Onyekwere
8926095660 remove redundant getCommand for image repository
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-26 15:28:51 +01:00
Hidde Beydals
bd34870334 Merge pull request #1336 from fluxcd/update-components 2021-04-23 12:51:40 +02:00
Hidde Beydals
a56ce1f867 build: tidy after go mod edit
To ensure the `go.sum` is always up-to-date when the following `go mod
edit` is executed.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-23 12:36:09 +02:00
fluxcdbot
dab5bbd393 Update toolkit components
- source-controller to v0.12.1
  https://github.com/fluxcd/source-controller/blob/v0.12.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-23 12:34:41 +02:00
Stefan Prodan
15ebfd7eb6 Merge pull request #1334 from fluxcd/helm-CRDsPolicy
Add upgrade CRDs policy arg to create helmrelease cmd
2021-04-23 12:29:24 +03:00
Stefan Prodan
5ab8dd2557 Add upgrade CRDs policy to create helmrelease cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-23 10:46:46 +03:00
Stefan Prodan
9164914d16 Merge pull request #1215 from Frederik-Baetens/main
update sortable image tag guide with github.run_number
2021-04-23 09:25:20 +03:00
Frederik Baetens
c9e0bc0807 add github.run number github actions workflow example
Signed-off-by: Frederik Baetens <baetens.fr@gmail.com>
2021-04-22 22:27:46 +02:00
Frederik Baetens
61439adf9b describe github.run number as a reliable increasing build number
Signed-off-by: Frederik Baetens <baetens.fr@gmail.com>
2021-04-22 22:27:46 +02:00
Hidde Beydals
e4d7450643 Merge pull request #1332 from fluxcd/update-guide-v1alpha2
Update image automation guides to v1alpha2
2021-04-22 19:54:25 +02:00
Stefan Prodan
0fbcfded57 Update image automation migration guide to v1alpha2 APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 20:40:24 +03:00
Stefan Prodan
fb3a434f95 Update image automation guide to v1alpha2 APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 20:40:17 +03:00
Hidde Beydals
4f66da84d6 Merge pull request #1208 from defenestration/main
fix link to Mozilla SOPS Azure Guide
2021-04-22 19:38:51 +02:00
Alan B
b67e8aafab Fix Mozilla SOPS link in Azure guide
Signed-off-by: Alan B <a.brevick@techsmith.com>
2021-04-22 19:21:26 +02:00
Hidde Beydals
0b4f1d30a6 Merge pull request #1314 from SomtochiAma/ssh-key-with-password
Add password for ssh private key to create secret git
2021-04-22 19:17:33 +02:00
Somtochi Onyekwere
c494e6bf7e Inject password in create secret git if specified
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-22 18:33:41 +02:00
Hidde Beydals
b8c57c7901 Merge pull request #1300 from fluxcd/kustomize-bootstrap
Allow pre-bootstrap customisation of Flux components
2021-04-22 17:33:57 +02:00
Hidde Beydals
6aed4631e7 Register v1alpha2 APIs in runtime Scheme
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 17:10:42 +02:00
Stefan Prodan
5df9118365 Add pre-bootstrap customisation to install docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 17:10:42 +02:00
Stefan Prodan
4a4af94d6c Allow pre-bootstrap customisation of Flux components
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 17:10:42 +02:00
Hidde Beydals
baa54fb84a Merge pull request #1330 from fluxcd/patch-update-workflow
Fix update automation and update CRDs
2021-04-22 16:48:35 +02:00
Hidde Beydals
cb6470f817 Merge pull request #1328 from fluxcd/bootstrap-team-prnt-fix
Change permission grant error print conditons
2021-04-22 16:25:26 +02:00
Hidde Beydals
1a904e138f Fix update automation and update CRDs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 16:24:36 +02:00
Hidde Beydals
3b482529ff Merge pull request #1323 from fluxcd/update-apis
Update the APIs docs
2021-04-22 16:11:16 +02:00
Hidde Beydals
67997437db Change permission grant error print conditons
Based on observations in
https://github.com/fluxcd/flux2/runs/2410633975:

1. Print error correctly by switching from `%w` to `%s`
2. Only print the change messsage if there has not been an error.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 16:10:14 +02:00
Hidde Beydals
a5541eddca Merge pull request #1327 from fluxcd/update-components
Update toolkit components
2021-04-22 15:57:00 +02:00
Stefan Prodan
203157e525 Update the APIs docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 15:56:49 +02:00
fluxcdbot
655c2261ba Update toolkit components
- helm-controller to v0.10.0
  https://github.com/fluxcd/helm-controller/blob/v0.10.0/CHANGELOG.md
- kustomize-controller to v0.11.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.11.1/CHANGELOG.md
- source-controller to v0.12.0
  https://github.com/fluxcd/source-controller/blob/v0.12.0/CHANGELOG.md
- notification-controller to v0.13.0
  https://github.com/fluxcd/notification-controller/blob/v0.13.0/CHANGELOG.md
- image-reflector-controller to v0.9.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.0/CHANGELOG.md
- image-automation-controller to v0.9.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-22 15:42:12 +02:00
Hidde Beydals
45e446eb00 Merge pull request #1325 from fluxcd/build/include-crd-update
build: incl CRD version change in component update
2021-04-22 15:34:52 +02:00
Hidde Beydals
68abe37648 Merge pull request #1200 from kingdonb/jsonnet 2021-04-22 15:22:26 +02:00
Hidde Beydals
df6a0a3762 build: incl CRD version change in component update
This includes updating the version in the `manifests/crds` directory
for the component thas has a newer latest version.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 15:21:24 +02:00
Kingdon Barrett
c35bae577f Add (vestigial) reference to configMap.yaml
This part of the jsonnet example was missing a reference and needed a
bit more explanation to accompany the missing reference.

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
3567941eda flux recommends real version numbers*
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
3c95fe6380 change one word
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
d07f0d003c add word or two
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
86774309db minor formatting/verbal fixes
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
427f23e32d add missing link to 04-update-fleet-infra
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
70cddde16c Jsonnet examples
It is probably not elegant or idiomatic jsonnet. I am learning Jsonnet.

I believe the explanation is correct, but I still have to retry this
example for repeatability and check for completeness.

* Jsonnet example - gutted

* take some personalize things away
* clean up awkward sentence
* for real gitops

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:05 +02:00
Hidde Beydals
e86789b643 Merge pull request #1255 from scottrigby/use-cases-helm 2021-04-22 14:52:56 +02:00
Scott Rigby
f52fec66bd Overriding helm values, managing secrets and configmaps with kustomize plus SOPS, semver range policies, and auto uninstalls and rollbacks
Signed-off-by: Scott Rigby <scott@r6by.com>
2021-04-22 14:19:39 +02:00
Scott Rigby
f4926d1e45 Operator->Controller
Signed-off-by: Scott Rigby <scott@r6by.com>

Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 14:19:39 +02:00
Scott Rigby
2774c1a5cd Add helm use case intro page
Signed-off-by: Scott Rigby <scott@r6by.com>
2021-04-22 14:19:39 +02:00
Hidde Beydals
8274bc0ea3 Merge pull request #1324 from fluxcd/image-update-v1alpha2
Move to `v1alpha2` image update APIs
2021-04-22 14:11:47 +02:00
Stefan Prodan
e9531e4d57 Merge pull request #1296 from arbourd/values-files
Add `ValuesFiles` documentation
2021-04-22 14:52:47 +03:00
Hidde Beydals
3a8aad7e5c Move to v1alpha2 image update APIs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 13:52:03 +02:00
Dylan Arbour
ef079c5b58 Add ValuesFiles documentation
Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-04-22 13:34:19 +02:00
Hidde Beydals
50332aa2ee Merge pull request #1310 from fluxcd/update-components
Update toolkit components
2021-04-22 13:18:08 +02:00
fluxcdbot
b47f3a57dc Update toolkit components
- helm-controller to v0.10.0
  https://github.com/fluxcd/helm-controller/blob/v0.10.0/CHANGELOG.md
- kustomize-controller to v0.11.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.11.1/CHANGELOG.md
- source-controller to v0.12.0
  https://github.com/fluxcd/source-controller/blob/v0.12.0/CHANGELOG.md
- notification-controller to v0.13.0
  https://github.com/fluxcd/notification-controller/blob/v0.13.0/CHANGELOG.md
- image-reflector-controller to v0.9.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.0/CHANGELOG.md
- image-automation-controller to v0.9.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-22 09:49:12 +00:00
Stefan Prodan
9a928744cc Merge pull request #1264 from SomtochiAma/ssh-key-with-password
Add support for password protected SSH keys to bootstrap
2021-04-21 19:39:10 +03:00
Somtochi Onyekwere
328d403507 Set password in secret
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-21 17:21:07 +01:00
Stefan Prodan
76ffd76bd3 Merge pull request #1287 from SomtochiAma/get-all-cmd
Add get all command
2021-04-21 18:39:47 +03:00
Somtochi Onyekwere
951589e652 Add get all command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-21 15:45:38 +01:00
Hidde Beydals
7bb0704401 Merge pull request #1308 from fluxcd/windows-path-boot-git
Use slash target path in Git bootstrap sync opts
2021-04-21 12:08:52 +02:00
Hidde Beydals
3aa45e72e7 Use slash target path in Git bootstrap sync opts
As otherwise (comparisons to) cluster configuration will fail due to
Separator differences. Was already fixed for provider implementations.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-21 11:48:36 +02:00
Hidde Beydals
67691e92e3 Merge pull request #1307 from fluxcd/boot-drop-org-repo-autoinit
Drop AutoInit from Org repository create
2021-04-21 11:44:17 +02:00
Hidde Beydals
43388ec67b Drop AutoInit from Org repository create
Pushing the first branch is sufficient to set a default, and the
`README.md` (and/or LICENSE) can better be pushed later on so commit
author and templates be configured.

This was already done for User in an earlier patch release.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-21 11:24:59 +02:00
Stefan Prodan
2fe3934491 Merge pull request #1280 from kaizentm/main
Keep network policy order as defined
2021-04-20 10:13:30 +03:00
Eugene
f60ba95b4c Keep policy order as defined
Signed-off-by: Eugene <eugene.fedor@gmail.com>
2021-04-19 13:21:32 -07:00
Hidde Beydals
4ecf541748 Merge pull request #1291 from jlengelsen/bug-install-script-binary-ownership
Fix ownership issue in bash install script
2021-04-19 15:01:25 +02:00
Julian Lengelsen
7994829765 Fix ownership issue in bash install script
When using tar with sudo the extracted files will retain the ownership
of the files in the archive. When using the bash install script the flux
binary is owned by user ID 1001 and group docker after installation.

This commit fixes the ownership by appending the -o option to the tar
command which will extract files with the correct ownership, namely user
root and group root.

Signed-off-by: Julian Lengelsen <julian.lengelsen@th-koeln.de>
2021-04-18 13:30:09 +02:00
Hidde Beydals
ce14951436 Merge pull request #1288 from sa-spag/doc 2021-04-16 16:35:30 +02:00
Alexis Gauthiez
a5ce8221a3 Suggest an alternative gradual migration technique
Signed-off-by: Alexis Gauthiez <alexis.gauthiez@blablacar.com>
2021-04-16 14:45:50 +02:00
Alexis Gauthiez
e6344ef18e Fix documentation typo
Signed-off-by: Alexis Gauthiez <alexis.gauthiez@blablacar.com>
2021-04-16 14:45:50 +02:00
Stefan Prodan
99e60634ad Merge pull request #1285 from SomtochiAma/reconcile-diff-ns
Ensure kustomization/helmrelease is reconciled when source is in a different namespace
2021-04-16 11:25:03 +03:00
Somtochi Onyekwere
6c656b7366 Fix reconcile with source in a different namespace
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-16 08:53:30 +01:00
Stefan Prodan
fc3a09b5ad Merge pull request #1278 from alisondy/create-alert-es-ns
Change createAlertCmdRun parsing to include namespace
2021-04-16 08:50:26 +03:00
Alison Dowdney
b1484f2f24 Change createAlertCmdRun parsing to include namespace
Signed-off-by: Alison Dowdney <alison@alisondowdney.com>
2021-04-15 22:52:15 +01:00
Hidde Beydals
7dcf884e38 Merge pull request #1262 from fluxcd/reconcile-opt
Put potentially destructive reconcile behind flag
2021-04-13 17:38:35 +02:00
Hidde Beydals
b6d349da8c Put potentially destructive reconcile behind flag
The behavior introduced during the introduction of go-git-providers
was more strict, and has proven pretty quickly to not be useful to
all users. Therefore, the reconciliation behavior for repository
configuration has been put behind an opt-in flag, so that it does
not overwrite people their configs by accident.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-13 17:19:19 +02:00
Stefan Prodan
40ce3d50c2 Merge pull request #1256 from fluxcd/openapi2jsonschema
Publish OpenAPI schemas for Flux CRDs
2021-04-13 15:17:38 +03:00
Stefan Prodan
68046067c5 Generate OpenAPI schema in CI
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-13 13:17:36 +03:00
Stefan Prodan
e3b12a8a24 Merge pull request #1253 from fluxcd/btstrp-private-flag
Change private flag description
2021-04-13 09:26:29 +03:00
Hidde Beydals
f123b9d3cb Change private flag description
To highlight the fact that it configures the repository as defined,
which was not _really_ clear to some users and has resulted in public
repositories accidentally being changed to private (losing important
goodies like stars and linked forks).

Discussion on this is ongoing and there will likely be other
improvements in the near future to protect users against this.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-12 13:19:46 +02:00
Hidde Beydals
f4ce89ae26 Merge pull request #1242 from fluxcd/bootstrap-health-tweaks
Always report components health in bootstrap
2021-04-09 16:21:37 +02:00
Hidde Beydals
ea451e7e49 Always report components health in bootstrap
This is useful in case the `Kustomization` does not reconcile
successfully because for example the controller(s) are in a crash loop,
which is not visible in the resource itself.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 15:20:04 +02:00
Hidde Beydals
d434575047 Merge pull request #1240 from fluxcd/to-slash-to-rescue 2021-04-09 11:09:37 +02:00
Hidde Beydals
e627634184 Detect suspended Kustomization in bootstrap
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:53:00 +02:00
Hidde Beydals
e0dd12505f Normalize paths to forward slashes
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:52:59 +02:00
Hidde Beydals
5a67f94380 Merge pull request #1241 from fluxcd/private-key-bug
Correctly load private key by not decoding PEM twice
2021-04-09 10:37:30 +02:00
Hidde Beydals
5f9dd7a5a5 Correctly load private key by not decoding PEM 2x
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:05:45 +02:00
Stefan Prodan
bce0da2806 Merge pull request #1226 from fluxcd/bootstrap-git-docs
Revamp bootstrap documentation
2021-04-08 15:23:42 +03:00
Stefan Prodan
a58c40f2d7 Add note about providing a SSH key to bootstrap
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 14:06:42 +03:00
Stefan Prodan
65d5cadf29 Update the alert providers list in notifications guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 13:31:21 +03:00
Stefan Prodan
1ea5d4d2e3 Remove sourceignore from SOPS guide
No longer needed due to https://github.com/fluxcd/source-controller/pull/329

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 13:31:16 +03:00
Stefan Prodan
719ef3c44c Add flux CLI container image to docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 13:31:16 +03:00
Stefan Prodan
f4adfc3029 Add bootstrap git to install docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 13:31:16 +03:00
Stefan Prodan
d8d08091cc Move Azure DevOps bootstrap to Azure docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 13:31:15 +03:00
Stefan Prodan
de4b3ef3dc Merge pull request #1231 from fluxcd/git-custom-pk
Take private key from file into account in Git bootstrap
2021-04-08 13:30:51 +03:00
Hidde Beydals
7bd6aedb73 Take PK from file into account in Git bootstrap
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-08 12:06:33 +02:00
Stefan Prodan
fffe40fbd4 Merge pull request #1222 from fluxcd/fix-git-http
Fix create source git auth for non-HTTPS repos
2021-04-08 11:11:03 +03:00
Stefan Prodan
74feda73af Add Warningf to logger interface amd impl
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 10:48:27 +03:00
Stefan Prodan
8b5583930e Fix create source git auth for non-HTTPS repos
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-08 10:29:23 +03:00
Hidde Beydals
466fdae70e Merge pull request #1225 from SomtochiAma/refactor-last-cmd
Format go imports in cmd/flux
2021-04-07 18:05:30 +02:00
Somtochi Onyekwere
054a62fb30 Format go imports
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-07 16:40:16 +01:00
Hidde Beydals
c694b570e0 Merge pull request #1224 from SomtochiAma/refactor-last-cmd
Refactor reconcile and resume cmd for alert and receiver
2021-04-07 15:02:22 +02:00
Somtochi Onyekwere
4204ec1d43 Refactor reconcile and resume cmd for alert and receiver
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-07 13:35:12 +01:00
Stefan Prodan
6d4e37ccb2 Merge pull request #1223 from fluxcd/cii-badge
Add CII Best Practices badge
2021-04-07 14:39:05 +03:00
Stefan Prodan
eef06c993e Add CII Best Practices badge
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-07 14:13:23 +03:00
Stefan Prodan
58362fbbb9 Merge pull request #1191 from fluxcd/recurse-submodules
Add recurse submodules arg to create source git and bootstrap cmd
2021-04-07 13:12:05 +03:00
Stefan Prodan
b872e595ae Add recurse submodules arg to bootstrap cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-07 12:56:51 +03:00
Stefan Prodan
18c3f79319 Add recurse submodules arg to create source git cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-07 12:01:25 +03:00
Stefan Prodan
8f0cd35d7a Allow self-signed certs when using go-git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-07 12:00:48 +03:00
Stefan Prodan
c8bcf19f32 Merge pull request #1194 from fluxcd/update-components
Update toolkit components
2021-04-07 11:53:33 +03:00
fluxcdbot
5bee3047ac Update toolkit components
- kustomize-controller to v0.11.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.11.0/CHANGELOG.md
- notification-controller to v0.12.0
  https://github.com/fluxcd/notification-controller/blob/v0.12.0/CHANGELOG.md
- image-reflector-controller to v0.8.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.8.0/CHANGELOG.md
- image-automation-controller to v0.8.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.8.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-07 08:41:09 +00:00
Hidde Beydals
0d2f6bf02d Merge pull request #968 from fluxcd/go-git-providers-bootstrap 2021-04-07 10:40:30 +02:00
Hidde Beydals
7481c6beb0 Retry reconcile and clone actions once
We have observed that the code at times outperforms GitHub mechanics,
resulting in not found errors that are only true for a millisecond.
Retrying those actions once with a 2 second delay should be more
friendly to users.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
4ece12348b Ignore broken symlinks and outside path, in commit
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
e65a5beaae Work around custom client domain issue
With this commit comes a lot of evil.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
ef576128e3 Use correct hostname argument for secret gen
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
7f0bc2ada2 Provide option to add appendix to commit messages
Using the `--commit-message-appendix` flag a string can be added to the
commit messages made by the bootstrapper process to for example skip CI
actions from executing using e.g. `[skip ci]`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
96c373d045 Properly configure sync URL based on auth settings
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
22648cae3b Add command to bootstrap to generic Git server
This command makes it possible to bootstrap to a generic Git server
using the local SSH agent, or a given password or private key file.

If a private key is generated, the user is prompted to give the
generated key access to the repository.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
f57ce14754 Implement bootstrap package in commands
This includes making a lot of things configurable (e.g. SSH key
algorithm, RSA bit size, etc.) that used to be static.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
1d3a381389 Test giving access to team in bootstrap e2e
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
9055e753a9 Add app.kubernetes.io/part-of: flux label
To be used in a future version of Flux to better select Flux components
in a namespace, as the namespace value for the
`app.kubernetes.io/instance` could be used by non Flux related
workloads.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
6390812cbb Factor bootstrap logic into bootstrap package
This commit factors out the bootstrap logic into a new `bootstrap`
package, while also moving to `go-git-providers` to handle things
around Git providers (e.g. repository creation, deploy key
upsertions).

The `GitProviderBootstrapper` is a superset of the
`PlainGitBootstrapper` that besides `Reconciler` also implements the
`RepositoryReconciler`.

The Git actions rely on an interface, making it easier to support
other implementations than `go-git` at a later moment, to for example
support bootstrapping to Git servers that only support the v2 protocol.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-07 10:24:08 +02:00
Hidde Beydals
fa46f05423 Merge pull request #1219 from frankgu968/main
fix: install command flags logic bug
2021-04-06 17:13:06 +02:00
Frank Gu
6b0ffe0b13 fix: install command flags logic bug
Signed-off-by: Frank Gu <frank.gu968@outlook.com>
2021-04-06 07:57:36 -07:00
Stefan Prodan
e724d90202 Merge pull request #1190 from fluxcd/update-components
Update source-controller to v0.11.0
2021-04-01 09:22:42 +03:00
fluxcdbot
6129943685 Update toolkit components
- source-controller to v0.11.0
  https://github.com/fluxcd/source-controller/blob/v0.11.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-03-31 17:38:37 +00:00
Hidde Beydals
d4e37cbda5 Merge pull request #1179 from hiddeco/docker-images
Publish AMD64, ARM64, ARMv7 images for binary
2021-03-30 12:02:06 +02:00
Hidde Beydals
cccfb3a560 Merge pull request #1176 from kaaboaye/patch-2
Fix reocncile typo
2021-03-30 11:23:17 +02:00
Hidde Beydals
d0403038ed Enable QEMU and Docker Buildx in release action
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-30 11:22:31 +02:00
Hidde Beydals
a5a7d7970f Publish AMD64, ARM64, ARMv7 images for binary
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-30 11:22:31 +02:00
Mieszko Wawrzyniak
62b9377f15 Fix reocncile typo
Signed-off-by: kaaboaye <kaaboaye@gmail.com>
2021-03-30 10:20:37 +02:00
Stefan Prodan
ec2c71f9ef Merge pull request #1173 from fluxcd/source-namespace
Add source namespace to create commands
2021-03-29 13:22:08 +03:00
Stefan Prodan
b54fd2c6b3 Add source namespace to create commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-29 11:42:04 +03:00
Stefan Prodan
e5066c3712 Merge pull request #1171 from Legion2/patch-1
Updated automation migration guide filter tags crd
2021-03-29 10:25:22 +03:00
Leon Kiefer
fd1c038303 Updated automation migration guide filter tags crd
Signed-off-by: Leon Kiefer <leon.k97@gmx.de>
2021-03-28 21:09:10 +02:00
Hidde Beydals
64e7a857b8 Merge pull request #1164 from fluxcd/update-components
Update toolkit components
2021-03-26 16:55:26 +01:00
fluxcdbot
7da24932ab Update toolkit components
- helm-controller to v0.9.0
  https://github.com/fluxcd/helm-controller/blob/v0.9.0/CHANGELOG.md
- kustomize-controller to v0.10.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.10.0/CHANGELOG.md
- source-controller to v0.10.0
  https://github.com/fluxcd/source-controller/blob/v0.10.0/CHANGELOG.md
- notification-controller to v0.11.0
  https://github.com/fluxcd/notification-controller/blob/v0.11.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-03-26 15:41:29 +00:00
Daniel Holbach
1a2ea8407b Merge pull request #1163 from dholbach/fix-cmd-links
Fix cmd links
2021-03-26 16:40:59 +01:00
Daniel Holbach
32f94bab97 fix links
- change links in cli docs to be relative (making mkdocs AND hugo happy)
	- run 'make docs'
	- fix other links

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-03-26 16:28:33 +01:00
Hidde Beydals
dea4a67639 Merge pull request #1162 from fluxcd/tidy-cmd-docs
Tidy up command descriptions
2021-03-26 10:38:02 +01:00
Hidde Beydals
236ffd1767 Tidy up command descriptions
Rewordings and removal of superfluous newlines.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-26 10:20:42 +01:00
Hidde Beydals
1b2ffad2f1 Merge pull request #1157 from fluxcd/create-secret-source-git-pk
Allow supplying PK from file for Git source/secret
2021-03-26 10:02:23 +01:00
Hidde Beydals
4750d0d81c Allow supplying PK from file for Git source/secret
This commit adds support for supplying a path to an existing private
key file to both the `flux create secret git` and `flux create source
git` commands.

If a path is given, any private key generation configuration options
are ignored by the manifest generator. The SSH host will however still
be scanned for server keys.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-26 09:49:30 +01:00
Hidde Beydals
63a210a0b2 Merge pull request #1149 from SomtochiAma/refactor-cmd 2021-03-25 22:39:46 +01:00
Somtochi Onyekwere
465eaa24d3 Refactor all remaining create, delete, export, get command to use adapter
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-25 21:54:58 +01:00
Hidde Beydals
c23e8c7ee1 Merge pull request #1156 from Legion2/patch-1
Fix CRD deletion instruction in Helm Operator migration docs
2021-03-25 18:41:35 +01:00
Leon Kiefer
974f01cb46 fix crd deletion command in v2 migration docs
Signed-off-by: Leon Kiefer <leon.k97@gmx.de>
2021-03-25 18:27:33 +01:00
Stefan Prodan
16fa9b2753 Merge pull request #1150 from fluxcd/dev-guide-update
Update dev guide to controller-runtime v0.8
2021-03-24 15:15:20 +02:00
Stefan Prodan
9deab1c415 Update dev guide to controller-runtime v0.8
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-24 14:59:17 +02:00
Hidde Beydals
7c01eeb115 Merge pull request #1141 from fluxcd/cmd-docs-frontmatter
Add frontmatter to command documentation
2021-03-24 13:53:06 +01:00
Hidde Beydals
998f0c7d53 Add frontmatter to command documentation
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-24 13:31:14 +01:00
Hidde Beydals
bd41406aaa Merge pull request #1134 from kingdonb/fixup-azure-doc 2021-03-22 10:23:15 +01:00
Kingdon Barrett
f17801753d Fixup a broken reference and a typo in Azure doc
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-03-21 13:53:27 -04:00
Hidde Beydals
92891fd340 Merge pull request #1128 from jestallin/patch-1 2021-03-20 21:22:04 +01:00
Jim Stallings
aa122455f7 Remove branch switch for image update cmd in guide
Signed-off-by: James Stallings <jstallings@constantcontact.com>
2021-03-20 15:35:31 -04:00
Stefan Prodan
880e70c19c Merge pull request #1122 from fluxcd/aws-sops
Add AWS IAM role binding example to SOPS guide
2021-03-19 12:19:42 +02:00
Stefan Prodan
968f249562 Move GOTK diagram to docs/files
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-19 12:02:09 +02:00
Stefan Prodan
bb9f476be2 Fix typo in image automation guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-19 12:01:33 +02:00
Stefan Prodan
276f43fdeb Add AWS IAM role binding example to SOPS guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-19 12:01:01 +02:00
Stefan Prodan
150d1c2a5a Merge pull request #1064 from stealthybox/azure
Document Azure + Flux Installs
2021-03-19 10:47:37 +02:00
leigh capili
1bf3814701 Cleanup note sections
Signed-off-by: leigh capili <leigh@null.net>
2021-03-18 12:29:08 -06:00
leigh capili
166181c745 Add Azure Use-Case doc to new section
Signed-off-by: leigh capili <leigh@null.net>
2021-03-18 12:29:07 -06:00
leigh capili
bfff977d41 Improve Azure DevOps install notes
Signed-off-by: leigh capili <leigh@null.net>
2021-03-18 12:29:07 -06:00
leigh capili
787d755261 Document Flux + SOPS + Azure Key Vault (#851)
Signed-off-by: leigh capili <leigh@null.net>
2021-03-18 12:29:04 -06:00
Hidde Beydals
acf7173959 Merge pull request #1119 from anovateam/azure-acr-secret-reconcile-script 2021-03-18 18:35:21 +01:00
Marco Amador
e6132e36ba fix: revert azure patch and fix the order parameters in the function
Signed-off-by: Marco Amador <amador.marco@gmail.com>
2021-03-18 16:59:17 +00:00
Marco Amador
585b97c462 fix: parameter order
Signed-off-by: Marco Amador <amador.marco@gmail.com>
2021-03-18 15:01:58 +00:00
Stefan Prodan
3dfd0bc2e1 Merge pull request #1117 from fluxcd/update-image-auto-guide]
Add push branch and commit template to image automation guide
2021-03-18 15:52:01 +02:00
Stefan Prodan
10ff99542f Add image update automation diagram
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 14:20:01 +02:00
Stefan Prodan
2449030ab8 Add push branch and commit template to image automation guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 13:56:42 +02:00
Stefan Prodan
3e85901f40 Merge pull request #1116 from fluxcd/get-all-sources-images
Implement get all for sources and images
2021-03-18 13:30:52 +02:00
Stefan Prodan
73b1576f81 Implement get all for sources and images
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 13:00:49 +02:00
Stefan Prodan
cdb5b7c9a2 Merge pull request #1113 from fluxcd/create-image-update
Add repo path and push branch to image update cmd
2021-03-18 12:35:08 +02:00
Stefan Prodan
d9331b0c91 Add repo path and push branch to image update cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 11:10:21 +01:00
Stefan Prodan
b6a8163dd9 Add create image policy examples
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 11:10:21 +01:00
Stefan Prodan
185252ba48 Update flux logs examples
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 11:10:21 +01:00
Stefan Prodan
043d37921b Merge pull request #1091 from joebowbeer/patch-1
Fix deployment name in image update guide
2021-03-18 10:43:04 +02:00
Joe Bowbeer
02fb8d9958 Merge branch 'main' into patch-1 2021-03-17 14:29:42 -07:00
Stefan Prodan
cfa6c0a178 Merge pull request #1095 from fluxcd/update-components
Update toolkit components
2021-03-17 14:58:04 +02:00
fluxcdbot
e8b52bf2fc Update toolkit components
- helm-controller to v0.8.2
  https://github.com/fluxcd/helm-controller/blob/v0.8.2/CHANGELOG.md
- kustomize-controller to v0.9.3
  https://github.com/fluxcd/kustomize-controller/blob/v0.9.3/CHANGELOG.md
- source-controller to v0.9.1
  https://github.com/fluxcd/source-controller/blob/v0.9.1/CHANGELOG.md
- notification-controller to v0.10.0
  https://github.com/fluxcd/notification-controller/blob/v0.10.0/CHANGELOG.md
- image-reflector-controller to v0.7.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.7.1/CHANGELOG.md
- image-automation-controller to v0.7.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.7.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-03-17 12:45:22 +00:00
Joe Bowbeer
85fbb780bf Update image-update.md
The filename is podinfo-deployment.yaml

Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2021-03-16 18:58:38 -07:00
Hidde Beydals
bd9f9bf518 Merge pull request #1103 from fluxcd/build/fix-go-mod-update
Fix updating of `go.mod` entries for components
2021-03-16 16:31:17 +01:00
Hidde Beydals
077860fff1 Fix updating of go.mod entries for components
We noticed that some of our components had not received `go.mod` updates
while they did receive updates for the versions declared in the YAML
manifests.

Was able to trace this back to a behavior change in Go since `1.16.x`,
resulting in it no longer making automated changes to `go.mod` and
`go.sum`[1]. This is an issue for our updater script as it relies
on `go list -m all`, which now after the first `go mod edit` returns:

```console
$ go list -m all
go: github.com/fluxcd/notification-controller/api@v0.10.0: missing
go.sum entry; to add it:
        go mod download github.com/fluxcd/notification-controller/api
```

To work around the issue without having to repeatedly call `go mod
tidy`, I have opted to simply `grep` on the contents of `go.mod` as a
workaround.

[1]: https://blog.golang.org/go116-module-changes#TOC_3.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-16 16:11:29 +01:00
Stefan Prodan
d29a4ee4d2 Merge pull request #1075 from SomtochiAma/formatted-logs
Implement flux logs command
2021-03-16 16:16:36 +02:00
Somtochi Onyekwere
6d2e34e9b2 Add flux logs command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-16 14:59:03 +01:00
Hidde Beydals
0b6969537b Merge pull request #1102 from fluxcd/fix-sshscan-port
Use Host from parsed URL instead of Hostname
2021-03-16 14:17:07 +01:00
Hidde Beydals
dc6b0d0f0d Use Host from parsed URL instead of Hostname
Regression bug introduced in #1001.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-16 14:01:46 +01:00
Hidde Beydals
b4dbb178fe Merge pull request #1098 from kingdonb/fixup-hint-1
Fix hint in Flux v1 Migration guide
2021-03-15 17:33:03 +01:00
Kingdon Barrett
4cf5290989 fixup hint in Flux v1 Migration guide
The wrong indenting means the hint body will not display as a hint

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-03-15 11:50:37 -04:00
Hidde Beydals
6ffd2222c2 Merge pull request #1094 from fluxcd/status-pkg
Move `StatusChecker` to separate and generic pkg
2021-03-15 11:57:52 +01:00
Hidde Beydals
e7725911a7 Move StatusChecker to separate and generic pkg
This commit moves the `StatusChecker` to a separate package, while
making it more generic so that it is able to assess the status of any
given set of `object.ObjMetadata` identifiers.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-15 11:41:02 +01:00
Hidde Beydals
0c1664cd01 Merge pull request #1093 from fluxcd/build-bootstrap-action-changes 2021-03-15 11:33:31 +01:00
Hidde Beydals
0239307d8e Change repository name used in bootstrap tests
This changes the name of the repository that is used for the GitHub
end-to-end tests to a name that is still traceable to the source
(repository) that created it, by using the format
`<ORIGIN_REPOSITORY_NAME>-<PSEUDO_RAND_SUFFIX>`.

The `PSEUDO_RAND_SUFFIX` is a SHA1 sum of the name of the branch and
commit SHA the tests run for, resulting in a 40 character suffix that
unlike the short commit SHA used before, should not result in collisions.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-15 11:20:26 +01:00
Hidde Beydals
9f10b6be1b Replace delete opt on GitHub bootstrap with curl
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-15 11:20:26 +01:00
Stefan Prodan
01f613b39e Merge pull request #1036 from scottrigby/migration-timetable
Migration and Support Timetable
2021-03-14 09:52:20 +02:00
Scott Rigby
b775d11a70 Flux Migration and Support Timetable
* Set explicit column widths for timetable

  No need for old Firefox workaround. It appears fine on FF in 2021

  See:
  - https://github.com/squidfunk/mkdocs-material/issues/922
  - https://github.com/squidfunk/mkdocs-material/issues/118

* Hide TOC right column on migration table page

* SDK->GOTK footnote

* Cross-link admonitions between Roadmap and Timetable

  To-do: change structure and file names under migration menu dir when we
  move to fluxcd/website

* Add custom heart admonition

* Link to documentated deprecation of apiextensions.k8s.io/v1beta1
  CustomResourceDefinition

* Fix caret (^^ underlines short status)

* Initial migration and Support Timetable

  Add mkdocs markdown_extensions and sort them alphabetically

Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
2021-03-13 22:24:21 -05:00
Stefan Prodan
022576697f Merge pull request #1086 from squat/export_source_typo
cmd/flux/export_source*: fix typo in comment
2021-03-12 14:55:01 +02:00
Lucas Servén Marín
065d0b2c06 cmd/flux/export_source*: fix typo in comment
This commit fixes a small typo in the comments for the export source
commands.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
2021-03-12 13:41:46 +01:00
Stefan Prodan
ed4718205a Merge pull request #1065 from fluxcd/build-prerequisites
Add Go 1.16 to prerequisites (contributing doc)
2021-03-12 12:45:24 +02:00
Stefan Prodan
a29d0c536d Add Go 1.16 to prerequisites (contributing doc)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-12 12:28:43 +02:00
Hidde Beydals
eaeb8ca5c1 Merge pull request #1025 from gliptak/patch-1
Correct ineffassign
2021-03-10 18:12:20 +01:00
Gábor Lipták
2092c14aca Correct ineffassign
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2021-03-10 17:10:26 +00:00
Stefan Prodan
69f38b8c77 Merge pull request #1027 from stealthybox/sops-gpg-batch
Improve SOPS GPG guide key management
2021-03-10 10:04:40 +02:00
leigh capili
d2cdd02a57 Parameterize GPG key input and fingerprint
Signed-off-by: leigh capili <leigh@null.net>
2021-03-09 17:11:53 -07:00
leigh capili
095c8323a1 Capitalize SOPS, K8s, and Git
Signed-off-by: leigh capili <leigh@null.net>
2021-03-09 17:11:53 -07:00
leigh capili
accb4c915e Improve SOPS GPG guide key management
- Switch to batch GPG key creation
- Accurately name the cluster's decryption key
- Suggest password-manager backup
- Optionally cleanup secret key from generating machine
- Optionally commit the public key to the repo for team members
- Document SOPS limitations decryption required for editing / appending fields

Signed-off-by: leigh capili <leigh@null.net>
2021-03-09 17:11:52 -07:00
Hidde Beydals
242809f61d Merge pull request #1069 from fluxcd/doc-link-fix
docs: fix link to source-controller documentation
2021-03-09 12:15:06 +01:00
Hidde Beydals
c4907cf6c6 docs: fix link to source-controller documentation
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-09 10:16:15 +01:00
Hidde Beydals
a4b9191fa3 Merge pull request #1066 from fluxcd/manifest-bundle-tweaks 2021-03-09 09:14:07 +01:00
Hidde Beydals
5fd3d0bd41 Generate manifests in flux-{go,scm} AUR packages
This commit makes a couple of changes to the `flux-{go,scm}` packages
so that they properly build again:

- The manifests are generated before the compilation of the `flux`
  binary.
- The `makedepends` have been updated to require a version of Go
  `>=1.16` (which is a requirement for `embed`).
- The `makedepends` have been updated to require a `kustomize` version
  `>=3.0` (as we use `transformers`).

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-08 19:06:07 +01:00
Hidde Beydals
ba6da23323 Make manifests dir bundle.sh configurable
There was an assumption in this script that it is always executed in Git
repository/directory, this is however not always true, for example when
one downloads the `.tar.gz` that is made available for every release
by GitHub (and used in one of our AUR packages).

This commit changes this, and makes the first argument of `bundle.sh`
configurable, so a custom manifests directory can always be defined
_without_ relying on Git.

Omitting it, or passing an empty string, will still fall back to the
previous behavior of using `git rev-parse --show-toplevel`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-08 18:45:05 +01:00
Hidde Beydals
0328bb14ce Merge pull request #1062 from fluxcd/improve-embedded-manifests-build
Improve build process embedded manifests
2021-03-08 16:25:48 +01:00
Hidde Beydals
2b7a0f3fd4 Improve build process embedded manifests
This commit changes the way the build of manifests is triggered by
making smarter use of the capabilities of Make. The result should be
that the manifests are only regenerated if:

1. There is no `cmd/flux/manifests/` directory.
2. There have been made changes to the YAML files in the `manifests/`
   directory that are newer than the files in `cmd/flux/manifests/`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-08 16:06:44 +01:00
Hidde Beydals
527886bea0 Merge pull request #1060 from fluxcd/aur-pkg-autocomplete-install
Install Bash, Fish, ZSH auto complete in AUR pkgs
2021-03-08 13:35:01 +01:00
Hidde Beydals
98078a0c65 Install Bash, Fish, ZSH auto complete in AUR pkgs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-08 13:16:50 +01:00
Stefan Prodan
ca660b7ba5 Merge pull request #1048 from fluxcd/restore-key-algorithm-default
Restore default key algorithm flag create source
2021-03-05 15:58:56 +02:00
Hidde Beydals
ed93e93b81 Restore default key algorithm flag create source
This was removed by accident in the PR that introduced the new
`manifestgen` packages, and now restored in full glory.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-05 14:40:02 +01:00
Stefan Prodan
80419f00db Merge pull request #1043 from fluxcd/update-components
Update toolkit components
2021-03-05 12:11:34 +02:00
fluxcdbot
01946facb3 Update toolkit components
- helm-controller to v0.8.1
  https://github.com/fluxcd/helm-controller/blob/v0.8.1/CHANGELOG.md
- kustomize-controller to v0.9.2
  https://github.com/fluxcd/kustomize-controller/blob/v0.9.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-03-05 09:47:51 +00:00
Stefan Prodan
08c1bd7653 Merge pull request #1034 from stealthybox/fix-migration-link
Fix anchor on kustomize migration link
2021-03-04 18:23:39 +02:00
leigh capili
ebf9188c6a Fix anchor on kustomize migration link
Signed-off-by: leigh capili <leigh@null.net>
2021-03-04 08:56:22 -07:00
Stefan Prodan
382c6d5885 Merge pull request #1033 from fluxcd/docs-migration-faq
Move the v1 vs v2 FAQ to the migration section
2021-03-04 11:24:46 +02:00
Stefan Prodan
384c60a988 Move the v1 vs v2 FAQ to the migration section
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-04 10:44:57 +02:00
Hidde Beydals
0078147587 Merge pull request #1022 from fluxcd/create-kustomization-path-fix
Use path with '/' slashes in created Kustomization
2021-03-02 11:35:35 +01:00
Hidde Beydals
d79bedf2bc Use path with '/' slashes in created Kustomization
This fixes a bug on Windows where the safe relative path would contain
'\' slashes, which are not compatible with the controller.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-02 11:13:19 +01:00
Hidde Beydals
14b31b321c Merge pull request #1008 from fluxcd/helm-faq 2021-03-01 21:20:56 +01:00
Stefan Prodan
309b9b52f8 Add Helm Controller standalone FAQ to migration guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-01 21:07:49 +01:00
Stefan Prodan
5d063e7390 faq: Can I use Flux HelmReleases without GitOps?
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-01 21:07:49 +01:00
Hidde Beydals
e7ba9b5624 Merge pull request #1018 from tvories/docs/fish_completions 2021-03-01 17:02:41 +01:00
tvories
81f6fa598f Updated godocs to match readme
Signed-off-by: tvories <taylor@tmtech.me>
2021-03-01 08:49:29 -07:00
tvories
d9eabcdbf7 Removed posix style loading for flux and added .fish filetype to completions file
Signed-off-by: tvories <taylor@tmtech.me>
2021-03-01 08:39:04 -07:00
Hidde Beydals
bb3562427b Merge pull request #1001 from fluxcd/manifestgen-deploysecret-kustomization
Add `sourcesecret` and `kustomization` manifestgen
2021-02-26 17:16:13 +01:00
Hidde Beydals
8a5bba80bf Add sourcesecret and kustomization manifestgen
This includes a change to the `sync` generator to make the deploy
secret name configurable.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-26 16:58:41 +01:00
Stefan Prodan
ff2833c4d1 Merge pull request #993 from fluxcd/air-gapped-install
Document air-gapped install procedure
2021-02-25 19:45:37 +02:00
Stefan Prodan
45ba845f23 Document air-gapped install procedure
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-25 19:23:57 +02:00
Hidde Beydals
771a14fcf6 Merge pull request #998 from fluxcd/update-components
Update image-automation-controller to v0.6.1
2021-02-25 17:55:36 +01:00
fluxcdbot
c8ff861d00 Update toolkit components
- image-automation-controller to v0.6.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.6.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-02-25 16:43:31 +00:00
Hidde Beydals
0f05ce3605 Merge pull request #994 from fluxcd/update-components
Update toolkit components
2021-02-25 15:16:01 +01:00
fluxcdbot
38a3f3ba11 Update toolkit components
- kustomize-controller to v0.9.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.9.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-02-25 14:01:37 +00:00
Hidde Beydals
659a19cd80 Merge pull request #992 from fluxcd/status-poller-fix
Update sigs.k8s.io/cli-utils to v0.22.2
2021-02-25 13:20:47 +01:00
Hidde Beydals
baaa466c0f Update sigs.k8s.io/cli-utils to v0.22.2
This is the first release that includes a patch of the
`CachingClusterReader` so that it continues on all list errors.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-25 12:56:16 +01:00
Stefan Prodan
168c65bb6e Merge pull request #987 from fluxcd/embed-install-manifests
Embed the Kubernetes manifests in flux binary
2021-02-25 13:27:12 +02:00
Stefan Prodan
6003d11156 Embed the install manifests in flux binary
- add make target for generating the install manifests using kustomize
- embed the generated manifests in flux binary
- the install and bootstrap commands default to using the embedded manifests
- download the install manifests from GitHub only if the install/bootstrap version arg is set

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-25 12:53:04 +02:00
Stefan Prodan
1f16b6d639 Merge pull request #988 from fluxcd/setup-go-update-ci
Properly setup Go version in update workflow
2021-02-25 12:16:15 +02:00
Hidde Beydals
54bb4b2efd Properly setup Go version in update workflow
To prevent false `go.mod` modifications.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-25 10:48:09 +01:00
Stefan Prodan
f54770c21a Merge pull request #984 from fluxcd/darwin-arm64-build
Publish flux binary for Apple Silicon
2021-02-25 09:21:27 +02:00
Stefan Prodan
1244a62deb Publish flux binary for Apple Silicon
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-24 23:05:46 +02:00
Stefan Prodan
2fe55bcdde Update Go to v1.16
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-24 23:05:42 +02:00
Hidde Beydals
9943690855 Merge pull request #983 from fluxcd/doc-controller-ver-fix 2021-02-24 19:14:39 +01:00
Hidde Beydals
89c46a6379 Fix controller_version helper func
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-24 18:34:52 +01:00
Hidde Beydals
a0d4530cc0 Merge pull request #982 from fluxcd/update-components-plus-ci 2021-02-24 18:31:50 +01:00
Hidde Beydals
6db84269af Update Toolkit component update script
To recognize and correctly replace the versions in the components'
Kustomization files.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-24 18:17:04 +01:00
Hidde Beydals
2cd3c32ca7 Update toolkit components
This includes a change to the components' Kustomization files to make
use of the YAML multi-doc manifests that are now attached to the GitHub
releases.

- helm-controller to v0.8.0
  https://github.com/fluxcd/helm-controller/blob/v0.8.0/CHANGELOG.md
- kustomize-controller to v0.9.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.9.0/CHANGELOG.md
- source-controller to v0.9.0
  https://github.com/fluxcd/source-controller/blob/v0.9.0/CHANGELOG.md
- notification-controller to v0.9.0
  https://github.com/fluxcd/notification-controller/blob/v0.9.0/CHANGELOG.md
- image-reflector-controller to v0.7.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.7.0/CHANGELOG.md
- image-automation-controller to v0.6.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.6.0/CHANGELOG.md

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-24 18:16:44 +01:00
Stefan Prodan
9740fecc35 Merge pull request #974 from tarioch/patch-1
Add example podMonitor for prometheus
2021-02-24 18:34:36 +02:00
Patrick Ruckstuhl
433492791b Add example podMonitor for prometheus
Signed-off-by: Patrick Ruckstuhl <patrick@ch.tario.org>
2021-02-24 16:01:00 +00:00
Hidde Beydals
7d3c63ad74 Merge pull request #981 from fluxcd/docs/v1-migration-notes
Add notes about flux bootstrap and feature parity
2021-02-24 13:42:51 +01:00
Hidde Beydals
a6538b117e Add notes about flux bootstrap and feature parity
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-24 13:29:04 +01:00
Stefan Prodan
d54e7559a5 Merge pull request #966 from stealthybox/fixup-az-imgup-kustomize-build
Use git remote-base instead of zip-archive for cloud image-update example
2021-02-23 11:39:59 +02:00
Hidde Beydals
bb9eca7232 Merge pull request #967 from fluxcd/ci/tweak-if-cond
Fix detection of PRs from forks
2021-02-23 10:24:25 +01:00
leigh capili
b5027d8f3f Use git remote-base instead of zip-archive for cloud image-update example
Signed-off-by: leigh capili <leigh@null.net>
2021-02-23 10:24:24 +01:00
Hidde Beydals
00a134e23f Fix detection of PRs from forks
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-23 10:10:03 +01:00
Hidde Beydals
aab3452773 Merge pull request #949 from fluxcd/k8s-ver-check
Include prerelease data in k8s version constraints
2021-02-19 12:01:14 +01:00
Hidde Beydals
5903dfc627 Include prerelease data in k8s version constraints
This ensures the advertised version from e.g. GKE or EKS (for example
`v1.17.15-gke.800`) do not trigger a false warning.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-19 11:39:16 +01:00
Stefan Prodan
a5272b2b39 Merge pull request #945 from fluxcd/docs-ga-roadmap
Add production ready and GA sections to roadmap
2021-02-18 19:57:13 +02:00
Stefan Prodan
771fc20bb2 Add production ready and GA sections to roadmap
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-18 19:03:49 +02:00
Hidde Beydals
b5f48bee78 Merge pull request #944 from fluxcd/build/codeql-on-push 2021-02-18 15:55:49 +01:00
Hidde Beydals
ff78af5808 Run bootstrap for trusted PRs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-18 15:41:37 +01:00
Hidde Beydals
7eab649abc Bundle CodeQL, FOSSA, Snyk as jobs in workflow
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-18 15:41:37 +01:00
Hidde Beydals
1b5db157b1 Align formatting and extensions workflows
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-18 15:41:32 +01:00
Hidde Beydals
0fa9aebf7a Split analysis workflows into CodeQL, FOSSA, Snyk
This reverts #934, but takes into account the mistakes that were fixed
there.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-18 14:36:02 +01:00
Hidde Beydals
9fb9965ffe Merge pull request #943 from fluxcd/disable-darwin-arm64
Exclude ARM archs from Darwin release builds
2021-02-18 12:17:50 +01:00
Hidde Beydals
02c9f29499 Exclude ARM archs from Darwin release builds
As we are not on Go 1.16 yet.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-18 12:04:32 +01:00
Hidde Beydals
c6243ad002 Merge pull request #942 from fluxcd/update-components
Update toolkit components
2021-02-18 11:36:09 +01:00
fluxcdbot
f4650c7a84 Update toolkit components
- kustomize-controller to v0.8.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.8.1/CHANGELOG.md
- source-controller to v0.8.1
  https://github.com/fluxcd/source-controller/blob/v0.8.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-02-18 10:22:26 +00:00
Stefan Prodan
6df691598e Merge pull request #934 from fluxcd/merge-scan-actions
Merge scanning actions
2021-02-17 14:43:35 +02:00
Stefan Prodan
26964b7f88 Merge scanning actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-17 11:12:55 +02:00
Stefan Prodan
71712ae1c3 Merge pull request #935 from Niksko/patch-1
Fix typo in gotk_reconcile_condition status
2021-02-17 09:03:53 +02:00
Nik Skoufis
0b6c979e47 Fix typo in gotk_reconcile_condition status
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au>
2021-02-17 15:30:24 +11:00
Stefan Prodan
cc2cbc2519 Merge pull request #929 from fluxcd/flux-action
Refactor Flux GitHub Action
2021-02-17 00:33:56 +02:00
Stefan Prodan
8043ae961a Refactor Flux GitHub Action
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-17 00:07:39 +02:00
Hidde Beydals
b1d1d30cdb Merge pull request #932 from idvoretskyi/idvoretskyi-snyk
Snyk GitHub Action added
2021-02-16 22:50:46 +01:00
Ihor Dvoretskyi
28d606cb0e Snyk GitHub Action added
Signed-off-by: Ihor Dvoretskyi <ihor@linux.com>
2021-02-16 23:38:04 +02:00
Hidde Beydals
e9c5b6e917 Merge pull request #933 from adrian/updates-to-sealed-secrets-docs
A few minor updates to sealed secrets docs
2021-02-16 22:20:11 +01:00
Adrian Smith
68f96235fc A few minor updates to sealed secrets docs
* Update to sealed secrets 1.13 helm chart. 1.10 is no longer available.
* Use `--dry-run=client` with kubectl. `--dry-run` on its own is
deprecated.

Signed-off-by: Adrian Smith <adrian@17od.com>
2021-02-16 21:06:50 +00:00
Hidde Beydals
12f22ddeba Merge pull request #931 from fluxcd/add-codeql
Add CodeQL Security Scanning
2021-02-16 19:06:19 +01:00
Chris Aniszczyk
9db5c644a6 Create codeql-analysis.yml
Add CodeSQL Security Scanning to start.

Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2021-02-16 11:46:25 -06:00
Hidde Beydals
ef6a1fb09b Merge pull request #923 from arbourd/update-runtime
Use `MergeMaps` from pkg/runtime v0.8.2
2021-02-16 00:43:23 +01:00
Dylan Arbour
99002f92f4 Update pkg/runtime to v0.8.2
pkg/runtime v0.8.2 introduces runtime/transform which includes
`MergeMaps`:
https://github.com/fluxcd/pkg/pull/85

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-02-15 18:06:54 -05:00
Hidde Beydals
298d6a1a15 Merge pull request #922 from fluxcd/check-improvements 2021-02-15 22:14:00 +01:00
Hidde Beydals
5a21f50230 Remove unused util functions
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-15 21:57:11 +01:00
Hidde Beydals
5263dabd22 Check if targeted version is supported by binary
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-15 21:57:11 +01:00
Hidde Beydals
9b649f6c72 Check if targeted bootstrap/install version exists
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-15 21:57:06 +01:00
Hidde Beydals
b903cd5b68 Check for new Flux binary version
This prints a warning if the user has internet access and is running
an older version of the binary.

It also replaces the `blang/semver` package with `pkg/version` and
`Masterminds/semver` to align with controller dependencies.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-15 21:48:27 +01:00
Hidde Beydals
890b5c5202 Use label selector to check components
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-15 16:39:29 +01:00
Hidde Beydals
a14e88d04d Merge pull request #915 from fluxcd/docs-helm-features 2021-02-13 19:08:11 +01:00
Hidde Beydals
58e09b4c68 docs: list Helm post renderer feature
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-13 15:56:43 +01:00
Stefan Prodan
631201d541 Merge pull request #914 from fluxcd/img-update-roadmap
Update image update feature parity roadmap
2021-02-12 18:35:48 +02:00
Stefan Prodan
0fbeb6d2cd Update semver flag in image update guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 18:23:25 +02:00
Stefan Prodan
11f8e2ffde Update image update feature parity roadmap
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 18:21:29 +02:00
Hidde Beydals
055eb4a61a Merge pull request #806 from fluxcd/image-auto-migration-howto 2021-02-12 17:20:35 +01:00
Hidde Beydals
30c1c5c3d3 Link to image automation guides in menu
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 17:01:43 +01:00
Hidde Beydals
e034ec3207 Add missing link to image update automation ref
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 17:01:08 +01:00
Hidde Beydals
8edc4bd24b Add missing link to SemVer spec
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 16:49:33 +01:00
Hidde Beydals
6e1672f73c Change policy example to numerical in asc order
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 16:47:16 +01:00
Michael Bridgen
5e1f6f7317 Fix up internal links
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
386780ba12 Make hrefs absolute and spelt correctly
Stray characters here and there threw off the markdown engine.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
e785971ba8 Rewrite to account for numerical sorting
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
daaae07649 Persuade markdown relative paths are links
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
6cd567dc66 Remove draft TODO comments
I have moved TODO comments (that still apply) to the PR description.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
a541a7ee85 Remove suggestions of using commit number
Using a commit number is trickier than it sounds. It would need to be
padded to sort correctly, for one thing. It is better to leave it out
than to give an incomplete account.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
43572bba04 Rearrange so that observing an auto commit is last
Previously, creating an automation object was the last instruction. It
is easier to describe what to expect at each step when the last step
is to add an update marker in the file to be updated, since the next
thing that should happen is that the automation makes an update as a
consequence.

This commit shifts the sections around so that setting up the
GitRepository and ImageUpdateAutomation are done earlier, and
migrating each file are done after that, and completes the steps
described including checking the expected status at each stage.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
2a3a4456c1 Separate image tags howto from migration howto
The Flux v1 migration how-to flows better if the section on how to set
builds up to tag images in the right way is its own document. It's a
lot to skim past when you don't need it, and (since it's a different
layer of yak hair) something you might want to figure out first if you
do need it.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Michael Bridgen
15f8e6369b Add image automation migration how-to
This doc describes how to move from using Flux v1 to update image refs
in git, to using Flux v2. There is some overlap with the tutorial on
how to use Flux v2 automation. This how-to spends more time on how to
convert existing configuration to be used with Flux v2.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 16:46:30 +01:00
Hidde Beydals
cfad9a19eb Merge pull request #911 from fluxcd/select-numeric-validation
Validate if only one image policy selector is given
2021-02-12 16:14:21 +01:00
Hidde Beydals
e4c3136433 Merge pull request #910 from fluxcd/git-ca-file
Add caFile to create source/secret git commands
2021-02-12 16:01:27 +01:00
Hidde Beydals
73b8a26850 Validate if only 1 image policy selector is given
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 16:01:25 +01:00
Stefan Prodan
aa533b28fb Add caFile to create source/secret git commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 16:47:00 +02:00
Hidde Beydals
9d70e09a57 Add numeric selector to create image policy cmd
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 15:38:01 +01:00
Stefan Prodan
17e18985e6 Merge pull request #908 from fluxcd/update-kustomize-api
Update sigs.k8s.io/kustomize/api to v0.7.4
2021-02-12 15:49:39 +02:00
Hidde Beydals
7c39aaf463 Update sigs.k8s.io/kustomize/api to v0.7.4
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 14:32:44 +01:00
Hidde Beydals
bae5c125e8 Merge pull request #907 from fluxcd/update-components
Update toolkit components
2021-02-12 14:29:23 +01:00
fluxcdbot
1c84fa0d97 Update toolkit components
- helm-controller to v0.7.0
  https://github.com/fluxcd/helm-controller/blob/v0.7.0/CHANGELOG.md
- kustomize-controller to v0.8.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.8.0/CHANGELOG.md
- source-controller to v0.8.0
  https://github.com/fluxcd/source-controller/blob/v0.8.0/CHANGELOG.md
- notification-controller to v0.8.0
  https://github.com/fluxcd/notification-controller/blob/v0.8.0/CHANGELOG.md
- image-reflector-controller to v0.6.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.6.0/CHANGELOG.md
- image-automation-controller to v0.5.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.5.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-02-12 13:16:13 +00:00
Hidde Beydals
6f583f9f0e Merge pull request #878 from fluxcd/pprof-guide 2021-02-12 14:02:36 +01:00
Hidde Beydals
217574b75c Add debugging to dev guides menu
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 13:44:35 +01:00
Hidde Beydals
1378530aeb Add section about resource usage
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 13:44:35 +01:00
Hidde Beydals
0b10ed4d88 Add guide for pprof endpoints
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-12 13:44:35 +01:00
Stefan Prodan
a2887f5776 Merge pull request #891 from fluxcd/refac-uninstall
Refactor flux uninstall command
2021-02-12 14:44:23 +02:00
Stefan Prodan
0f1d27f1e6 Remove network policies on uninstall
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 14:30:57 +02:00
Stefan Prodan
850ab0942b Implement uninstall dry run
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 14:30:50 +02:00
Stefan Prodan
f5ae8f44b4 Refactor flux uninstall command
- deletes Flux components (deployments and services)
- deletes Flux RBAC (service accounts, cluster roles and cluster role bindings)
- removes the Kubernetes finalizers from Flux custom resources
- deletes Flux custom resource definitions and custom resources
- deletes the namespace where Flux was installed
- preserves the Kubernetes objects and Helm releases that were reconciled on the cluster by Flux

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 14:30:50 +02:00
Michael Bridgen
7f98cfd506 Merge pull request #906 from fluxcd/personal-flag
Give more explanation for --personal flag
2021-02-12 12:02:22 +00:00
Michael Bridgen
bc45a79b92 Give more explanation for --personal flag
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-12 11:41:27 +00:00
Stefan Prodan
5003cf674d Merge pull request #904 from fluxcd/add-version-to-commits
Add flux version to bootstrap commit messages
2021-02-12 11:38:35 +02:00
Stefan Prodan
bc9cbc387c Add flux version to bootstrap commit messages
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-12 10:47:00 +02:00
Stefan Prodan
60a1e78869 Merge pull request #899 from fluxcd/toleration-keys
Allow Flux to be deployed on tainted Kubernetes nodes
2021-02-11 15:46:45 +02:00
Stefan Prodan
37f5587085 Allow Flux to be deployed on tainted Kubernetes nodes
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-11 15:20:19 +02:00
Hidde Beydals
fa6e3d3706 Merge pull request #898 from fluxcd/docs-fix-list 2021-02-11 13:20:19 +01:00
Hidde Beydals
bb8bc875b4 docs: improve Kustomize behavior FAQ
- Fix the formatting of the list.
- Add a hint block for validating changes locally and/or in CI.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-11 12:54:03 +01:00
Stefan Prodan
b3dca737be Merge pull request #897 from fluxcd/fix-timeout
Map timeout arg to bootstrap status check
2021-02-11 13:30:05 +02:00
Stefan Prodan
9094f85487 Add image automation to readme
Sync community section readme/docs index

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-11 13:11:03 +02:00
Stefan Prodan
1256bbfbaf Fix bootstrap status check timeout
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-11 13:09:16 +02:00
Daniel Holbach
24fe74f2f6 Merge pull request #893 from dholbach/link-to-community-page
Link to community page from docs home page
2021-02-10 08:40:15 +01:00
Daniel Holbach
908f501e03 link to community page from toolkit.f.i
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-02-09 14:52:17 +01:00
Stefan Prodan
35507c7854 Merge pull request #860 from jonathan-innis/joinnis/image-policy
Adding --select-alpha and --extract to create image policy
2021-02-09 15:05:57 +02:00
Jonathan Innis
eb7102ecac Adding extract pattern validation
Signed-off-by: Jonathan Innis <jonathan.innis.ji@gmail.com>
2021-02-08 16:51:45 -08:00
Jonathan Innis
ade6bfcbca Update e2e testing with new cli args
Signed-off-by: Jonathan Innis <jonathan.innis.ji@gmail.com>
2021-02-08 16:49:07 -08:00
Jonathan Innis
fa98403aa8 Add newly generated create image doc
Signed-off-by: Jonathan Innis <jonathan.innis.ji@gmail.com>
2021-02-08 16:49:07 -08:00
jonathan-innis
3f0cb1637c Add select-alpha and extract to create policy
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-08 16:49:07 -08:00
Stefan Prodan
42011d028e Merge pull request #879 from fluxcd/azure-devops-pat
Add Azure DevOps PAT auth to install docs
2021-02-08 19:01:49 +02:00
Stefan Prodan
307bb0dea1 Add Azure DevOps PAT auth to install docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-08 18:44:22 +02:00
Stefan Prodan
ec2a8347d4 Merge pull request #877 from stealthybox/integrations-registry-credentials-sync
Add ACR auth to Image Updates examples
2021-02-08 18:43:22 +02:00
leigh capili
e99b1c3ed8 Document ACR / AKS Image Update Considerations
Signed-off-by: leigh capili <leigh@null.net>
2021-02-08 09:15:42 -07:00
leigh capili
99825f2663 Add registry cred Deployments/CronJobs for aws/gcp/azure via kustomize
Signed-off-by: leigh capili <leigh@null.net>
2021-02-08 09:15:42 -07:00
Stefan Prodan
afffdfbc5c Merge pull request #880 from chanwit/add_kustomize_fag
Add FAQ to explain the current Kustomize behavior
2021-02-08 17:54:28 +02:00
Chanwit Kaewkasi
cd874acfd5 add FAQ to explain the current Kustomize behavior
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-02-08 21:24:31 +07:00
Stefan Prodan
34edbf469e Merge pull request #871 from fluxcd/incident-mgmt
Add incident management section to image automation docs
2021-02-06 12:47:10 +02:00
Stefan Prodan
d9ed30e436 Add incident management section to image automation docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-06 10:51:37 +02:00
Stefan Prodan
30008de400 Merge pull request #867 from fluxcd/get-resource-by-name
Add support for getting resources by name
2021-02-05 17:24:50 +02:00
Stefan Prodan
a5fa731545 Add support for getting resources by name
- add singular alias to get commands
- allow filtering the get commands result by resource name
- add the image commands to mkdocs index

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-05 16:35:23 +02:00
Stefan Prodan
493ee3c956 Merge pull request #866 from fluxcd/hr-values
Add support for multiple values files to create hr
2021-02-05 16:09:29 +02:00
Stefan Prodan
3dd574ee51 Add support for multiple values files to create hr
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-05 15:43:03 +02:00
Hidde Beydals
5416c19b2e Merge pull request #863 from fluxcd/update-git-pkg 2021-02-05 14:42:32 +01:00
Hidde Beydals
2f31d80c7a Update git from fluxcd/pkg
This incorporates the changes made to the GitLab provider.

This means that we no longer rely on UI names, but rather use the unique
path identifier (the elements you see in your address bar when looking
at e.g. a group in your GitLab environment).

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-05 13:38:49 +01:00
Stefan Prodan
27d1833854 Merge pull request #848 from ViBiOh/patch-1
Exclude deleted resources on prometheus alerting query
2021-02-05 09:28:49 +02:00
Vincent Boutour
84ed716908 Exclude deleted resources on prometheus alerting query
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
2021-02-04 18:10:42 +01:00
Michael Bridgen
6c9c9c7578 Merge pull request #790 from fluxcd/certs-for-imagerepo
Give image repository a cert-secret-ref flag
2021-02-04 13:13:43 +00:00
Michael Bridgen
cc7b7b0689 Give examples of create image repository
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-04 12:55:42 +00:00
Michael Bridgen
5df8e05d1a Give image repository a cert-secret-ref flag
ImageRepository objects can now refer to a secret containing
certificates to use for TLS. This adds the flag

    flux create image repository --cert-secret-ref

for naming a secret to use. You can create such a secret with

    flux create secret tls

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-04 12:55:42 +00:00
Michael Bridgen
b3b224b0ca Merge pull request #862 from fluxcd/correct-image-delete
Rename flux delete auto to flux delete image
2021-02-04 12:54:05 +00:00
Michael Bridgen
75ab28ee5d Rename flux delete auto to flux delete image
This slipped through the auto->image change made in the course of
preparing #538.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-04 11:57:40 +00:00
Michael Bridgen
aa9ea2b4ab Merge pull request #843 from fluxcd/create-image-update-typo
Correct spelling of repository in error
2021-02-04 10:46:27 +00:00
Michael Bridgen
1e6be99c36 Correct spelling of repository in error
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-04 10:16:09 +00:00
Stefan Prodan
49fb396bf8 Merge pull request #861 from fluxcd/refactor-checks
Refactor components status check
2021-02-04 11:56:22 +02:00
Stefan Prodan
e055c9ddc1 Refactor components status check
- run install/bootstrap checks in parallel (1m timeout)
- list not found components

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-04 11:16:27 +02:00
Stefan Prodan
c708e390a7 Merge pull request #845 from jonathan-innis/jonathan-innis/kstatus
Replace kubectl rollout with kstatus checks
2021-02-04 09:11:41 +02:00
jonathan-innis
d5ad26c934 Change failed message for bootstrap
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-03 12:08:10 -08:00
jonathan-innis
144b7cd922 Update errors returned to user
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-03 12:07:29 -08:00
jonathan-innis
9e86fbb311 Tidy up the mod imports
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-03 12:07:29 -08:00
jonathan-innis
b528428d02 Add kstatus to install and check commands
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-03 12:07:29 -08:00
jonathan-innis
b3d7730e79 Use status polling in bootstrap command
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
2021-02-03 12:07:19 -08:00
Hidde Beydals
f2ba567ca4 Merge pull request #857 from fluxcd/update-components
Update toolkit components
2021-02-03 19:34:43 +01:00
fluxcdbot
8342f77087 Update toolkit components
- source-controller to v0.7.4
  https://github.com/fluxcd/source-controller/blob/v0.7.4/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-02-03 14:51:22 +00:00
Hidde Beydals
7cade1b98f Merge pull request #858 from fluxcd/component-update-cfg
Put CHANGELOG URL on new line in commit / PR body
2021-02-03 15:50:47 +01:00
Hidde Beydals
ee4c1fb36c Put CHANGELOG URL on new line in commit / PR body
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-03 15:22:57 +01:00
Hidde Beydals
dbc4e537fe Merge pull request #854 from fluxcd/move-migration-menu 2021-02-03 13:10:59 +01:00
Hidde Beydals
e28990b96c Move migration sub-menu to top-menu
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-03 11:49:51 +01:00
Hidde Beydals
408cf92c04 Merge pull request #853 from fluxcd/component-update-cfg
Tune component update configuration
2021-02-03 10:22:58 +01:00
Hidde Beydals
425af2e0dc Tune component update configuration
- Include link to changelog of component in commit and PR message
- Label pull request automatically with `area/build`
- Enable sign-off of commits to free us from manual labour

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-02 18:48:49 +01:00
Stefan Prodan
22df860eca Merge pull request #849 from fluxcd/update-components
Update toolkit components
2021-02-02 18:07:29 +02:00
fluxcdbot
f395044d65 Update toolkit components 2021-02-02 15:40:37 +00:00
Hidde Beydals
afe0ddcd84 Merge pull request #824 from fluxcd/upgrade-semver-tip
Highlight PATCH versions can be used to upgrade
2021-02-01 18:41:34 +01:00
Hidde Beydals
2c0323684c Highlight PATCH versions can be used to upgrade
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-01 18:21:54 +01:00
Hidde Beydals
6d5ffdea57 Merge pull request #841 from fluxcd/update-components
Update toolkit components
2021-02-01 18:07:15 +01:00
fluxcdbot
648af6e645 Update toolkit components 2021-02-01 16:50:07 +00:00
Hidde Beydals
e1895a4e21 Merge pull request #840 from relu/fix-image-update-docs-ecr-cronjob
Improve image update CronJob examples
2021-02-01 17:49:31 +01:00
Aurel Canciu
d5f45800ae Clarify how to use the generated cronjob secret
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-02-01 17:11:14 +01:00
Aurel Canciu
51f9d249ff Fix image update guide ECR cronjob manifest
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-02-01 17:11:14 +01:00
Hidde Beydals
6f525356cb Merge pull request #837 from aholbreich/patch-1 2021-02-01 17:10:54 +01:00
Alexander Holbreich
5008f9064e Update image-update.md
Increase attention to missing flux components.

Signed-off-by: Alexander Holbreich <alexander@holbreich.org>
2021-02-01 16:53:19 +01:00
Stefan Prodan
cff96ed7ca Merge pull request #834 from fluxcd/fix-secret-cmd
Fix create secret commands
2021-01-30 16:36:44 +02:00
Stefan Prodan
4e8a600f34 Add e2e tests for create secret commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-30 15:19:45 +02:00
Stefan Prodan
4fd5684277 Fix create secret commands
Regression bug introduced in https://github.com/fluxcd/flux2/pull/788

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-30 15:07:48 +02:00
Hidde Beydals
06bf469ba7 Merge pull request #825 from SomtochiAma/refactor-reconcile-command
Refactor resume command
2021-01-29 19:52:07 +01:00
Somtochi Onyekwere
b8a215230c refactor resume command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-29 19:05:38 +01:00
Stefan Prodan
2460cfcf1c Merge pull request #821 from fluxcd/docs-helm-faq
Add HelmChart not ready to FAQ
2021-01-29 17:05:39 +02:00
Stefan Prodan
364242c857 Add HelmChart not ready to FAQ
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-29 16:20:35 +02:00
Stefan Prodan
29e2900f59 Merge pull request #818 from fluxcd/docs-image-webhook
Add webhook section to image update docs
2021-01-29 13:33:17 +02:00
Stefan Prodan
61e1fb770e Add webhook section to image update docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-29 13:09:01 +02:00
Stefan Prodan
2d3fcbdea3 Merge pull request #815 from fluxcd/e2e-kube-1.20.2
Update e2e tests to Kubernetes v1.20.2
2021-01-29 09:49:42 +02:00
Stefan Prodan
47e15cee3d Update e2e tests to Kubernetes v1.20.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-28 19:50:19 +02:00
Stefan Prodan
adeb3e3f42 Merge pull request #814 from mewzherder/patch-9
Community section clarity of purpose + support page link
2021-01-28 19:42:42 +02:00
mewzherder
fb1278285b Community section clarity of purpose + support page link
Signed-off-by: mewzherder <tamao@weave.works>
2021-01-28 09:24:08 -08:00
Stefan Prodan
e371610849 Merge pull request #812 from chanwit/network_policy_e2e
Enable network policy in e2e
2021-01-28 16:46:45 +02:00
Chanwit Kaewkasi
424de63bd1 update KIND to v0.10.0 and node to 1.16.15
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-01-28 21:21:02 +07:00
Chanwit Kaewkasi
832c925d39 setup Calico to enable network policy for e2e testing
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-01-28 21:21:02 +07:00
Chanwit Kaewkasi
378f118d51 add kind config to disable kind-net
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2021-01-28 21:21:02 +07:00
Hidde Beydals
d651777122 Merge pull request #813 from fluxcd/iua-docs-example-update
Update docs ImageUpdateAutomation example
2021-01-28 15:13:40 +01:00
Aurel Canciu
65d8ebabb8 Update docs ImageUpdateAutomation example
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-01-28 15:57:25 +02:00
Hidde Beydals
9195ed9a1b Merge pull request #809 from SomtochiAma/refactor-reconcile-command
Refactor reconcile commands
2021-01-28 14:16:15 +01:00
Somtochi Onyekwere
5df8f7313c Refactor reconcile commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-28 13:21:29 +01:00
Hidde Beydals
25ed6ca0a4 Merge pull request #780 from dholbach/link-to-support-page 2021-01-28 11:59:08 +01:00
Daniel Holbach
9f972995bd add very basic issue template
Also link to support page.

	Fixes: fluxcd/website#77

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-01-27 17:34:26 +01:00
Hidde Beydals
29c46a9892 Merge pull request #791 from SomtochiAma/refactor-reconcile-commands
Refactor suspend commands
2021-01-27 10:05:32 +01:00
Somtochi Onyekwere
ef579fe596 Refactor suspend commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-27 09:57:37 +01:00
Hidde Beydals
5b268f62a3 Merge pull request #789 from SomtochiAma/refactor-delete-command 2021-01-27 09:57:17 +01:00
Somtochi Onyekwere
1f1c8286a5 Refactor delete command for kustomizations, sources and helmreleases
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-27 09:43:39 +01:00
Hidde Beydals
5401e1ace4 Merge pull request #794 from fluxcd/get-type-fixes
Use correct type in various get source commands
2021-01-27 09:37:25 +01:00
Hidde Beydals
69294ef56d Use correct type in various get source commands
This fixes a bug where the wrong type was displayed for various
`get source` commands.

```console
$ flux get sources helm --namespace default
✗ no Bucket objects found in default namespace
```

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-27 09:28:48 +01:00
Hidde Beydals
a685ed8029 Merge pull request #793 from fluxcd/reconcile-w-source-other-ns
Set source namespace when reconciling with source
2021-01-27 09:21:12 +01:00
Hidde Beydals
68d0be3818 Set source namespace when reconciling with source
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 22:21:40 +01:00
Michael Bridgen
84e2cb4c1f Merge pull request #788 from fluxcd/create-secret-tls
Create secret for TLS command
2021-01-26 17:33:50 +00:00
Michael Bridgen
263c664acd Factor out more common secrets command code
Making the secret without data is always the same, so factor that out.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-26 17:25:33 +00:00
Michael Bridgen
b12c4c22fb Add command for creating TLS secrets
The image-reflector controller now accepts a secret containing a
client certificate and key, and/or a CA certificate; so it's useful to
have a command for creating them.

`flux create secret helm` is close, but accepts username/password
(which would be ignored), and has the wrong name of course. Happily
though, much can be shared between the implementations.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-26 17:25:33 +00:00
Stefan Prodan
9f39fadb9e Merge pull request #787 from fluxcd/fix-rbac-namespace
RBAC Fix: Replace SA namespace in ClusterRoleBindings
2021-01-26 19:21:19 +02:00
Stefan Prodan
4c29a1ca27 Replace SA namespace in RBAC
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-26 18:57:36 +02:00
Stefan Prodan
f4db124d50 Merge pull request #783 from fluxcd/rbac-fix
RBAC Fix: Add SA namespace to cluster role bindings
2021-01-26 16:24:16 +02:00
Stefan Prodan
8f8c7cccc6 Add SA namespace to RBAC
Fix flux install when not all controllers have been selected

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-26 16:16:34 +02:00
Hidde Beydals
e2097c28bd Merge pull request #782 from fluxcd/docs-img-auto-links
docs: fix image automation menu links
2021-01-26 14:34:29 +01:00
Hidde Beydals
871eb444fc docs: fix image automation menu links
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 14:26:18 +01:00
Hidde Beydals
bc5fbb9fa5 Merge pull request #774 from fluxcd/doc-helm-storage-ns 2021-01-26 14:15:00 +01:00
Hidde Beydals
3e9749c6b1 Document StorageNamespace in Helm migration guide
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 14:05:54 +01:00
Hidde Beydals
eaf08fbe90 Merge pull request #781 from fluxcd/docs-image-update 2021-01-26 14:05:47 +01:00
Hidde Beydals
df411cdb88 Update alpha warning
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 13:54:28 +01:00
Hidde Beydals
a83c26a864 Provide link to CalVer, build ID, etc. policies
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 13:54:28 +01:00
Hidde Beydals
6aa853491c Add image automation to menu
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-26 13:54:28 +01:00
Hidde Beydals
3af1d7a5b8 Merge pull request #771 from fluxcd/update-components 2021-01-26 13:53:47 +01:00
fluxcdbot
c7c57f6717 Update toolkit components 2021-01-26 12:32:15 +00:00
Stefan Prodan
cbb97768d1 Merge pull request #777 from fluxcd/dedicated-service-accounts
Add a dedicated service account per controller
2021-01-26 14:31:38 +02:00
Stefan Prodan
2bb40d335b Replace the default service account in docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-26 12:57:00 +02:00
Stefan Prodan
1b581d6f51 Add dedicated service accounts per controller
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-26 12:27:58 +02:00
Stefan Prodan
c219eb2883 Merge pull request #776 from SomtochiAma/refactor-get-commands
Refactor get command for kustomization and helmrelease
2021-01-26 11:55:27 +02:00
Somtochi Onyekwere
65a2c87b5a Refactor get cmd for kustomization and helmrelease
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-26 10:15:35 +01:00
Stefan Prodan
13aa523c37 Merge pull request #761 from SomtochiAma/cli-refactoring
Refactor get source commands
2021-01-26 10:42:49 +02:00
Somtochi Onyekwere
584f0eea58 Refactor get source commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-26 09:26:55 +01:00
Stefan Prodan
b5ebdb16b2 Merge pull request #773 from nairb774/sharp_payne
Add permissions for controller leader election
2021-01-25 23:35:19 +02:00
Brian Atkinson
a18f84c27b Add permissions for controller leader election.
The v0.8.0 version of the controller-runtime uses both config maps and
leases to perform leader election. These permissions seem to be in the
individual controller repos, but not here. For example
2d38de8779/config/rbac/leader_election_role.yaml (L33-L44)

Signed-off-by: Brian Atkinson <brian@atkinson.mn>
2021-01-25 10:15:57 -08:00
Stefan Prodan
eb86505375 Merge pull request #769 from fluxcd/update-release-doc
Add the image automation controllers to release doc
2021-01-25 15:31:31 +02:00
Stefan Prodan
984f1c8669 Add the image automation controllers to release doc
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-25 15:21:43 +02:00
Hidde Beydals
c7378edabc Merge pull request #765 from fluxcd/update-controllers 2021-01-22 16:35:30 +00:00
Hidde Beydals
ac6c6e3a30 Incorporate required API changes
* Use `LocalObjectReference` and `NamespacedObjectKindReference`
  from `meta` package, as required by controller API changes.
* Remove `Update` field from created `ImageUpdateAutomation`,
  as the API changed and the default is now defined in the Custom
  Resource Definition.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-22 17:21:36 +01:00
fluxcdbot
1bca31f32c Update toolkit components 2021-01-22 16:07:19 +00:00
Hidde Beydals
28d099a6b2 Merge pull request #741 from fluxcd/include-image-spec-docs 2021-01-22 16:06:33 +00:00
Michael Bridgen
6a2b53fbf5 Put image specs and refs in place
This adds the image controller specs and refs to the workflow that
prepares the docs, and links to them in the index.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-22 16:49:18 +01:00
Michael Bridgen
7568f301b8 Make home for image-* component docs
This has a description of the controllers, and is where the API specs
and refs will get copied to.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-22 16:49:18 +01:00
Stefan Prodan
6add511447 Merge pull request #755 from SomtochiAma/cli-refactoring
Refactor cmd global variables into structs
2021-01-22 12:27:39 +02:00
Somtochi Onyekwere
a7586e69fd Refactor cmd global variables into structs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-22 10:42:31 +01:00
Stefan Prodan
77db369213 Merge pull request #757 from fluxcd/gitlab-fix
Update fluxcd/pkg/git to v0.2.3
2021-01-21 18:12:11 +02:00
Stefan Prodan
2eb6a0513e Update fluxcd/pkg/git to v0.2.3
Fixes Gitlab bootstrap when used with a project token

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-21 17:51:07 +02:00
Stefan Prodan
38468c72db Merge pull request #750 from SomtochiAma/kms-docs
Update guide for mozilla sops
2021-01-20 17:04:56 +02:00
Somtochi Onyekwere
5f759200c6 update guide for mozilla sops
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-20 15:54:26 +01:00
Daniel Holbach
81f68157fa Merge pull request #753 from dholbach/f-community-24
move talk info, part of fluxcd/community#24
2021-01-20 15:21:15 +01:00
Daniel Holbach
0f3e8abf06 move talk info, part of fluxcd/community#24
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-01-20 15:07:08 +01:00
Stefan Prodan
fcadd5312d Merge pull request #747 from mewzherder/patch-8
Clarify options on our GH Discussions page
2021-01-20 10:59:22 +02:00
mewzherder
6e32820910 Clarify options on our GH Discussions page
Signed-off-by: mewzherder <tamao@weave.works>
2021-01-19 22:27:50 -08:00
Hidde Beydals
8499269bab Merge pull request #744 from fluxcd/update-components
Update kustomize-controller to v0.6.3
2021-01-19 16:47:52 +01:00
fluxcdbot
72122120cb Update toolkit components 2021-01-19 15:37:38 +00:00
Hidde Beydals
2bbcb95f4f Merge pull request #728 from fluxcd/update-components
Update toolkit components
2021-01-19 14:29:22 +01:00
fluxcdbot
19982fa4a6 Update toolkit components 2021-01-19 13:04:46 +00:00
Hidde Beydals
41cf38c6a7 Merge pull request #740 from fluxcd/fluxcd/pkg/git-v0.2.2
Update fluxcd/pkg/git to v0.2.2
2021-01-19 14:03:43 +01:00
Stefan Prodan
16e74647eb Update fluxcd/pkg/git to v0.2.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-19 14:36:11 +02:00
Hidde Beydals
53cdcbc4ee Merge pull request #722 from fluxcd/workflow-tweaks
Fire 'Update Components' workflow on push to main
2021-01-15 17:34:56 +01:00
Hidde Beydals
eb2535e066 Fire 'Update Components' workflow on push to main
This results in the automatic rebase of an outstanding PR on merges to
this branch, removing the need of manually firing it.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 17:20:16 +01:00
Hidde Beydals
f5c29a7a72 Merge pull request #720 from fluxcd/update-components
Update kustomize-controller to v0.6.2
2021-01-15 17:16:50 +01:00
fluxcdbot
e243df93f1 Update toolkit components 2021-01-15 16:02:02 +00:00
Hidde Beydals
388642d9dd Merge pull request #721 from fluxcd/git-impl-fixes 2021-01-15 17:01:08 +01:00
Hidde Beydals
9e1db06936 Move Git implementation validation to custom flag
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 16:50:23 +01:00
Hidde Beydals
a260403334 Remove GitImplementation default
As the field in the CRD is optional.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 16:49:26 +01:00
Stefan Prodan
6396b25886 Merge pull request #641 from jonaskello/patch-1
Link docs how to get zsh/fish/ps completion to work in getting-started
2021-01-15 15:12:11 +02:00
Jonas Kello
ca480164b7 Merge branch 'main' into patch-1 2021-01-15 13:55:42 +01:00
Jonas Kello
714f9df3cf Link docs how to get zsh completion to work in getting-started
I tried to make completions work in zsh by just adding the same code as for the bash example but of course switching bash for zsh but it did not work. When I googled and dug deeper I finally found the answer in the deeper docs here:

https://github.com/fluxcd/flux2/blob/main/docs/cmd/flux_completion_zsh.md

The command in there works if I add it to my .zshrc file. I think linking to these specific docs may prevent others from just assuming it will work the same in zsh.

Signed-off-by: Jonas Kello <jonas.kello@gmail.com>
2021-01-15 13:17:29 +01:00
Hidde Beydals
6a7f1e7d48 Merge pull request #714 from fluxcd/tag-filter 2021-01-15 12:32:07 +01:00
Stefan Prodan
bcdce02b78 Add image tags regex filter arg to policy command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-15 13:24:59 +02:00
Stefan Prodan
2f0835b655 Make branch arg required for image updates
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-15 13:22:43 +02:00
Hidde Beydals
36bafa23df Merge pull request #709 from SomtochiAma/gcp-kms-docs
Add GCP docs for Mozilla SOPS
2021-01-15 12:21:59 +01:00
Somtochi Onyekwere
db611549f2 Add GCP docs for Mozilla SOPS
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-15 12:13:00 +01:00
Hidde Beydals
5d4cdcc207 Merge pull request #713 from fluxcd/doc-fixes
docs: styling of hint blocks
2021-01-15 12:12:32 +01:00
Hidde Beydals
a3b9c094b6 docs: styling of hint blocks
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 12:03:55 +01:00
Hidde Beydals
f82174adae Merge pull request #680 from fluxcd/goreleaser-project-name
Configure `project_name` for GoReleaser
2021-01-15 12:01:55 +01:00
Hidde Beydals
c7080d2834 Configure project_name for GoReleaser
This causes the format of the checksum file generated during the release
to change from `flux2_*_checksums.txt` to `flux_*_checksums.txt`.

The configuration change is made through `project_name` and not via the
`checksum.name_template` setting, because a single checksum file is
generated during the release process.

The download and/or installation script in `install/flux.sh` has been
adapted to assume the new filename starting with MINOR version `0.6.0`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 11:54:18 +01:00
Stefan Prodan
381127d413 Merge pull request #712 from fluxcd/reconcile-request-annotation
Use reconcile request annotation
2021-01-15 12:49:56 +02:00
Stefan Prodan
f6fa468acb Use reconcile request annotation
Replace deprecated `ReconcileAtAnnotation` annotation with `ReconcileRequestAnnotation`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-15 12:41:13 +02:00
Hidde Beydals
9228130f92 Merge pull request #684 from fluxcd/multi-arch-image
Deprecate arch flags in favor of multi-arch images
2021-01-15 11:40:24 +01:00
Hidde Beydals
207c50ceac Deprecate arch flags in favor of multi-arch images
This commit deprecates the architecture flag (`--arch`) for the install
and bootstrap commands, in favor of the bundled multi-arch images that
will be available for the next MINOR range of GOTK controller releases.

Summary of changes:

* `*Arch` variables have been marked as deprecated for both commands.
* `-arm64` suffix is no longer selectively added to the image definition
  of a component's `Deployment`.
* `kubernetes.io/arch` node selector with the defined value has been
  removed from the components' `Deployment`s.
* `Arch` has been removed from the available `Options` in
  `manifestgen/install`.
* Documentation references have been changed to highlight existence
  of multi-arch images and supported architectures.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-15 11:25:20 +01:00
Hidde Beydals
c3255a6e1e Merge pull request #711 from fluxcd/image-policy-e2e 2021-01-15 11:24:51 +01:00
Stefan Prodan
5e1c93a167 Add e2e tests for image repository and policy
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-15 12:03:47 +02:00
Hidde Beydals
43c33a0cc3 Merge pull request #686 from fluxcd/update-components
Update toolkit components
2021-01-15 11:02:14 +01:00
fluxcdbot
f5117329e4 Update toolkit components 2021-01-15 09:49:23 +00:00
Hidde Beydals
f7c62d12a5 Merge pull request #651 from Sijoma/main
Typo fix in image-update documentation
2021-01-15 10:43:12 +01:00
Simon Zengerling
fe5f181706 fix(image-update.md): typo maker => marker
Signed-off-by: Simon Zengerling <simon.zengerling@lht.dlh.de>
2021-01-15 10:26:28 +01:00
Stefan Prodan
cc09b29a2e Merge pull request #705 from SomtochiAma/custom-domain-gitlab
Update pkg/git to v0.2.1
2021-01-15 09:49:05 +02:00
Somtochi Onyekwere
406601eead Update pkg/git to v0.2.2
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-14 20:15:17 +01:00
Stefan Prodan
341d860c51 Merge pull request #708 from fluxcd/allow-egress-between-flux-pods
Allow egress traffic for controller pods
2021-01-14 14:17:15 +02:00
Stefan Prodan
8214bb8e33 Allow egress traffic for controller pods
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-14 13:38:38 +02:00
Stefan Prodan
884e3c678c Merge pull request #702 from fluxcd/feature/git-implementation
Add git implementation to generate sync options
2021-01-14 10:49:37 +02:00
Philip Laine
3b249dfe69 Change default to use const
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-14 00:21:59 +01:00
Philip Laine
d236a9af57 Add git implementation to generate sync options
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-13 23:44:29 +01:00
Hidde Beydals
ad9b0ae067 Merge pull request #698 from staceypotter/patch-6
Moved 11 Jan talk from Upcoming to Featured
2021-01-13 19:47:33 +01:00
Stacey Potter
31f166cd02 Moved 11 Jan talk from Upcoming to Featured
Updated and moved this from Upcoming Events: 
- 11 Jan 2021 - [Helm + GitOps = ️ with Scott Rigby](https://www.meetup.com/GitOps-Community/events/275348736/)

To this in Featured Talks:
- 11 Jan 2021 - [Helm + GitOps = ️ with Scott Rigby](https://youtu.be/YG8jMFrYQvM)

Signed-off-by: Stacey Potter <50154848+staceypotter@users.noreply.github.com>
2021-01-13 16:33:42 +01:00
Hidde Beydals
5685ebc3a5 Merge pull request #678 from staceypotter/patch-5
Added Jan 25 Meetup to Upcoming Events section
2021-01-13 16:32:39 +01:00
Stacey Potter
46bcf5da33 Added Jan 25 Meetup to Upcoming Events section
Signed-off-by: Stacey Potter <50154848+staceypotter@users.noreply.github.com>
2021-01-13 15:49:35 +01:00
Michael Bridgen
1784d15f36 Merge pull request #696 from fluxcd/controller-runtime-070
Update to controller-runtime 0.7.0
2021-01-13 11:50:58 +00:00
Michael Bridgen
cafce536bb Rename asRuntime* -> asClient*
For the avoidance of misdirection.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-13 11:38:02 +00:00
Michael Bridgen
d03280a12f Update to controller-runtime 0.7.0
controller-runtime methods now accept `client.Object` and
`client.ObjectList` rather than `runtime.Object`. This means the
adapter interfaces need to change signature, but happily, little else.

Since the list adapter is now distinct to the object adapter, `len()`
can go there instead of the command-specific interfaces.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-13 11:25:40 +00:00
Stefan Prodan
b30ef523f8 Merge pull request #688 from SomtochiAma/gcp-docs
Add GCR auth to image update guide
2021-01-13 12:25:32 +02:00
Somtochi Onyekwere
a6a303629a Add doc for authenticating gcr
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-13 11:15:13 +01:00
Stefan Prodan
61e79ef793 Merge pull request #694 from fluxcd/fix-hr-docs
Remove deprecated source behaviour
2021-01-13 11:45:39 +02:00
Stefan Prodan
f632abd8fa Remove deprecated source behaviour
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-13 11:26:00 +02:00
Philip Laine
c3911fe490 Merge pull request #668 from fluxcd/update/commit-status-guide
Update commit status notification guide
2021-01-12 22:52:59 +01:00
Philip Laine
505701e1c6 Fix cluster path in examples
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-12 22:15:51 +01:00
Philip Laine
67643e7487 Minimize deployment yaml
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-12 15:21:28 +01:00
Philip Laine
a962c17adb Add gitlab screenshots
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-12 15:21:28 +01:00
Philip Laine
479b4b5859 Update commit status notification guide
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-12 15:21:28 +01:00
Hidde Beydals
57f8cf85ca Merge pull request #687 from Kissy/main
docs: update sealed-secrets chart URL
2021-01-12 15:16:05 +01:00
Guillaume Le Biller
dd2c20b225 Update sealed-secrets chart URL
Signed-off-by: Guillaume Le Biller <glebiller@Traveldoo.com>
2021-01-12 15:03:03 +01:00
Stefan Prodan
9da427a515 Merge pull request #682 from SomtochiAma/multiple-config-files
Check for multiple files in KUBECONFIG variable
2021-01-12 11:39:53 +02:00
Somtochi Onyekwere
604773e866 check for multiple files in KUBECONFIG variable
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-12 10:26:29 +01:00
Hidde Beydals
1331f5260a Merge pull request #683 from fluxcd/fix-azure-url
Fix Azure DevOps URL in docs
2021-01-11 20:13:24 +01:00
Stefan Prodan
65d0f3569c Fix Azure DevOps URL in docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-11 19:51:00 +02:00
Stefan Prodan
ba522877ec Merge pull request #681 from SomtochiAma/gitlab-path
Fix GitLab bootstrap when used with sub-groups
2021-01-11 17:36:18 +02:00
Somtochi Onyekwere
4b63ccf140 Update fluxcd/pkg/git
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-11 16:17:07 +01:00
Somtochi Onyekwere
4fcf93306a Gets actual path for owner
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-11 15:02:02 +01:00
Hidde Beydals
96d8ec2016 Merge pull request #679 from staceypotter/patch-4
Added Jan 25 Meetup to Upcoming Events section
2021-01-11 09:55:59 +01:00
Stacey Potter
3697a5e348 Added Jan 25 Meetup to Upcoming Events section
Signed-off-by: Stacey Potter <50154848+staceypotter@users.noreply.github.com>
2021-01-10 14:07:09 -05:00
Stefan Prodan
084c587c0e Merge pull request #675 from fluxcd/docs-fixes
Add generated manifests to get started guide
2021-01-08 17:57:09 +02:00
Stefan Prodan
dcb505045e Add generated manifests to get started guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-08 17:46:00 +02:00
Stefan Prodan
0aeb3128ed Fix semver range prerelease examples
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-08 17:45:31 +02:00
Stefan Prodan
c61cfcbd18 Merge pull request #608 from SomtochiAma/getting-started-guide
Simplify the getting started guide
2021-01-08 16:16:07 +02:00
Somtochi Onyekwere
eba2dd36e0 Update getting started guide
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-08 14:46:49 +01:00
Stefan Prodan
2a75754561 Merge pull request #673 from fluxcd/doc-signoff
Add DCO signoff ref to contributing doc
2021-01-08 13:52:09 +02:00
Stefan Prodan
d03944893d Add DCO signoff ref to contributing doc
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-08 13:12:07 +02:00
Stefan Prodan
884c6ebd37 Merge pull request #672 from fluxcd/create-secret-helm
Add create secret helm command
2021-01-08 12:51:34 +02:00
Stefan Prodan
331ac3f031 Add create secret helm command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-08 12:36:11 +02:00
Stefan Prodan
ccc84a8367 Merge pull request #671 from SomtochiAma/incorrect-tf-path
Fix manifests path on Windows
2021-01-08 12:23:31 +02:00
Somtochi Onyekwere
daeb41c31b Uses path instead of filepath
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-08 11:13:27 +01:00
Stefan Prodan
17bda9c110 Merge pull request #670 from fluxcd/fix-secret-git
Map ecdsa/ed25519 args to create secret
2021-01-08 11:34:20 +02:00
Stefan Prodan
febedaad8f Map ecdsa/ed25519 args to create secret
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-08 11:20:36 +02:00
Stefan Prodan
d1357dff1f Merge pull request #664 from fluxcd/source-watcher
Update dev guide to point to fluxcd/source-watcher
2021-01-07 14:35:45 +02:00
Stefan Prodan
102552427f Update dev guide to point to fluxcd/source-watcher
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-07 14:19:19 +02:00
Michael Bridgen
f33898265d Merge pull request #663 from fluxcd/update-img-roadmap
Cross off tasks in the image automation roadmap
2021-01-07 12:06:04 +00:00
Michael Bridgen
57bdaf939a Cross off tasks in the image automation roadmap
Specifically:
 - integration into `flux` CLI
 - guide to how to use the controllers

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-07 11:45:46 +00:00
Stefan Prodan
981fed111b Merge pull request #660 from SomtochiAma/check-bootstrap-path
Checks if bootstrap path differs
2021-01-07 12:08:54 +02:00
Somtochi Onyekwere
3a4a2002d4 Corrects typo
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-07 10:44:40 +01:00
Somtochi Onyekwere
b8d4af5538 Inform user of path being used
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-07 10:30:17 +01:00
Somtochi Onyekwere
0646538cef Checks if bootstrap path differs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-07 10:22:13 +01:00
Stefan Prodan
70a87247e2 Merge pull request #658 from SomtochiAma/incorrect-windows-file-path
Coverts backward slash to forward slash in path flag
2021-01-07 11:17:51 +02:00
Somtochi Onyekwere
61129c6b6a Coverts backward slash to forward slash in path flag
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-07 09:29:37 +01:00
Aurel Canciu
c158f95130 Merge pull request #657 from fluxcd/image-repo-auth-docs
Add documentation for ECR authentication
2021-01-06 18:38:41 +02:00
Aurel Canciu
ad90d37f14 Add documentation for ECR authentication
Document a workaround solution for users to rely on until native image
repository authentication is implemented for supported cloud providers.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-01-06 18:19:51 +02:00
Stefan Prodan
73ba754481 Merge pull request #656 from pepesenaris/patch-1
Minor fixes to core concepts doc
2021-01-06 17:53:18 +02:00
Jose Javier Señaris
7dcfbdbb29 Minor fixes
Fix small typo.
Added verb to make the intent clear
Added spaces before "(" to match the same pattern used in other parts of the docs

Signed-off-by: Jose Javier Senaris Carballo <pepe.senaris@alayacare.com>
2021-01-06 10:44:32 -05:00
Philip Laine
f453507fcc Merge pull request #654 from fluxcd/update/helm-cloud-storage
Update helm release guide
2021-01-06 14:25:56 +01:00
Philip Laine
c5465de000 Update helm release guide with how to use cloud storage backends
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-01-06 12:35:45 +01:00
Stefan Prodan
352b864636 Merge pull request #652 from fluxcd/update-components
Update image-automation-controller to v0.2.0
2021-01-06 12:19:23 +02:00
fluxcdbot
c034befbb5 Update toolkit components 2021-01-06 09:59:33 +00:00
Stefan Prodan
572cdf40fc Merge pull request #649 from staceypotter/patch-4
Update upcoming events & featured talks section
2021-01-06 10:27:46 +02:00
Stacey Potter
0c0d353e9c Update upcoming events & featured talks section
Put things in chronological order, added new events, moved old ones, switched order of the 2 sections to match fluxcd/flux2 

Signed-off-by: Stacey Potter <50154848+staceypotter@users.noreply.github.com>
2021-01-05 13:21:20 -05:00
Daniel Holbach
bcc90afba2 Merge pull request #640 from staceypotter/patch-4
Updated Upcoming Events & Featured Talks sections
2021-01-05 17:35:18 +01:00
Stacey Potter
a919703011 Update Upcoming Events & Featured Talks sections
Sorted 'featured talks' chronologically, moved Dec 14 talk from upcoming to featured section with video link, added Scott's upcoming Helm talk in Jan 2021.
Added 2-Nov-2020 video that was missing

Signed-off-by: Stacey Potter <50154848+staceypotter@users.noreply.github.com>
2021-01-05 09:04:02 -07:00
Stefan Prodan
3300a45c39 Merge pull request #648 from SomtochiAma/validate-project-name
Validates project name for gitlab
2021-01-05 16:04:34 +02:00
Somtochi Onyekwere
f1cfae8f26 Validates project name for gitlab
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-05 14:37:49 +01:00
Stefan Prodan
62763961be Merge pull request #600 from SomtochiAma/core-concepts-docs
Add core concepts to docs
2021-01-05 12:45:09 +02:00
Somtochi Onyekwere
f1dab2279d Small nits
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-05 11:36:51 +01:00
Somtochi Onyekwere
ea337cf839 Initial docs for core concepts
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-05 11:30:22 +01:00
Stefan Prodan
27277136f8 Merge pull request #647 from SomtochiAma/validate-components
Validates components set
2021-01-05 12:05:36 +02:00
Somtochi Onyekwere
dd0b807fe4 Validates components set
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-05 10:52:11 +01:00
Michael Bridgen
ed09dd57b6 Merge pull request #646 from fluxcd/auto-docs-correction
Make sure flux create output gets redirected to file
2021-01-04 15:17:39 +00:00
Michael Bridgen
58b4c980c1 Make sure flux create output gets redirected to file
(i.e.: a missing `>`)

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-04 15:00:17 +00:00
Hidde Beydals
dd5165dcbf Merge pull request #624 from fluxcd/update-components
Update toolkit components
2020-12-18 15:45:00 +01:00
fluxcdbot
6da22613fe Update toolkit components 2020-12-18 14:36:18 +00:00
Hidde Beydals
d0926776a5 Merge pull request #627 from fluxcd/doc-targetpath-escape-note
docs: add note about `TargetPath` and JSON values
2020-12-18 15:35:13 +01:00
Hidde Beydals
14dc39e8d2 docs: add note about TargetPath and JSON values
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-18 15:12:44 +01:00
Hidde Beydals
f0f2a79384 Merge pull request #622 from vterdunov/patch-1 2020-12-18 14:19:19 +01:00
Hidde Beydals
7b6f875920 docs: 'like so' -> 'as in the following example'
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-18 14:00:52 +01:00
Terdunov Vyacheslav
52cec044b8 Fix typo
Signed-off-by: Terdunov Vyacheslav <mail2slick@gmail.com>
2020-12-18 14:00:52 +01:00
Hidde Beydals
07dd59892f Merge pull request #623 from fluxcd/e2e-timeout
Set e2e uninstall timeout to 10m
2020-12-18 14:00:29 +01:00
Stefan Prodan
ffeaa683c5 Set e2e uninstall timeout to 10m
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-18 13:50:15 +01:00
Hidde Beydals
1301bf7c15 Merge pull request #617 from alexei-led/main
Support check command with multiple config files
2020-12-18 12:13:12 +01:00
Alexei Ledenev
69387fd2a4 Support check command with multiple config files
Resolves: #472
Signed-off-by: Alexei Ledenev <alexei.led@gmail.com>
2020-12-18 12:13:57 +02:00
Stefan Prodan
12a0ebe3ba Merge pull request #619 from fluxcd/pat-hint
Add note about deploy key linked to pat
2020-12-17 16:20:57 +02:00
Philip Laine
3de81827eb Move hint to github guide
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-12-17 14:57:55 +01:00
Philip Laine
a7362b60e7 Add note about deploy key linked to pat
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-12-17 14:54:08 +01:00
Stefan Prodan
5d4bb3a43f Merge pull request #618 from fluxcd/kustomize-helm-e2e
Add e2e test for flux2-kustomize-helm-example
2020-12-17 15:50:10 +02:00
Stefan Prodan
d02d507812 Add e2e test for flux2-kustomize-helm-example
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-17 14:57:47 +02:00
Stefan Prodan
554de7ba6f Merge pull request #616 from fluxcd/fix-action-binary
Move flux binary to GitHub workspace
2020-12-17 14:42:42 +02:00
Stefan Prodan
5d9ccc973d Move flux binary to GitHub workspace
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-17 14:26:35 +02:00
Stefan Prodan
53ffb8aa00 Merge pull request #615 from fluxcd/flux-action-docs-ignore
Add note about ignoring flux action binary
2020-12-17 14:16:43 +02:00
Stefan Prodan
c4da4a81aa Add note about ignoring flux action binary
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-17 13:34:39 +02:00
Hidde Beydals
b824ea8858 Merge pull request #612 from fluxcd/docs/zsh-completion-example
Fix zsh completion command example
2020-12-17 09:48:46 +01:00
Hidde Beydals
22e26efec1 Fix zsh completion command example
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-16 21:15:41 +01:00
Hidde Beydals
679490e8f4 Merge pull request #610 from fluxcd/update-components
Update toolkit components
2020-12-16 17:25:33 +01:00
fluxcdbot
15f17ed36d Update toolkit components 2020-12-16 16:12:25 +00:00
Hidde Beydals
c8265fb80c Merge pull request #607 from fluxcd/docs-fix-image-updates-branch
Add branch to image automation docs
2020-12-15 12:19:28 +01:00
Stefan Prodan
3883e92631 Add branch to image automation docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-15 12:23:55 +02:00
Stefan Prodan
aa9bc4ce8b Merge pull request #606 from fluxcd/update-components
Update kustomize-controller to v0.5.1
2020-12-14 19:10:30 +02:00
fluxcdbot
37c14e8088 Update toolkit components 2020-12-14 16:58:51 +00:00
Hidde Beydals
439fbafc01 Merge pull request #605 from fluxcd/case-insensitive-selector-args
Make resource selector args case insensitive
2020-12-14 17:50:46 +01:00
Hidde Beydals
1b8e980519 Make resource selector args case insensitive
So that `<kind>/<name>` flags can be supplied as:

* `secret/foo`
* `Secret/foo`
* `SeCrEt/foo`

But result in: `Secret/foo`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-14 17:39:25 +01:00
Hidde Beydals
567acb6291 Merge pull request #604 from fluxcd/flags-tests
Add tests for CLI flags
2020-12-14 16:57:55 +01:00
Hidde Beydals
996bfe87ff Add tests for CLI flags
This includes various bug fixes, especially around the area of missing
names for `<kind>/<name>` formats.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-14 16:47:46 +01:00
Hidde Beydals
3c1793b6c5 Merge pull request #603 from fluxcd/fix-azure-devops-docs 2020-12-14 16:47:24 +01:00
Stefan Prodan
1a7f253767 Fix Azure DevOps SSH URL in docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-14 17:40:40 +02:00
Hidde Beydals
f188e59b21 Merge pull request #602 from fluxcd/safe-rel-path
Add safe guards for relative paths
2020-12-14 15:23:13 +01:00
Hidde Beydals
5ea4e814f5 Add safe guards for relative paths
This commit adds multiple safe guards for relative paths, ensuring they
never traverse outside the working directory.

The `SafeRelativePath` flag calculates the safe relative path based on a
relative base dir, which results in a flattened path.

The write methods of `manifestgen` make use of the `SecureJoin` as well,
to ensure writes are never outside of the given directory when used as
a lib outside of the CLI.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-14 15:14:49 +01:00
Stefan Prodan
008b3b8408 Merge pull request #599 from fluxcd/docs-image-updates
Add image automation guide
2020-12-14 12:35:11 +02:00
Stefan Prodan
7ae3dee900 Add image automation guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-14 11:19:03 +02:00
Stefan Prodan
2395ab6e14 Merge pull request #597 from fluxcd/fix-cluster-domain
Fix cluster domain mapping
2020-12-13 16:48:59 +02:00
Stefan Prodan
8efe053ffa Fix cluster domain mapping
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-13 16:35:19 +02:00
Stefan Prodan
612600b88c Merge pull request #595 from L3o-pold/add-cluster-domain-bootstrap-option
Add cluster-domain option for bootstrap command
2020-12-12 17:46:17 +02:00
Léopold Jacquot
4d7df52dbe Add cluster-domain option for bootstrap command
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
2020-12-12 16:37:05 +01:00
Stefan Prodan
b6c63a1aa4 Merge pull request #594 from fluxcd/update-components
Update source-controller to v0.5.4
2020-12-12 16:38:50 +02:00
fluxcdbot
a4788ce6bb Update toolkit components 2020-12-12 13:11:45 +00:00
Michael Bridgen
0ba6fc1b36 Merge pull request #538 from fluxcd/image-controller-commands
Add commands for image automation API
2020-12-11 16:45:36 +00:00
Michael Bridgen
0e35c209d9 Factor out upsert and upsertAndWait
It's a common pattern in the create commands to construct a value,
then (if not exporting it) upsert it and wait for it to
reconcile. This commit factors `upsert`, which does the update/insert
bit, and `upsertAndWait`, which does the whole thing.

Since these output messages, they are methods of `apiType` (previously
`names`), so that they have access to the name of the kind they are
operating on.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
3b9b2cbe9f Reuse isReady from create_image commands
I implemented the isReady procedure for adapters for resume -- use it
in create too.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
45240bdb71 Rename "auto" subcommands to "image"
This means all the sub-subcommands can drop the `image-` prefix,
making them shorter and more fluent.

E.g.,

    flux create image policy

rather than

    flux create auto image-policy

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
22a5ac7f0f Standardise the names of types
Most commands use either a kind, or a more readable spelling of a
kind, in their output. To make this easier, this centralises the
definition of those names in one place, and lets the command
implementations choose whichever they need.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
d55d185044 Implement suspend, resume, reconcile image-update
.. and refactor. These are all amenable to the adapter refactoring
that has served well so far.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
2bb09697ce Centralise adapter types
Since the generic commands tend to share a few of the methods they
need -- at least AsClientObject -- it's worth having just one wrapper
struct for each API type, and adding methods to it where necessary.

For the automation types, I put these in auto.go.

While doing this I also did some tidying:

 - I changed the name of the wrappers to `<type>Adapter`, and the
   generic adapter to `universalAdapter` (it's only needed for delete,
   so far).

 - I de-exported and renamed some interface methods e.g.,
   `exportItem`. They aren't needed outside the package.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
f316aff2d3 Add delete, export, get image-update
This uses the established abstractions to implement the usual
subcommands for the ImageUpdateAutomation type.

I've called the sub-subcommand in each case `image-update`, as a
fairly safe shorthand for the much longer `image-update-automation`.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
433628791b Add create auto image-update command
This adds the create subcommand, without attempting any refactoring.

NB the TODO: the image/v1alpha1 API does not yet export a const for
the name of the kind. The field `RunInterval` will likely be changed
to `Interval` (with a value field), at some point, too.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
4f52b77563 Factor out export command control flow
The export command works the same way for most (all?) types. I have
made it generic and moved it into export.go, then ported
{export,create}_auto_image{repository,policy}.go to use it.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
52145c045d Add delete image-policy and refactor
This adds a command for deleting ImagePolicy objects. Since the
control flow for the command needs only a runtime.Object (and a name
for the type), it can be factored out.

I have made the argument (field in the deleteCommand struct) an
interface `objectContainer`, through which the command code gets a
`runtime.Object` to deserialise into (and delete). It could be simply
a `runtime.Object` here; however things like `getCommand` require
other methods, so it's convenient to have an interface for it.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
512761080e Add get auto image-policy and refactor
This factors the get command implementation so that the control flow
is generic and relies on a handful of methods, then uses that to add
`get auto image-policy` and to rewrite `get auto image-repository`.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
037a5b71fd Add {create,export} auto image-policy
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:18 +00:00
Michael Bridgen
b66bdec61a Add subcommands for image-repository
This adds all the standard subcommands for the ImageRepository type.

Following `source`, I have put them under a namespace: `auto`,
referring to automation.

NB For `create` I use controllerutil.CreateOrUpdate, which looks to me
like a slightly more rounded version of the upsert* funcs.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 16:34:14 +00:00
Hidde Beydals
16f52610ab Merge pull request #589 from fluxcd/update-components
Update source-controller to v0.5.3
2020-12-11 17:14:49 +01:00
fluxcdbot
b2f018e29b Update toolkit components 2020-12-11 16:07:13 +00:00
Michael Bridgen
1f497cac44 Merge pull request #580 from fluxcd/install-image-controllers
Include image controller config in `flux install`
2020-12-11 15:22:51 +00:00
Michael Bridgen
4abe69f90a Give flux bootstrap the extra components flag
This commit adds a flag for supplying extra components to bootstrap
(and its subcommands), to match the one for `flux install`.

Since the bootstrapComponents global is used in a few places, I made
it a func and renamed the variable. For consistency, I also renamed
the var used in install.go.

Lastly, so that the flag sorts next to `--components`, I changed it to
`--components-extra` in both commands.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 15:08:19 +00:00
Michael Bridgen
75023011d3 Add argument for adding to default install
If you want to install the default set of controllers and the image-*
controllers, at present you have to list every single one of them.

An improvement on this is to let people specify what they want _in
addition_ to the default controllers. This commit adds an argument
`--extra-components` which appends to the (most likely, default value)
slice of `--components`.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 15:08:19 +00:00
Michael Bridgen
09f145d880 Add kustomizations for the image-* controllers
I have used the cookie-cutter from the examples already there.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 15:08:19 +00:00
Michael Bridgen
811cd4248f Include image-* controllers in update workflow
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-11 15:08:19 +00:00
Hidde Beydals
a4871724ac Merge pull request #587 from fluxcd/update-components
Update source-controller to v0.5.2
2020-12-11 15:24:35 +01:00
fluxcdbot
a7d6446d8f Update toolkit components 2020-12-11 14:17:20 +00:00
Stefan Prodan
635a17ef1e Merge pull request #586 from fluxcd/kustomize/api-v0.7.0
Update kustomize/api to v0.7.0
2020-12-11 16:16:10 +02:00
Stefan Prodan
6280fbce17 Update kustomize/api to v0.7.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-11 16:07:23 +02:00
Stefan Prodan
daa72e72b0 Merge pull request #585 from fluxcd/update-components
Update kustomize-controller to v0.5.0
2020-12-11 15:30:38 +02:00
fluxcdbot
35bb770697 Update toolkit components 2020-12-11 13:19:36 +00:00
Stefan Prodan
9cc5a7d8de Merge pull request #584 from fluxcd/docs-azure-devops
Rearrange Azure DevOps docs
2020-12-11 15:12:54 +02:00
Stefan Prodan
9b62f01b53 Rearrange Azure DevOps docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-11 14:52:19 +02:00
Stefan Prodan
a643a82006 Merge pull request #566 from fluxcd/feature/libgit2
Add git implementation flag and note about Azure DevOps
2020-12-11 13:58:53 +02:00
Philip Laine
82b74d8689 Add git implementation flag and note about Azure DevOps
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2020-12-11 12:10:30 +01:00
Hidde Beydals
a5825bb9f5 Merge pull request #581 from fluxcd/stdlogger
Log to stderr
2020-12-11 10:34:40 +01:00
Hidde Beydals
88a890d717 Log to stderr
This commit refactors the `printLogger` into a `stderrLogger` that
properly logs to `os.stderr` instead of `os.stdout`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-10 20:21:09 +01:00
Hidde Beydals
be6fab795d Merge pull request #578 from fluxcd/rel-base-path 2020-12-10 18:51:41 +01:00
Hidde Beydals
7a5b9e2991 Use rel filepath in auto generated kustomization
This works around another bug on Windows platforms that would cause the
kustomize-controller to choke on the kustomization.yaml generated by the
bootstrap command due to the filepath being in a Windows format.

By using `filepath.Rel`, the output is _just_ the filename for files
relative to the bootstrap path, which is at the moment sufficient to
make it work.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-10 18:37:01 +01:00
Hidde Beydals
ee1f70841c Use path rel to working dir for kustomize build
Work around for a bug in kustomize causing it to not properly
handle absolute paths on Windows.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-10 16:54:19 +01:00
Stefan Prodan
adc3d17eab Merge pull request #577 from fluxcd/update-git-pkg
Update fluxcd/pkg/git to v0.1.0
2020-12-10 15:05:16 +02:00
Stefan Prodan
f909d6fde2 Update fluxcd/pkg/git to v0.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-10 14:11:16 +02:00
Stefan Prodan
016a388147 Merge pull request #573 from fluxcd/update-components
Update toolkit components
2020-12-10 13:27:01 +02:00
fluxcdbot
aea442e7e1 Update toolkit components 2020-12-10 10:50:11 +00:00
Hidde Beydals
bb013ceb28 Merge pull request #576 from sylr/fix-typo
Fix typo in manifests download error message
2020-12-10 11:13:26 +01:00
Sylvain Rabot
dd65e9b89d Fix typo
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2020-12-10 11:00:54 +01:00
Stefan Prodan
12146eda8c Merge pull request #569 from fluxcd/fix-https-auth
Fix create secret for Git over HTTP/S
2020-12-09 18:15:49 +02:00
Stefan Prodan
cd87fbba0d Fix create secret for Git over HTTP/S
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-09 17:39:04 +02:00
Stefan Prodan
c73541f81f Merge pull request #567 from fluxcd/docs-kustomize-faq
Add Kustomize FAQ to docs
2020-12-09 12:03:49 +02:00
Stefan Prodan
4618998792 Add Kustomize FAQ to docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-09 11:27:25 +02:00
Stefan Prodan
0a3b581aa9 Merge pull request #565 from mewzherder/patch-7
Upcoming events and Featured talks: reorder & update
2020-12-09 08:58:31 +02:00
mewzherder
aaa319b9bf Upcoming events and Featured talks: reorder & update
Signed-off-by: mewzherder <tamao@weave.works>
2020-12-08 08:59:36 -08:00
Hidde Beydals
25e782177b Merge pull request #559 from fluxcd/prevent-aur-publish-parallel-run
Prevent AUR package publishing parallel execution
2020-12-07 14:13:32 +01:00
Aurel Canciu
e940fd3d1f Prevent AUR package publishing parallel execution
Using a lock to prevent parallel executions in GoReleaser's custom
publishers. The custom publisher logic executes the tasks in parallel
for each available artifact.

https://goreleaser.com/customization/publishers/#how-it-works

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-07 10:29:17 +02:00
Hidde Beydals
31d5cb4ad8 Merge pull request #557 from fluxcd/build/tmp-dir-rm
Properly clean-up package build dirs
2020-12-04 21:57:26 +01:00
Hidde Beydals
21576fe459 Properly clean-up package build dirs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-04 21:49:41 +01:00
Hidde Beydals
65863a2cb8 Merge pull request #556 from fluxcd/fix-goreleaser-aur-publish
Use mock archive for aur publishers
2020-12-04 21:19:47 +01:00
Aurel Canciu
cdd055bfa6 Use mock archive for aur publishers
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 22:10:52 +02:00
Hidde Beydals
fedf960a5f Merge pull request #555 from fluxcd/fix-goreleaser-aur-publish
Remove `ids` GoReleaser attr in AUR pkg publisher
2020-12-04 20:31:31 +01:00
Aurel Canciu
4546fa3270 Remove ids GoReleaser attr in AUR pkg publisher
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 21:22:13 +02:00
Hidde Beydals
979f3f557c Merge pull request #554 from fluxcd/fix-goreleaser-aur-publish
Fix GoReleaser AUR publish concurrent exec issue
2020-12-04 20:08:08 +01:00
Aurel Canciu
48a38a8a5d Fix GoReleaser AUR publish concurrent exec issue
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 20:59:55 +02:00
Stefan Prodan
9880b32b0a Merge pull request #553 from fluxcd/fix-goreleaser-aur-publish
Fix GoReleaser AUR package publishing
2020-12-04 20:17:50 +02:00
Aurel Canciu
e664ef7a8d Fix GoReleaser AUR package publishing
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 20:08:32 +02:00
Stefan Prodan
7cfef379d0 Merge pull request #552 from fluxcd/fix-workflow-syntax-error
Fix GitHub Actions release workflow syntax error
2020-12-04 19:46:13 +02:00
Aurel Canciu
093a91c7fc Fix syntax error introduced earlier
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 19:36:01 +02:00
Hidde Beydals
94687a047f Merge pull request #551 from fluxcd/update-components
Update helm-controller to v0.4.2
2020-12-04 18:04:30 +01:00
fluxcdbot
38fdc603ad Update toolkit components 2020-12-04 16:52:10 +00:00
Stefan Prodan
55cecb7f96 Merge pull request #550 from fluxcd/install-with-kubectl
Publish install manifest to GitHub releases
2020-12-04 18:51:01 +02:00
Stefan Prodan
32e949598e Publish install manifest to GitHub releases
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-04 18:33:26 +02:00
Stefan Prodan
6d0c8aff4b Merge pull request #549 from fluxcd/add-priv-key-secret-for-goreleaser
Add AUR_BOT_SSH_PRIVATE_KEY env var for goreleaser
2020-12-04 17:58:54 +02:00
Aurel Canciu
5eecf03af6 Add AUR_BOT_SSH_PRIVATE_KEY env var for goreleaser
The AUR_BOT_SSH_PRIVATE_KEY environment variable needs to be set in
goreleaser so publishing the packages to AUR can work.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 17:49:25 +02:00
Stefan Prodan
76e9884032 Merge pull request #547 from fluxcd/create-secret-git
Add create secret git command
2020-12-04 17:39:08 +02:00
Stefan Prodan
9867c4baf0 Add create secret git command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-04 16:54:13 +02:00
Stefan Prodan
2bc05c8cbd Merge pull request #548 from fluxcd/fix-md-aur-docs
Fix list parsing issue in the docs
2020-12-04 16:53:40 +02:00
Aurel Canciu
d15b0107e4 Fix list parsing issue in the docs
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:31:18 +02:00
Aurel Canciu
c64cb1304d Merge pull request #532 from fluxcd/aur-publish
Automated AUR publishing
2020-12-04 16:10:15 +02:00
Aurel Canciu
c1f209c7a5 Add information about the AUR packages to docs
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:01:33 +02:00
Aurel Canciu
116ccd6b3b Rename flux-git to flux-scm to prevent collision
A flux-git package already exists in AUR

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:01:32 +02:00
Aurel Canciu
b6f30ae3e1 Move aur package templates to .github/aur
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:01:32 +02:00
Aurel Canciu
5c522ed2e1 Add publisher scripts and gorelease config
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:01:32 +02:00
Aurel Canciu
bc29b80912 Add PKGBUILD templates
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-04 16:01:32 +02:00
Stefan Prodan
cfbc17fbf8 Merge pull request #546 from fluxcd/label-secrets
Add labels to generated secrets
2020-12-04 13:46:42 +02:00
Stefan Prodan
af0c939302 Add labels to generated secrets
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-04 13:15:37 +02:00
Michael Bridgen
e02538d38d Merge pull request #441 from fluxcd/component-readiness-indication
Show the roadmap status more prominently and precisely
2020-12-03 16:32:46 +00:00
Michael Bridgen
001d37567c Provide pointers to the install guides in roadmap
This gives people a way into the software, alongside the idea of how
ready it is.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-03 16:22:56 +00:00
Michael Bridgen
af82ce31a6 Bring image automation roadmap up to date
Specifically,

 - using credentials from a secret is done
 - the CLI integration is underway

I gave the %-complete a decent bump to reflect those, and all the work
on making the image-* controllers have all the GOTK dials and knobs
e.g., suspend.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-03 16:09:27 +00:00
Michael Bridgen
12ad4908fa Separate out "scans at all" from authentication
This makes it a clearer that the component does something worthwhile,
and is lacking mainly in platform-specific support.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-03 16:06:22 +00:00
Hidde Beydals
40ef94ab45 Merge pull request #522 from vfarcic/main
Add link to video review from Viktor Farcic
2020-12-01 14:37:22 +01:00
Viktor Farcic
8834ab0210 Video
Signed-off-by: Viktor Farcic <viktor@farcic.com>
2020-12-01 14:24:45 +01:00
Stefan Prodan
128d23720f Merge pull request #535 from fluxcd/gh-action-auto-updates
Automate Flux upgrades with GitHub Actions
2020-12-01 12:10:36 +02:00
Stefan Prodan
90f4891ca9 Automate Flux upgrades with GitHub Actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-01 11:16:26 +02:00
Stefan Prodan
61ac81c4d9 Merge pull request #534 from fluxcd/docs-bootstrap
Specify where to place Kubernetes manifests after bootstrap
2020-12-01 10:30:01 +02:00
Stefan Prodan
bd05a8173c Specify where to place Kubernetes manifests after bootstrap
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-01 09:46:28 +02:00
Hidde Beydals
e3d6461a80 Merge pull request #528 from fluxcd/update-components
Update helm-controller to v0.4.1
2020-11-30 13:21:29 +01:00
fluxcdbot
2bb582f7ed Update toolkit components 2020-11-30 12:10:44 +00:00
Stefan Prodan
2f9a52852f Merge pull request #527 from fluxcd/tenant-e2e
Add e2e test for create tenant
2020-11-30 12:25:31 +02:00
Stefan Prodan
137f083b4d Add e2e test for create tenant
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-30 12:16:01 +02:00
Stefan Prodan
11f4c54a40 Merge pull request #525 from fluxcd/fixes
Fix tenant and reconcile commands
2020-11-30 11:46:36 +02:00
Stefan Prodan
c813eaf6d1 Do not try to reconcile a suspended object
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-30 11:39:55 +02:00
Stefan Prodan
ffdaa9dfe9 Fix tenant service account binding
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-30 10:28:03 +02:00
Stefan Prodan
182928002b Merge pull request #526 from phillebaba/add-maintainer
Add Philip Laine to maintainer list
2020-11-30 10:27:29 +02:00
Philip Laine
7222af2b7e Add Philip Laine to maintainer list
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-11-29 19:17:51 +01:00
Stefan Prodan
034ead5272 Merge pull request #521 from fluxcd/improve-install-script-arch-detection
Improve installer list match for arm arches
2020-11-29 14:19:48 +02:00
Aurel Canciu
eca1f19e95 Improve installer list match for arm arches
`uname -m` will print out architecture codenames based on UTS_MACHINE
and COMPAT_UTS_MACHINE kernel defined constants. These extra values will
ensure the right version of the arm binary is installed on most Linux
systems running on ARM CPUs.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-11-27 19:38:06 +02:00
Michael Bridgen
ec70c14649 Merge pull request #520 from fluxcd/fluxv2-maintainers
Note the shared Flux v2 maintainers and team
2020-11-27 16:05:07 +00:00
Michael Bridgen
65d906a735 Note the shared Flux v2 maintainers and team
Many of the GitOps Toolkit controllers will share maintainers with
this repo, acting as the central Flux v2 repo. For convenience of
tracking membership and applying permissions, we can share maintainers
by:

 - referring to the MAINTAINERS file here, from elsewhere;
 - making a GitHub team that tracks those shared maintainers.

This commit makes a note of this in the MAINTAINERS file, to inform
people of the arrangement, and remind them to keep the team up to
date.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-27 12:44:17 +00:00
Stefan Prodan
b981bae1db Merge pull request #519 from fluxcd/service-account
Add service account arg to create commands
2020-11-27 12:28:25 +02:00
Stefan Prodan
d2df9ccf33 Add service account arg to create commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-27 12:20:55 +02:00
Stefan Prodan
5e51f51449 Merge pull request #518 from fluxcd/docs-upgrade
Add upgrade docs to install guide
2020-11-27 12:20:07 +02:00
Stefan Prodan
2c044a27e4 Add upgrade docs to install guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-27 08:44:34 +02:00
767 changed files with 42997 additions and 16170 deletions

84
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,84 @@
---
name: Bug report
description: Create a report to help us improve Flux
body:
- type: markdown
attributes:
value: |
## Support
Find out more about your support options and getting help at: https://fluxcd.io/support/
- type: textarea
validations:
required: true
attributes:
label: Describe the bug
description: A clear description of what the bug is.
- type: textarea
validations:
required: true
attributes:
label: Steps to reproduce
description: |
Steps to reproduce the problem.
placeholder: |
For example:
1. Install Flux with the additional image automation controllers
2. Run command '...'
3. See error
- type: textarea
validations:
required: true
attributes:
label: Expected behavior
description: A brief description of what you expected to happen.
- type: textarea
attributes:
label: Screenshots and recordings
description: |
If applicable, add screenshots to help explain your problem. You can also record an asciinema session: https://asciinema.org/
- type: input
validations:
required: true
attributes:
label: OS / Distro
description: The OS / distro you are executing `flux` on. If not applicable, write `N/A`.
placeholder: e.g. Windows 10, Ubuntu 20.04, Arch Linux, macOS 10.15...
- type: input
validations:
required: true
attributes:
label: Flux version
description: Run `flux version --client`. If not applicable, write `N/A`.
placeholder: e.g. v0.20.1
- type: textarea
validations:
required: true
attributes:
label: Flux check
description: Run `flux check`. If not applicable, write `N/A`.
placeholder: |
For example:
► checking prerequisites
✔ Kubernetes 1.21.1 >=1.19.0-0
► checking controllers
✔ all checks passed
- type: input
attributes:
label: Git provider
description: If applicable, add the Git provider you are having problems with, e.g. GitHub (Enterprise), GitLab, etc.
- type: input
attributes:
label: Container Registry provider
description: If applicable, add the Container Registry provider you are having problems with, e.g. DockerHub, GitHub Packages, Quay.io, etc.
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here. This can be logs (e.g. output from `flux logs`), environment specific caveats, etc.
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/fluxcd/.github/blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ask a question
url: https://github.com/fluxcd/flux2/discussions
about: Please ask and answer questions here.

19
.github/aur/flux-bin/.SRCINFO.template vendored Normal file
View File

@@ -0,0 +1,19 @@
pkgbase = flux-bin
pkgdesc = Open and extensible continuous delivery solution for Kubernetes
pkgver = ${PKGVER}
pkgrel = ${PKGREL}
url = https://fluxcd.io/
arch = x86_64
arch = armv7h
arch = aarch64
license = APACHE
optdepends = bash-completion: auto-completion for flux in Bash
optdepends = zsh-completions: auto-completion for flux in ZSH
source_x86_64 = flux-bin-${PKGVER}_linux_amd64.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_amd64.tar.gz
sha256sums_x86_64 = ${SHA256SUM_AMD64}
source_armv7h = flux-bin-${PKGVER}_linux_arm.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_arm.tar.gz
sha256sums_armv7h = ${SHA256SUM_ARM}
source_aarch64 = flux-bin-${PKGVER}_linux_arm64.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_arm64.tar.gz
sha256sums_aarch64 = ${SHA256SUM_ARM64}
pkgname = flux-bin

1
.github/aur/flux-bin/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.pkg

40
.github/aur/flux-bin/PKGBUILD.template vendored Normal file
View File

@@ -0,0 +1,40 @@
# Maintainer: Aurel Canciu <aurelcanciu@gmail.com>
# Maintainer: Hidde Beydals <hello@hidde.co>
pkgname=flux-bin
pkgver=${PKGVER}
pkgrel=${PKGREL}
_srcname=flux
_srcver=${VERSION}
pkgdesc="Open and extensible continuous delivery solution for Kubernetes"
url="https://fluxcd.io/"
arch=("x86_64" "armv7h" "aarch64")
license=("APACHE")
optdepends=('bash-completion: auto-completion for flux in Bash'
'zsh-completions: auto-completion for flux in ZSH')
source_x86_64=(
"${pkgname}-${pkgver}_linux_amd64.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${_srcver}/flux_${_srcver}_linux_amd64.tar.gz"
)
source_armv7h=(
"${pkgname}-${pkgver}_linux_arm.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${_srcver}/flux_${_srcver}_linux_arm.tar.gz"
)
source_aarch64=(
"${pkgname}-${pkgver}_linux_arm64.tar.gz::https://github.com/fluxcd/flux2/releases/download/v${_srcver}/flux_${_srcver}_linux_arm64.tar.gz"
)
sha256sums_x86_64=(
${SHA256SUM_AMD64}
)
sha256sums_armv7h=(
${SHA256SUM_ARM}
)
sha256sums_aarch64=(
${SHA256SUM_ARM64}
)
package() {
install -Dm755 ${_srcname} "${pkgdir}/usr/bin/${_srcname}"
"${pkgdir}/usr/bin/${_srcname}" completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/${_srcname}"
"${pkgdir}/usr/bin/${_srcname}" completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/${_srcname}.fish"
"${pkgdir}/usr/bin/${_srcname}" completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_${_srcname}"
}

56
.github/aur/flux-bin/publish.sh vendored Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e
WD=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)
PKGNAME=$(basename $WD)
ROOT=${WD%/.github/aur/$PKGNAME}
LOCKFILE=/tmp/aur-$PKGNAME.lock
exec 100>$LOCKFILE || exit 0
flock -n 100 || exit 0
trap "rm -f $LOCKFILE" EXIT
export VERSION=$1
echo "Publishing to AUR as version ${VERSION}"
cd $WD
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
eval $(ssh-agent -s)
ssh-add <(echo "$AUR_BOT_SSH_PRIVATE_KEY")
GITDIR=$(mktemp -d /tmp/aur-$PKGNAME-XXX)
trap "rm -rf $GITDIR" EXIT
git clone aur@aur.archlinux.org:$PKGNAME $GITDIR 2>&1
CURRENT_PKGVER=$(cat $GITDIR/.SRCINFO | grep pkgver | awk '{ print $3 }')
CURRENT_PKGREL=$(cat $GITDIR/.SRCINFO | grep pkgrel | awk '{ print $3 }')
# Transform pre-release to AUR compatible version format
export PKGVER=${VERSION/-/}
if [[ "${CURRENT_PKGVER}" == "${PKGVER}" ]]; then
export PKGREL=$((CURRENT_PKGREL+1))
else
export PKGREL=1
fi
export SHA256SUM_ARM=$(sha256sum ${ROOT}/dist/flux_${VERSION}_linux_arm.tar.gz | awk '{ print $1 }')
export SHA256SUM_ARM64=$(sha256sum ${ROOT}/dist/flux_${VERSION}_linux_arm64.tar.gz | awk '{ print $1 }')
export SHA256SUM_AMD64=$(sha256sum ${ROOT}/dist/flux_${VERSION}_linux_amd64.tar.gz | awk '{ print $1 }')
envsubst '$VERSION $PKGVER $PKGREL $SHA256SUM_AMD64 $SHA256SUM_ARM $SHA256SUM_ARM64' < .SRCINFO.template > $GITDIR/.SRCINFO
envsubst '$VERSION $PKGVER $PKGREL $SHA256SUM_AMD64 $SHA256SUM_ARM $SHA256SUM_ARM64' < PKGBUILD.template > $GITDIR/PKGBUILD
cd $GITDIR
git config user.name "fluxcdbot"
git config user.email "fluxcdbot@users.noreply.github.com"
git add -A
if [ -z "$(git status --porcelain)" ]; then
echo "No changes."
else
git commit -m "Updated to version v${PKGVER} release ${PKGREL}"
git push origin master
fi

17
.github/aur/flux-go/.SRCINFO.template vendored Normal file
View File

@@ -0,0 +1,17 @@
pkgbase = flux-go
pkgdesc = Open and extensible continuous delivery solution for Kubernetes
pkgver = ${PKGVER}
pkgrel = ${PKGREL}
url = https://fluxcd.io/
arch = x86_64
arch = armv7h
arch = aarch64
license = APACHE
makedepends = go
depends = glibc
provides = flux-bin
conflicts = flux-bin
replaces = flux-cli
source = flux-go-${PKGVER}.tar.gz::https://github.com/fluxcd/flux2/archive/v${VERSION}.tar.gz
pkgname = flux-go

1
.github/aur/flux-go/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.pkg

59
.github/aur/flux-go/PKGBUILD.template vendored Normal file
View File

@@ -0,0 +1,59 @@
# Maintainer: Aurel Canciu <aurelcanciu@gmail.com>
# Maintainer: Hidde Beydals <hello@hidde.co>
pkgname=flux-go
pkgver=${PKGVER}
pkgrel=${PKGREL}
_srcname=flux
_srcver=${VERSION}
pkgdesc="Open and extensible continuous delivery solution for Kubernetes"
url="https://fluxcd.io/"
arch=("x86_64" "armv7h" "aarch64")
license=("APACHE")
provides=("flux-bin")
conflicts=("flux-bin")
replaces=("flux-cli")
depends=("glibc")
makedepends=('go>=1.20', 'kustomize>=5.0')
optdepends=('bash-completion: auto-completion for flux in Bash',
'zsh-completions: auto-completion for flux in ZSH')
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/fluxcd/flux2/archive/v${_srcver}.tar.gz"
)
sha256sums=(
${SHA256SUM}
)
build() {
cd "flux2-${_srcver}"
export CGO_LDFLAGS="$LDFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
make cmd/flux/.manifests.done
go build -ldflags "-linkmode=external -X main.VERSION=${_srcver}" -o ${_srcname} ./cmd/flux
}
check() {
cd "flux2-${_srcver}"
case $CARCH in
aarch64)
export ENVTEST_ARCH=arm64
;;
armv7h)
export ENVTEST_ARCH=arm
;;
esac
make test
}
package() {
cd "flux2-${_srcver}"
install -Dm755 ${_srcname} "${pkgdir}/usr/bin/${_srcname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
"${pkgdir}/usr/bin/${_srcname}" completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/${_srcname}"
"${pkgdir}/usr/bin/${_srcname}" completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/${_srcname}.fish"
"${pkgdir}/usr/bin/${_srcname}" completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_${_srcname}"
}

54
.github/aur/flux-go/publish.sh vendored Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -e
WD=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)
PKGNAME=$(basename $WD)
ROOT=${WD%/.github/aur/$PKGNAME}
LOCKFILE=/tmp/aur-$PKGNAME.lock
exec 100>$LOCKFILE || exit 0
flock -n 100 || exit 0
trap "rm -f $LOCKFILE" EXIT
export VERSION=$1
echo "Publishing to AUR as version ${VERSION}"
cd $WD
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
eval $(ssh-agent -s)
ssh-add <(echo "$AUR_BOT_SSH_PRIVATE_KEY")
GITDIR=$(mktemp -d /tmp/aur-$PKGNAME-XXX)
trap "rm -rf $GITDIR" EXIT
git clone aur@aur.archlinux.org:$PKGNAME $GITDIR 2>&1
CURRENT_PKGVER=$(cat $GITDIR/.SRCINFO | grep pkgver | awk '{ print $3 }')
CURRENT_PKGREL=$(cat $GITDIR/.SRCINFO | grep pkgrel | awk '{ print $3 }')
# Transform pre-release to AUR compatible version format
export PKGVER=${VERSION/-/}
if [[ "${CURRENT_PKGVER}" == "${PKGVER}" ]]; then
export PKGREL=$((CURRENT_PKGREL+1))
else
export PKGREL=1
fi
export SHA256SUM=$(curl -sL https://github.com/fluxcd/flux2/archive/v${VERSION}.tar.gz | sha256sum | awk '{ print $1 }')
envsubst '$VERSION $PKGVER $PKGREL $SHA256SUM' < .SRCINFO.template > $GITDIR/.SRCINFO
envsubst '$VERSION $PKGVER $PKGREL $SHA256SUM' < PKGBUILD.template > $GITDIR/PKGBUILD
cd $GITDIR
git config user.name "fluxcdbot"
git config user.email "fluxcdbot@users.noreply.github.com"
git add -A
if [ -z "$(git status --porcelain)" ]; then
echo "No changes."
else
git commit -m "Updated to version v${PKGVER} release ${PKGREL}"
git push origin master
fi

17
.github/aur/flux-scm/.SRCINFO.template vendored Normal file
View File

@@ -0,0 +1,17 @@
pkgbase = flux-scm
pkgdesc = Open and extensible continuous delivery solution for Kubernetes
pkgver = ${PKGVER}
pkgrel = ${PKGREL}
url = https://fluxcd.io/
arch = x86_64
arch = armv7h
arch = aarch64
license = APACHE
makedepends = go
depends = glibc
provides = flux-bin
conflicts = flux-bin
source = git+https://github.com/fluxcd/flux2.git
md5sums = SKIP
pkgname = flux-scm

1
.github/aur/flux-scm/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.pkg

60
.github/aur/flux-scm/PKGBUILD.template vendored Normal file
View File

@@ -0,0 +1,60 @@
# Maintainer: Aurel Canciu <aurelcanciu@gmail.com>
# Maintainer: Hidde Beydals <hello@hidde.co>
pkgname=flux-scm
pkgver=${PKGVER}
pkgrel=${PKGREL}
_srcname=flux
pkgdesc="Open and extensible continuous delivery solution for Kubernetes"
url="https://fluxcd.io/"
arch=("x86_64" "armv7h" "aarch64")
license=("APACHE")
provides=("flux-bin")
conflicts=("flux-bin")
depends=("glibc")
makedepends=('go>=1.20', 'kustomize>=5.0', 'git')
optdepends=('bash-completion: auto-completion for flux in Bash',
'zsh-completions: auto-completion for flux in ZSH')
source=(
"git+https://github.com/fluxcd/flux2.git"
)
md5sums=('SKIP')
pkgver() {
cd "flux2"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "flux2"
export CGO_LDFLAGS="$LDFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
make cmd/flux/.manifests.done
go build -ldflags "-linkmode=external -X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux
}
check() {
cd "flux2"
case $CARCH in
aarch64)
export ENVTEST_ARCH=arm64
;;
armv7h)
export ENVTEST_ARCH=arm
;;
esac
make test
}
package() {
cd "flux2"
install -Dm755 ${_srcname} "${pkgdir}/usr/bin/${_srcname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
"${pkgdir}/usr/bin/${_srcname}" completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/${_srcname}"
"${pkgdir}/usr/bin/${_srcname}" completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/${_srcname}.fish"
"${pkgdir}/usr/bin/${_srcname}" completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_${_srcname}"
}

52
.github/aur/flux-scm/publish.sh vendored Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -e
WD=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)
PKGNAME=$(basename $WD)
ROOT=${WD%/.github/aur/$PKGNAME}
LOCKFILE=/tmp/aur-$PKGNAME.lock
exec 100>$LOCKFILE || exit 0
flock -n 100 || exit 0
trap "rm -f $LOCKFILE" EXIT
export VERSION=$1
echo "Publishing to AUR as version ${VERSION}"
cd $WD
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
eval $(ssh-agent -s)
ssh-add <(echo "$AUR_BOT_SSH_PRIVATE_KEY")
GITDIR=$(mktemp -d /tmp/aur-$PKGNAME-XXX)
trap "rm -rf $GITDIR" EXIT
git clone aur@aur.archlinux.org:$PKGNAME $GITDIR 2>&1
CURRENT_PKGVER=$(cat $GITDIR/.SRCINFO | grep pkgver | awk '{ print $3 }')
CURRENT_PKGREL=$(cat $GITDIR/.SRCINFO | grep pkgrel | awk '{ print $3 }')
# Transform pre-release to AUR compatible version format
export PKGVER=${VERSION/-/}
if [[ "${CURRENT_PKGVER}" == "${PKGVER}" ]]; then
export PKGREL=$((CURRENT_PKGREL+1))
else
export PKGREL=1
fi
envsubst '$PKGVER $PKGREL' < .SRCINFO.template > $GITDIR/.SRCINFO
envsubst '$PKGVER $PKGREL' < PKGBUILD.template > $GITDIR/PKGBUILD
cd $GITDIR
git config user.name "fluxcdbot"
git config user.email "fluxcdbot@users.noreply.github.com"
git add -A
if [ -z "$(git status --porcelain)" ]; then
echo "No changes."
else
git commit -m "Updated to version v${PKGVER} release ${PKGREL}"
git push origin master
fi

16
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
labels: ["area/ci", "dependencies"]
groups:
# Group all updates together, so that they are all applied in a single PR.
# Grouped updates are currently in beta and is subject to change.
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
ci:
patterns:
- "*"
schedule:
# By default, this will be on a monday.
interval: "weekly"

5
.github/kind/config.yaml vendored Normal file
View File

@@ -0,0 +1,5 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
disableDefaultCNI: true # disable kindnet
podSubnet: 192.168.0.0/16 # set to Calico's default subnet

52
.github/labels.yaml vendored Normal file
View File

@@ -0,0 +1,52 @@
# Configuration file to declaratively configure labels
# Ref: https://github.com/EndBug/label-sync#Config-files
- name: area/bootstrap
description: Bootstrap related issues and pull requests
color: '#86efc9'
- name: area/install
description: Install and uninstall related issues and pull requests
color: '#86efc9'
- name: area/diff
description: Diff related issues and pull requests
color: '#BA4192'
- name: area/bucket
description: Bucket related issues and pull requests
color: '#00b140'
- name: area/git
description: Git related issues and pull requests
color: '#863faf'
- name: area/oci
description: OCI related issues and pull requests
color: '#c739ff'
- name: area/kustomization
description: Kustomization related issues and pull requests
color: '#00e54d'
- name: area/helm
description: Helm related issues and pull requests
color: '#1673b6'
- name: area/image-automation
description: Automated image updates related issues and pull requests
color: '#c5def5'
- name: area/monitoring
description: Monitoring related issues and pull requests
color: '#dd75ae'
- name: area/multi-tenancy
description: Multi-tenancy related issues and pull requests
color: '#72CDBD'
- name: area/notification
description: Notification API related issues and pull requests
color: '#434ec1'
- name: area/source
description: Source API related issues and pull requests
color: '#863faf'
- name: area/rfc
description: Feature request proposals in the RFC format
color: '#D621C3'
aliases: ['area/RFC']
- name: backport:release/v2.0.x
description: To be backported to release/v2.0.x
color: '#ffd700'
- name: backport:release/v2.1.x
description: To be backported to release/v2.1.x
color: '#ffd700'

80
.github/runners/README.md vendored Normal file
View File

@@ -0,0 +1,80 @@
# Flux ARM64 GitHub runners
The Flux ARM64 end-to-end tests run on Equinix Metal instances provisioned with Docker and GitHub self-hosted runners.
## Current instances
| Repository | Runner | Instance | Location |
|-----------------------------|------------------|------------------------|---------------|
| flux2 | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
| flux2 | equinix-arm-dc-2 | flux-equinix-arm-dc-01 | Washington DC |
| flux2 | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
| flux2 | equinix-arm-da-2 | flux-equinix-arm-da-01 | Dallas |
| source-controller | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
| source-controller | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
| image-automation-controller | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
| image-automation-controller | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
Instance spec:
- Ampere Altra Q80-30 80-core processor @ 2.8GHz
- 2 x 960GB NVME
- 256GB RAM
- 2 x 25Gbps
## Instance setup
In order to add a new runner to the GitHub Actions pool,
first create a server on Equinix with the following configuration:
- Type: `c3.large.arm64`
- OS: `Ubuntu 22.04 LTS`
### Install prerequisites
- SSH into a newly created instance
```shell
ssh root@<instance-public-IP>
```
- Create the ubuntu user
```shell
adduser ubuntu
usermod -aG sudo ubuntu
su - ubuntu
```
- Create the prerequisites dir
```shell
mkdir -p prereq && cd prereq
```
- Download the prerequisites script
```shell
curl -sL https://raw.githubusercontent.com/fluxcd/flux2/main/.github/runners/prereq.sh > prereq.sh \
&& chmod +x ./prereq.sh
```
- Install the prerequisites
```shell
sudo ./prereq.sh
```
### Install runners
- Retrieve the GitHub runner token from the repository [settings page](https://github.com/fluxcd/flux2/settings/actions/runners/new?arch=arm64&os=linux)
- Create two directories `flux2-01`, `flux2-02`
- In each dir run:
```shell
curl -sL https://raw.githubusercontent.com/fluxcd/flux2/main/.github/runners/runner-setup.sh > runner-setup.sh \
&& chmod +x ./runner-setup.sh
./runner-setup.sh equinix-arm-<NUMBER> <TOKEN> <REPO>
```
- Reboot the instance
```shell
sudo reboot
```
- Navigate to the GitHub repository [runners page](https://github.com/fluxcd/flux2/settings/actions/runners) and check the runner status

72
.github/runners/prereq.sh vendored Executable file
View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# Copyright 2021 The Flux authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script installs the prerequisites for running Flux end-to-end tests with Docker and GitHub self-hosted runners.
set -eu
KIND_VERSION=0.17.0
KUBECTL_VERSION=1.24.0
KUSTOMIZE_VERSION=4.5.7
HELM_VERSION=3.10.1
GITHUB_RUNNER_VERSION=2.298.2
PACKAGES="apt-transport-https ca-certificates software-properties-common build-essential libssl-dev gnupg lsb-release jq pkg-config"
# install prerequisites
apt-get update \
&& apt-get install -y -q ${PACKAGES} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# fix Kubernetes DNS resolution
rm /etc/resolv.conf
cat "/run/systemd/resolve/stub-resolv.conf" | sed '/search/d' > /etc/resolv.conf
# install docker
curl -fsSL https://get.docker.com -o get-docker.sh \
&& chmod +x get-docker.sh
./get-docker.sh
systemctl enable docker.service
systemctl enable containerd.service
usermod -aG docker ubuntu
# install kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-arm64
install -o root -g root -m 0755 kind /usr/local/bin/kind
# install kubectl
curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl"
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# install kustomize
curl -Lo ./kustomize.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_arm64.tar.gz \
&& tar -zxvf kustomize.tar.gz \
&& rm kustomize.tar.gz
install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize
# install helm
curl -Lo ./helm.tar.gz https://get.helm.sh/helm-v${HELM_VERSION}-linux-arm64.tar.gz \
&& tar -zxvf helm.tar.gz \
&& rm helm.tar.gz
install -o root -g root -m 0755 linux-arm64/helm /usr/local/bin/helm
# download runner
curl -o actions-runner-linux-arm64.tar.gz -L https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-arm64-${GITHUB_RUNNER_VERSION}.tar.gz \
&& tar xzf actions-runner-linux-arm64.tar.gz \
&& rm actions-runner-linux-arm64.tar.gz
# install runner dependencies
./bin/installdependencies.sh

37
.github/runners/runner-setup.sh vendored Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Copyright 2021 The Flux authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script installs a GitHub self-hosted ARM64 runner for running Flux end-to-end tests.
set -eu
RUNNER_NAME=$1
REPOSITORY_TOKEN=$2
REPOSITORY_URL=${3:-https://github.com/fluxcd/flux2}
GITHUB_RUNNER_VERSION=2.298.2
# download runner
curl -o actions-runner-linux-arm64.tar.gz -L https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-arm64-${GITHUB_RUNNER_VERSION}.tar.gz \
&& tar xzf actions-runner-linux-arm64.tar.gz \
&& rm actions-runner-linux-arm64.tar.gz
# register runner with GitHub
./config.sh --unattended --url ${REPOSITORY_URL} --token ${REPOSITORY_TOKEN} --name ${RUNNER_NAME}
# start runner
sudo ./svc.sh install
sudo ./svc.sh start

50
.github/workflows/README.md vendored Normal file
View File

@@ -0,0 +1,50 @@
# Flux GitHub Workflows
## End-to-end Testing
The e2e workflows run a series of tests to ensure that the Flux CLI and
the GitOps Toolkit controllers work well all together.
The tests are written in Go, Bash, Make and Terraform.
| Workflow | Jobs | Runner | Role |
|--------------------|----------------------|----------------|-----------------------------------------------|
| e2e.yaml | e2e-amd64-kubernetes | GitHub Ubuntu | integration testing with Kubernetes Kind<br/> |
| e2e-arm64.yaml | e2e-arm64-kubernetes | Equinix Ubuntu | integration testing with Kubernetes Kind<br/> |
| e2e-bootstrap.yaml | e2e-boostrap-github | GitHub Ubuntu | integration testing with GitHub API<br/> |
| e2e-azure.yaml | e2e-amd64-aks | GitHub Ubuntu | integration testing with Azure API<br/> |
| scan.yaml | scan-fossa | GitHub Ubuntu | license scanning<br/> |
| scan.yaml | scan-snyk | GitHub Ubuntu | vulnerability scanning<br/> |
| scan.yaml | scan-codeql | GitHub Ubuntu | vulnerability scanning<br/> |
## Components Update
The components update workflow scans the GitOps Toolkit controller repositories for new releases,
amd when it finds a new controller version, the workflow performs the following steps:
- Updates the controller API package version in `go.mod`.
- Patches the controller CRDs version in the `manifests/crds` overlay.
- Patches the controller Deployment version in `manifests/bases` overlay.
- Opens a Pull Request against the `main` branch.
- Triggers the e2e test suite to run for the opened PR.
| Workflow | Jobs | Runner | Role |
|-------------|-------------------|---------------|-----------------------------------------------------|
| update.yaml | update-components | GitHub Ubuntu | update the GitOps Toolkit APIs and controllers<br/> |
## Release
The release workflow is triggered by a semver Git tag and performs the following steps:
- Generates the Flux install manifests (YAML).
- Generates the OpenAPI validation schemas for the GitOps Toolkit CRDs (JSON).
- Generates a Software Bill of Materials (SPDX JSON).
- Builds the Flux CLI binaries and the multi-arch container images.
- Pushes the container images to GitHub Container Registry and DockerHub.
- Signs the sbom, the binaries checksum and the container images with Cosign and GitHub OIDC.
- Uploads the sbom, binaries, checksums and install manifests to GitHub Releases.
- Pushes the install manifests as OCI artifacts to GitHub Container Registry and DockerHub.
- Signs the OCI artifacts with Cosign and GitHub OIDC.
| Workflow | Jobs | Runner | Role |
|--------------|------------------------|---------------|------------------------------------------------------|
| release.yaml | release-flux-cli | GitHub Ubuntu | build, push and sign the CLI release artifacts<br/> |
| release.yaml | release-flux-manifests | GitHub Ubuntu | build, push and sign the Flux install manifests<br/> |

29
.github/workflows/action.yaml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: test-gh-action
on:
pull_request:
paths:
- 'action/**'
push:
paths:
- 'action/**'
branches:
- 'main'
- 'release/**'
permissions: read-all
jobs:
actions:
strategy:
fail-fast: false
matrix:
version: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.version }}
name: action on ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup flux
uses: ./action

31
.github/workflows/backport.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: backport
on:
pull_request_target:
types: [closed, labeled]
jobs:
pull-request:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
uses: korthout/backport-action@b982d297e31f500652b2246cf26714796312bd23 # v2.2.0
# xref: https://github.com/korthout/backport-action#inputs
with:
# Use token to allow workflows to be triggered for the created PR
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
# Match labels with a pattern `backport:<target-branch>`
label_pattern: '^backport:([^ ]+)$'
# A bit shorter pull-request title than the default
pull_title: '[${target_branch}] ${pull_title}'
# Simpler PR description than default
pull_description: |-
Automated backport to `${target_branch}`, triggered by a label in #${pull_number}.

View File

@@ -1,78 +0,0 @@
name: bootstrap
on:
push:
branches:
- '*'
jobs:
github:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Go cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Setup Kubernetes
uses: engineerd/setup-kind@v0.5.0
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build
run: sudo go build -o ./bin/flux ./cmd/flux
- name: bootstrap init
run: |
./bin/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
--branch=main \
--path=test-cluster
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: bootstrap no-op
run: |
./bin/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
--branch=main \
--path=test-cluster
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: uninstall
run: |
./bin/flux suspend kustomization flux-system
./bin/flux uninstall --resources --crds -s
- name: bootstrap reinstall
run: |
./bin/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
--branch=main \
--path=test-cluster
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: delete repository
run: |
./bin/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
--branch=main \
--path=test-cluster \
--delete
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: Debug failure
if: failure()
run: |
kubectl -n flux-system get all
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller

View File

@@ -1,65 +0,0 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- docs*
- main
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v1
- name: Copy assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
controller_version() {
sed -n "s/.*$1\/archive\/\(.*\).zip.*/\1/p;n" manifests/bases/$1/kustomization.yaml
}
{
# source-controller CRDs
SOURCE_VER=$(controller_version source-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/gitrepositories.md" > docs/components/source/gitrepositories.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmrepositories.md" > docs/components/source/helmrepositories.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmcharts.md" > docs/components/source/helmcharts.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/buckets.md" > docs/components/source/buckets.md
}
{
# kustomize-controller CRDs
KUSTOMIZE_VER=$(controller_version kustomize-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/api/kustomize.md" > docs/components/kustomize/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/spec/v1beta1/kustomization.md" > docs/components/kustomize/kustomization.md
}
{
# helm-controller CRDs
HELM_VER=$(controller_version helm-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/api/helmrelease.md" > docs/components/helm/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/spec/v2beta1/helmreleases.md" > docs/components/helm/helmreleases.md
}
{
# notification-controller CRDs
NOTIFICATION_VER=$(controller_version notification-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/api/notification.md" > docs/components/notification/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/event.md" > docs/components/notification/event.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/alert.md" > docs/components/notification/alert.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/provider.md" > docs/components/notification/provider.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/receiver.md" > docs/components/notification/receiver.md
}
{
# install script
cp install/flux.sh docs/install.sh
}
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_DOMAIN: toolkit.fluxcd.io

106
.github/workflows/e2e-arm64.yaml vendored Normal file
View File

@@ -0,0 +1,106 @@
name: e2e-arm64
on:
workflow_dispatch:
push:
branches: [ 'main', 'update-components', 'e2e-*', 'release/**' ]
permissions:
contents: read
jobs:
e2e-arm64-kubernetes:
# Hosted on Equinix
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
runs-on: [self-hosted, Linux, ARM64, equinix]
strategy:
matrix:
# Keep this list up-to-date with https://endoflife.date/kubernetes
# Check which versions are available on DockerHub with 'crane ls kindest/node'
KUBERNETES_VERSION: [ 1.25.11, 1.26.6, 1.27.3, 1.28.0 ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Prepare
id: prep
run: |
ID=${GITHUB_SHA:0:7}-${{ matrix.KUBERNETES_VERSION }}-$(date +%s)
echo "CLUSTER=arm64-${ID}" >> $GITHUB_OUTPUT
- name: Build
run: |
make build
- name: Setup Kubernetes Kind
run: |
kind create cluster \
--wait 5m \
--name ${{ steps.prep.outputs.CLUSTER }} \
--kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }} \
--image=kindest/node:v${{ matrix.KUBERNETES_VERSION }}
- name: Run e2e tests
run: TEST_KUBECONFIG=/tmp/${{ steps.prep.outputs.CLUSTER }} make e2e
- name: Run multi-tenancy tests
env:
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
run: |
./bin/flux install
./bin/flux create source git flux-system \
--interval=15m \
--url=https://github.com/fluxcd/flux2-multi-tenancy \
--branch=main \
--ignore-paths="./clusters/**/flux-system/"
./bin/flux create kustomization flux-system \
--interval=15m \
--source=flux-system \
--path=./clusters/staging
kubectl -n flux-system wait kustomization/tenants --for=condition=ready --timeout=5m
kubectl -n apps wait kustomization/dev-team --for=condition=ready --timeout=1m
kubectl -n apps wait helmrelease/podinfo --for=condition=ready --timeout=1m
- name: Run monitoring tests
# Keep this test in sync with https://fluxcd.io/flux/guides/monitoring/
env:
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
run: |
./bin/flux create source git flux-monitoring \
--interval=30m \
--url=https://github.com/fluxcd/flux2 \
--branch=${GITHUB_REF#refs/heads/}
./bin/flux create kustomization kube-prometheus-stack \
--interval=1h \
--prune \
--source=flux-monitoring \
--path="./manifests/monitoring/kube-prometheus-stack" \
--health-check-timeout=5m \
--wait
./bin/flux create kustomization monitoring-config \
--depends-on=kube-prometheus-stack \
--interval=1h \
--prune=true \
--source=flux-monitoring \
--path="./manifests/monitoring/monitoring-config" \
--health-check-timeout=1m \
--wait
kubectl -n flux-system wait kustomization/kube-prometheus-stack --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/monitoring-config --for=condition=ready --timeout=5m
kubectl -n monitoring wait helmrelease/kube-prometheus-stack --for=condition=ready --timeout=1m
- name: Debug failure
if: failure()
env:
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
run: |
kubectl -n flux-system get all
kubectl -n flux-system describe po
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller
- name: Cleanup
if: always()
run: |
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
rm /tmp/${{ steps.prep.outputs.CLUSTER }}

125
.github/workflows/e2e-azure.yaml vendored Normal file
View File

@@ -0,0 +1,125 @@
name: e2e-azure
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
push:
branches:
- main
paths:
- 'tests/**'
- '.github/workflows/e2e-azure.yaml'
pull_request:
branches:
- main
paths:
- 'tests/**'
- '.github/workflows/e2e-azure.yaml'
permissions:
contents: read
jobs:
e2e-amd64-aks:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./tests/azure
# This job is currently disabled. Remove the false check when Azure subscription is enabled.
if: false && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: tests/azure/go.sum
- name: Setup Flux CLI
run: |
make build
mkdir -p $HOME/.local/bin
mv ./bin/flux $HOME/.local/bin
working-directory: ./
- name: Setup SOPS
run: |
mkdir -p $HOME/.local/bin
wget https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux -O $HOME/.local/bin/sops
chmod +x $HOME/.local/bin/sops
- name: Setup Terraform
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v2
with:
terraform_version: 1.2.8
terraform_wrapper: false
- name: Setup Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Run Azure e2e tests
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
run: |
ls $HOME/.local/bin
az login --service-principal -u ${ARM_CLIENT_ID} -p ${ARM_CLIENT_SECRET} -t ${ARM_TENANT_ID}
go test -v -coverprofile cover.out -timeout 60m .
refactored-e2e-amd64-aks:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./tests/integration
# This job is currently disabled. Remove the false check when Azure subscription is enabled.
if: false && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
steps:
- name: CheckoutD
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: tests/integration/go.sum
- name: Setup Flux CLI
run: make build
working-directory: ./
- name: Setup SOPS
run: |
mkdir -p $HOME/.local/bin
wget -O $HOME/.local/bin/sops https://github.com/mozilla/sops/releases/download/v$SOPS_VER/sops-v$SOPS_VER.linux
chmod +x $HOME/.local/bin/sops
env:
SOPS_VER: 3.7.1
- name: Authenticate to Azure
uses: Azure/login@de95379fe4dadc2defb305917eaa7e5dde727294 # v1.4.6
with:
creds: '{"clientId":"${{ secrets.AZ_ARM_CLIENT_ID }}","clientSecret":"${{ secrets.AZ_ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZ_ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZ_ARM_TENANT_ID }}"}'
- name: Set dynamic variables in .env
run: |
cat > .env <<EOF
export TF_VAR_tags='{ "environment"="github", "ci"="true", "repo"="flux2", "createdat"="$(date -u +x%Y-%m-%d_%Hh%Mm%Ss)" }'
EOF
- name: Print .env for dynamic tag value reference
run: cat .env
- name: Run Azure e2e tests
env:
ARM_CLIENT_ID: ${{ secrets.AZ_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZ_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZ_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZ_ARM_TENANT_ID }}
TF_VAR_azuredevops_org: ${{ secrets.TF_VAR_azuredevops_org }}
TF_VAR_azuredevops_pat: ${{ secrets.TF_VAR_azuredevops_pat }}
TF_VAR_location: ${{ vars.TF_VAR_azure_location }}
GITREPO_SSH_CONTENTS: ${{ secrets.AZURE_GITREPO_SSH_CONTENTS }}
GITREPO_SSH_PUB_CONTENTS: ${{ secrets.AZURE_GITREPO_SSH_PUB_CONTENTS }}
run: |
source .env
mkdir -p ./build/ssh
touch ./build/ssh/key
echo $GITREPO_SSH_CONTENTS | base64 -d > build/ssh/key
export GITREPO_SSH_PATH=build/ssh/key
touch ./build/ssh/key.pub
echo $GITREPO_SSH_PUB_CONTENTS | base64 -d > ./build/ssh/key.pub
export GITREPO_SSH_PUB_PATH=build/ssh/key.pub
make test-azure

137
.github/workflows/e2e-bootstrap.yaml vendored Normal file
View File

@@ -0,0 +1,137 @@
name: e2e-bootstrap
on:
workflow_dispatch:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ 'main', 'release/**' ]
paths-ignore: [ 'docs/**', 'rfcs/**' ]
permissions:
contents: read
jobs:
e2e-boostrap-github:
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Setup Kubernetes
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
with:
version: v0.20.0
cluster_name: kind
# The versions below should target the newest Kubernetes version
# Keep this up-to-date with https://endoflife.date/kubernetes
node_image: kindest/node:v1.28.0@sha256:9f3ff58f19dcf1a0611d11e8ac989fdb30a28f40f236f59f0bea31fb956ccf5c
kubectl_version: v1.28.0
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Build
run: |
make cmd/flux/.manifests.done
go build -o /tmp/flux ./cmd/flux
- name: Set outputs
id: vars
run: |
REPOSITORY_NAME=${{ github.event.repository.name }}
BRANCH_NAME=${GITHUB_REF##*/}
COMMIT_SHA=$(git rev-parse HEAD)
PSEUDO_RAND_SUFFIX=$(echo "${BRANCH_NAME}-${COMMIT_SHA}" | shasum | awk '{print $1}')
TEST_REPO_NAME="${REPOSITORY_NAME}-${PSEUDO_RAND_SUFFIX}"
echo "test_repo_name=$TEST_REPO_NAME" >> $GITHUB_OUTPUT
- name: bootstrap init
run: |
/tmp/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=${{ steps.vars.outputs.test_repo_name }} \
--branch=main \
--path=test-cluster \
--team=team-z
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: bootstrap no-op
run: |
/tmp/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=${{ steps.vars.outputs.test_repo_name }} \
--branch=main \
--path=test-cluster \
--team=team-z
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: bootstrap customize
run: |
make setup-bootstrap-patch
/tmp/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=${{ steps.vars.outputs.test_repo_name }} \
--branch=main \
--path=test-cluster \
--team=team-z
if [ $(kubectl get deployments.apps source-controller -o jsonpath='{.spec.template.spec.securityContext.runAsUser}') != "10000" ]; then
echo "Bootstrap not customized as controller is not running as user 10000" && exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
GITHUB_REPO_NAME: ${{ steps.vars.outputs.test_repo_name }}
GITHUB_ORG_NAME: fluxcd-testing
- name: uninstall
run: |
/tmp/flux uninstall -s --keep-namespace
kubectl delete ns flux-system --timeout=10m --wait=true
- name: test image automation
run: |
make setup-image-automation
/tmp/flux bootstrap github --manifests ./manifests/install/ \
--owner=fluxcd-testing \
--repository=${{ steps.vars.outputs.test_repo_name }} \
--branch=main \
--path=test-cluster \
--read-write-key
/tmp/flux reconcile image repository podinfo
/tmp/flux get images all
retries=10
count=0
ok=false
until ${ok}; do
/tmp/flux get image update flux-system | grep 'commit' && ok=true || ok=false
count=$(($count + 1))
if [[ ${count} -eq ${retries} ]]; then
echo "No more retries left"
exit 1
fi
sleep 6
/tmp/flux reconcile image update flux-system
done
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
GITHUB_REPO_NAME: ${{ steps.vars.outputs.test_repo_name }}
GITHUB_ORG_NAME: fluxcd-testing
- name: delete repository
if: ${{ always() }}
run: |
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--fail --silent \
https://api.github.com/repos/fluxcd-testing/${{ steps.vars.outputs.test_repo_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
- name: Debug failure
if: failure()
run: |
kubectl -n flux-system get all
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller

92
.github/workflows/e2e-gcp.yaml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: e2e-gcp
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
push:
branches:
- main
paths:
- 'tests/**'
- '.github/workflows/e2e-gcp.yaml'
pull_request:
branches:
- main
paths:
- 'tests/**'
- '.github/workflows/e2e-gcp.yaml'
permissions:
contents: read
jobs:
e2e-gcp:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./tests/integration
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: tests/integration/go.sum
- name: Setup Flux CLI
run: make build
working-directory: ./
- name: Setup SOPS
run: |
mkdir -p $HOME/.local/bin
wget -O $HOME/.local/bin/sops https://github.com/mozilla/sops/releases/download/v$SOPS_VER/sops-v$SOPS_VER.linux
chmod +x $HOME/.local/bin/sops
env:
SOPS_VER: 3.7.1
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@67e9c72af6e0492df856527b474995862b7b6591 # v2.0.0
id: 'auth'
with:
credentials_json: '${{ secrets.FLUX2_E2E_GOOGLE_CREDENTIALS }}'
token_format: 'access_token'
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@825196879a077b7efa50db2e88409f44de4635c2 # v2.0.0
- name: Setup QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Log into us-central1-docker.pkg.dev
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set dynamic variables in .env
run: |
cat > .env <<EOF
export TF_VAR_tags='{ "environment"="github", "ci"="true", "repo"="flux2", "createdat"="$(date -u +x%Y-%m-%d_%Hh%Mm%Ss)" }'
EOF
- name: Print .env for dynamic tag value reference
run: cat .env
- name: Run GCP e2e tests
env:
TF_VAR_gcp_project_id: ${{ vars.TF_VAR_gcp_project_id }}
TF_VAR_gcp_region: ${{ vars.TF_VAR_gcp_region }}
TF_VAR_gcp_zone: ${{ vars.TF_VAR_gcp_zone }}
TF_VAR_gcp_email: ${{ secrets.TF_VAR_gcp_email }}
TF_VAR_gcp_keyring: ${{ secrets.TF_VAR_gcp_keyring }}
TF_VAR_gcp_crypto_key: ${{ secrets.TF_VAR_gcp_crypto_key }}
GITREPO_SSH_CONTENTS: ${{ secrets.GCP_GITREPO_SSH_CONTENTS }}
GITREPO_SSH_PUB_CONTENTS: ${{ secrets.GCP_GITREPO_SSH_PUB_CONTENTS }}
run: |
source .env
mkdir -p ./build/ssh
touch ./build/ssh/key
echo $GITREPO_SSH_CONTENTS | base64 -d > build/ssh/key
export GITREPO_SSH_PATH=build/ssh/key
touch ./build/ssh/key.pub
echo $GITREPO_SSH_PUB_CONTENTS | base64 -d > ./build/ssh/key.pub
export GITREPO_SSH_PUB_PATH=build/ssh/key.pub
make test-gcp

View File

@@ -1,34 +1,54 @@
name: e2e
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ 'main', 'release/**' ]
paths-ignore: [ 'docs/**', 'rfcs/**' ]
permissions:
contents: read
jobs:
kind:
e2e-amd64-kubernetes:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Go cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.15.x
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Setup Kubernetes
uses: engineerd/setup-kind@v0.5.0
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
with:
image: kindest/node:v1.16.9
- name: Run test
version: v0.20.0
cluster_name: kind
config: .github/kind/config.yaml # disable KIND-net
# The versions below should target the newest Kubernetes version
# Keep this up-to-date with https://endoflife.date/kubernetes
node_image: kindest/node:v1.28.0@sha256:9f3ff58f19dcf1a0611d11e8ac989fdb30a28f40f236f59f0bea31fb956ccf5c
kubectl_version: v1.28.0
- name: Setup Calico for network policy
run: |
kubectl apply -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml
kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Run tests
run: make test
- name: Run e2e tests
run: TEST_KUBECONFIG=$HOME/.kube/config make e2e
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
@@ -37,116 +57,188 @@ jobs:
exit 1
fi
- name: Build
run: sudo go build -o ./bin/flux ./cmd/flux
run: |
go build -o /tmp/flux ./cmd/flux
- name: flux check --pre
run: |
./bin/flux check --pre
/tmp/flux check --pre
- name: flux install --manifests
run: |
./bin/flux install --manifests ./manifests/install/
/tmp/flux install --manifests ./manifests/install/
- name: flux create secret
run: |
/tmp/flux create secret git git-ssh-test \
--url ssh://git@github.com/stefanprodan/podinfo
/tmp/flux create secret git git-https-test \
--url https://github.com/stefanprodan/podinfo \
--username=test --password=test
/tmp/flux create secret helm helm-test \
--username=test --password=test
- name: flux create source git
run: |
./bin/flux create source git podinfo \
/tmp/flux create source git podinfo \
--url https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.3"
--tag-semver=">=6.3.5"
- name: flux create source git export apply
run: |
./bin/flux create source git podinfo-export \
/tmp/flux create source git podinfo-export \
--url https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.3" \
--tag-semver=">=6.3.5" \
--export | kubectl apply -f -
./bin/flux delete source git podinfo-export --silent
/tmp/flux delete source git podinfo-export --silent
- name: flux get sources git
run: |
./bin/flux get sources git
/tmp/flux get sources git
- name: flux get sources git --all-namespaces
run: |
./bin/flux get sources git --all-namespaces
/tmp/flux get sources git --all-namespaces
- name: flux create kustomization
run: |
./bin/flux create kustomization podinfo \
/tmp/flux create kustomization podinfo \
--source=podinfo \
--path="./deploy/overlays/dev" \
--prune=true \
--interval=5m \
--validation=client \
--health-check="Deployment/frontend.dev" \
--health-check="Deployment/backend.dev" \
--health-check-timeout=3m
- name: flux trace
run: |
/tmp/flux trace frontend \
--kind=deployment \
--api-version=apps/v1 \
--namespace=dev
- name: flux reconcile kustomization --with-source
run: |
./bin/flux reconcile kustomization podinfo --with-source
/tmp/flux reconcile kustomization podinfo --with-source
- name: flux get kustomizations
run: |
./bin/flux get kustomizations
/tmp/flux get kustomizations
- name: flux get kustomizations --all-namespaces
run: |
./bin/flux get kustomizations --all-namespaces
/tmp/flux get kustomizations --all-namespaces
- name: flux suspend kustomization
run: |
./bin/flux suspend kustomization podinfo
/tmp/flux suspend kustomization podinfo
- name: flux resume kustomization
run: |
./bin/flux resume kustomization podinfo
/tmp/flux resume kustomization podinfo
- name: flux export
run: |
./bin/flux export source git --all
./bin/flux export kustomization --all
/tmp/flux export source git --all
/tmp/flux export kustomization --all
- name: flux delete kustomization
run: |
./bin/flux delete kustomization podinfo --silent
/tmp/flux delete kustomization podinfo --silent
- name: flux create source helm
run: |
./bin/flux create source helm podinfo \
/tmp/flux create source helm podinfo \
--url https://stefanprodan.github.io/podinfo
- name: flux create helmrelease --source=HelmRepository/podinfo
run: |
./bin/flux create hr podinfo-helm \
/tmp/flux create hr podinfo-helm \
--target-namespace=default \
--source=HelmRepository/podinfo \
--source=HelmRepository/podinfo.flux-system \
--chart=podinfo \
--chart-version=">4.0.0 <5.0.0"
--chart-version=">6.0.0 <7.0.0"
- name: flux create helmrelease --source=GitRepository/podinfo
run: |
./bin/flux create hr podinfo-git \
/tmp/flux create hr podinfo-git \
--target-namespace=default \
--source=GitRepository/podinfo \
--chart=./charts/podinfo
- name: flux reconcile helmrelease --with-source
run: |
./bin/flux reconcile helmrelease podinfo-git --with-source
/tmp/flux reconcile helmrelease podinfo-git --with-source
- name: flux get helmreleases
run: |
./bin/flux get helmreleases
/tmp/flux get helmreleases
- name: flux get helmreleases --all-namespaces
run: |
./bin/flux get helmreleases --all-namespaces
/tmp/flux get helmreleases --all-namespaces
- name: flux export helmrelease
run: |
./bin/flux export hr --all
/tmp/flux export hr --all
- name: flux delete helmrelease podinfo-helm
run: |
./bin/flux delete hr podinfo-helm --silent
/tmp/flux delete hr podinfo-helm --silent
- name: flux delete helmrelease podinfo-git
run: |
./bin/flux delete hr podinfo-git --silent
/tmp/flux delete hr podinfo-git --silent
- name: flux delete source helm
run: |
./bin/flux delete source helm podinfo --silent
/tmp/flux delete source helm podinfo --silent
- name: flux delete source git
run: |
./bin/flux delete source git podinfo --silent
/tmp/flux delete source git podinfo --silent
- name: flux oci artifacts
run: |
/tmp/flux push artifact oci://localhost:5000/fluxcd/flux:${{ github.sha }} \
--path="./manifests" \
--source="${{ github.repositoryUrl }}" \
--revision="${{ github.ref }}@sha1:${{ github.sha }}"
/tmp/flux tag artifact oci://localhost:5000/fluxcd/flux:${{ github.sha }} \
--tag latest
/tmp/flux list artifacts oci://localhost:5000/fluxcd/flux
- name: flux oci repositories
run: |
/tmp/flux create source oci podinfo-oci \
--url oci://ghcr.io/stefanprodan/manifests/podinfo \
--tag-semver 6.3.x \
--interval 10m
/tmp/flux create kustomization podinfo-oci \
--source=OCIRepository/podinfo-oci \
--path="./" \
--prune=true \
--interval=5m \
--target-namespace=default \
--wait=true \
--health-check-timeout=3m
/tmp/flux reconcile source oci podinfo-oci
/tmp/flux suspend source oci podinfo-oci
/tmp/flux get sources oci
/tmp/flux resume source oci podinfo-oci
/tmp/flux export source oci podinfo-oci
/tmp/flux delete ks podinfo-oci --silent
/tmp/flux delete source oci podinfo-oci --silent
- name: flux create tenant
run: |
/tmp/flux create tenant dev-team --with-namespace=apps
/tmp/flux -n apps create source helm podinfo \
--url https://stefanprodan.github.io/podinfo
/tmp/flux -n apps create hr podinfo-helm \
--source=HelmRepository/podinfo \
--chart=podinfo \
--chart-version="6.3.x" \
--service-account=dev-team
- name: flux2-kustomize-helm-example
run: |
/tmp/flux create source git flux-system \
--url=https://github.com/fluxcd/flux2-kustomize-helm-example \
--branch=main \
--ignore-paths="./clusters/**/flux-system/" \
--recurse-submodules
/tmp/flux create kustomization flux-system \
--source=flux-system \
--path=./clusters/staging
kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m
kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m
- name: flux tree
run: |
/tmp/flux tree kustomization flux-system | grep Service/podinfo
- name: flux check
run: |
./bin/flux check
/tmp/flux check
- name: flux uninstall
run: |
./bin/flux uninstall --crds --silent
/tmp/flux uninstall --silent
- name: Debug failure
if: failure()
run: |
kubectl version --client --short
kubectl -n flux-system get all
kubectl -n flux-system describe pods
kubectl -n flux-system get kustomizations -oyaml
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller

View File

@@ -1,25 +0,0 @@
name: FOSSA
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.14.x"
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Add GOPATH to GITHUB_PATH
run: echo "$GOPATH/bin" >>"$GITHUB_PATH"
- name: Run FOSSA scan and upload build data
uses: fossa-contrib/fossa-action@v1
with:
# FOSSA Push-Only API Token
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
github-token: ${{ github.token }}

39
.github/workflows/ossf.yaml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: ossf
on:
workflow_dispatch:
push:
branches:
- main
schedule:
# Weekly on Saturdays.
- cron: '30 1 * * 6'
permissions: read-all
jobs:
scorecard:
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write
actions: read
contents: read
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run analysis
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
repo_token: ${{ secrets.GITHUB_TOKEN }}
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload SARIF results
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
with:
sarif_file: results.sarif

View File

@@ -1,21 +0,0 @@
name: rebase
on:
pull_request:
types: [opened]
issue_comment:
types: [created]
jobs:
rebase:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.3.1
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

View File

@@ -2,86 +2,210 @@ name: release
on:
push:
tags:
- '*'
tags: [ 'v*' ]
permissions:
contents: read
jobs:
goreleaser:
release-flux-cli:
outputs:
hashes: ${{ steps.slsa.outputs.hashes }}
image_url: ${{ steps.slsa.outputs.image_url }}
image_digest: ${{ steps.slsa.outputs.image_digest }}
runs-on: ubuntu-latest
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Unshallow
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.15.x
go-version: 1.20.x
cache: false
- name: Setup QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Setup Syft
uses: anchore/sbom-action/download-syft@5ecf649a417b8ae17dc8383dc32d46c03f2312df # v0.15.1
- name: Setup Cosign
uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: fluxcdbot
password: ${{ secrets.GHCR_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: fluxcdbot
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
- name: Generate manifests
run: |
make cmd/flux/.manifests.done
./manifests/scripts/bundle.sh "" ./output manifests.tar.gz
kustomize build ./manifests/install > ./output/install.yaml
- name: Build CRDs
run: |
kustomize build manifests/crds > all-crds.yaml
- name: Generate OpenAPI JSON schemas from CRDs
uses: fluxcd/pkg/actions/crdjsonschema@main
with:
crd: all-crds.yaml
output: schemas
- name: Archive the OpenAPI JSON schemas
run: |
tar -czvf ./output/crd-schemas.tar.gz -C schemas .
- name: Download release notes utility
env:
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
- name: Generate release notes
run: |
echo 'CHANGELOG' > /tmp/release.txt
github-release-notes -org fluxcd -repo toolkit -since-latest-release -include-author >> /tmp/release.txt
NOTES="./output/notes.md"
echo '## CLI Changelog' > ${NOTES}
github-release-notes -org fluxcd -repo flux2 -since-latest-release -include-author >> ${NOTES}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Kustomize
uses: fluxcd/pkg//actions/kustomize@main
- name: Generate manifests tarball
run: |
mkdir -p ./output
files=""
# build controllers
for controller in ./manifests/bases/*/; do
output_path="./output/$(basename $controller).yaml"
echo "building $controller to $output_path"
kustomize build $controller > $output_path
files+=" $(basename $output_path)"
done
# build rbac
rbac_path="./manifests/rbac"
rbac_output_path="./output/rbac.yaml"
echo "building $rbac_path to $rbac_output_path"
kustomize build $rbac_path > $rbac_output_path
files+=" $(basename $rbac_output_path)"
# build policies
policies_path="./manifests/policies"
policies_output_path="./output/policies.yaml"
echo "building $policies_path to $policies_output_path"
kustomize build $policies_path > $policies_output_path
files+=" $(basename $policies_output_path)"
# create tarball
cd ./output && tar -cvzf manifests.tar.gz $files
- name: Create release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
- name: Upload artifacts
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/manifests.tar.gz
asset_name: manifests.tar.gz
asset_content_type: application/gzip
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
id: run-goreleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
version: latest
args: release --release-notes=/tmp/release.txt --skip-validate
args: release --release-notes=output/notes.md --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
AUR_BOT_SSH_PRIVATE_KEY: ${{ secrets.AUR_BOT_SSH_PRIVATE_KEY }}
- name: Generate SLSA metadata
id: slsa
env:
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
run: |
set -euo pipefail
hashes=$(echo -E $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
echo "hashes=$hashes" >> $GITHUB_OUTPUT
image_url=fluxcd/flux-cli:$GITHUB_REF_NAME
echo "image_url=$image_url" >> $GITHUB_OUTPUT
image_digest=$(docker buildx imagetools inspect ${image_url} --format '{{json .}}' | jq -r .manifest.digest)
echo "image_digest=$image_digest" >> $GITHUB_OUTPUT
release-flux-manifests:
runs-on: ubuntu-latest
needs: release-flux-cli
permissions:
id-token: write
packages: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup Flux CLI
uses: ./action/
- name: Prepare
id: prep
run: |
VERSION=$(flux version --client | awk '{ print $NF }')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: fluxcdbot
password: ${{ secrets.GHCR_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: fluxcdbot
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
- name: Push manifests to GHCR
run: |
mkdir -p ./ghcr.io/flux-system
flux install --registry=ghcr.io/fluxcd \
--components-extra=image-reflector-controller,image-automation-controller \
--export > ./ghcr.io/flux-system/gotk-components.yaml
cd ./ghcr.io && flux push artifact \
oci://ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
--path="./flux-system" \
--source=${{ github.repositoryUrl }} \
--revision="${{ github.ref_name }}@sha1:${{ github.sha }}"
- name: Push manifests to DockerHub
run: |
mkdir -p ./docker.io/flux-system
flux install --registry=docker.io/fluxcd \
--components-extra=image-reflector-controller,image-automation-controller \
--export > ./docker.io/flux-system/gotk-components.yaml
cd ./docker.io && flux push artifact \
oci://docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
--path="./flux-system" \
--source=${{ github.repositoryUrl }} \
--revision="${{ github.ref_name }}@sha1:${{ github.sha }}"
- uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
- name: Sign manifests
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign --yes ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }}
cosign sign --yes docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }}
- name: Tag manifests
run: |
flux tag artifact oci://ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
--tag latest
flux tag artifact oci://docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
--tag latest
release-provenance:
needs: [release-flux-cli]
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
contents: write # for uploading attestations to GitHub releases.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.9.0
with:
provenance-name: "provenance.intoto.jsonl"
base64-subjects: "${{ needs.release-flux-cli.outputs.hashes }}"
upload-assets: true
dockerhub-provenance:
needs: [release-flux-cli]
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
packages: write # for uploading attestations.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
with:
image: ${{ needs.release-flux-cli.outputs.image_url }}
digest: ${{ needs.release-flux-cli.outputs.image_digest }}
registry-username: fluxcdbot
secrets:
registry-password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
ghcr-provenance:
needs: [release-flux-cli]
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
packages: write # for uploading attestations.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
with:
image: ghcr.io/${{ needs.release-flux-cli.outputs.image_url }}
digest: ${{ needs.release-flux-cli.outputs.image_digest }}
registry-username: fluxcdbot
secrets:
registry-password: ${{ secrets.GHCR_TOKEN }}

85
.github/workflows/scan.yaml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: scan
on:
workflow_dispatch:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ 'main', 'release/**' ]
schedule:
- cron: '18 10 * * 3'
permissions:
contents: read
jobs:
scan-fossa:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run FOSSA scan and upload build data
uses: fossa-contrib/fossa-action@cdc5065bcdee31a32e47d4585df72d66e8e941c2 # v3.0.0
with:
# FOSSA Push-Only API Token
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
github-token: ${{ github.token }}
scan-snyk:
runs-on: ubuntu-latest
permissions:
security-events: write
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Download modules and build manifests
run: |
make tidy
make cmd/flux/.manifests.done
- uses: snyk/actions/setup@b98d498629f1c368650224d6d212bf7dfa89e4bf
- name: Run Snyk to check for vulnerabilities
continue-on-error: true
run: |
snyk test --sarif-file-output=snyk.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
with:
sarif_file: snyk.sarif
scan-codeql:
runs-on: ubuntu-latest
permissions:
security-events: write
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Initialize CodeQL
uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
with:
languages: go
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# xref: https://codeql.github.com/codeql-query-help/go/
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4

28
.github/workflows/sync-labels.yaml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: sync-labels
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/labels.yaml
permissions:
contents: read
jobs:
labels:
name: Run sync
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: EndBug/label-sync@da00f2c11fdb78e4fae44adac2fdd713778ea3e8 # v2.3.2
with:
# Configuration file
config-file: |
https://raw.githubusercontent.com/fluxcd/community/main/.github/standard-labels.yaml
.github/labels.yaml
# Strictly declarative
delete-other-labels: true

108
.github/workflows/update.yaml vendored Normal file
View File

@@ -0,0 +1,108 @@
name: update
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
push:
branches: [main]
permissions:
contents: read
jobs:
update-components:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.20.x
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Update component versions
id: update
run: |
PR_BODY=$(mktemp)
bump_version() {
local LATEST_VERSION=$(curl -s https://api.github.com/repos/fluxcd/$1/releases | jq -r 'sort_by(.published_at) | .[-1] | .tag_name')
local CTRL_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml)
local CRD_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p" manifests/crds/kustomization.yaml)
local MOD_VERSION=$(go list -m -f '{{ .Version }}' "github.com/fluxcd/$1/api")
local changed=false
if [[ "${CTRL_VERSION}" != "${LATEST_VERSION}" ]]; then
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/bases/$1/kustomization.yaml"
changed=true
fi
if [[ "${CRD_VERSION}" != "${LATEST_VERSION}" ]]; then
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/crds/kustomization.yaml"
changed=true
fi
if [[ "${MOD_VERSION}" != "${LATEST_VERSION}" ]]; then
go mod edit -require="github.com/fluxcd/$1/api@${LATEST_VERSION}"
make tidy
changed=true
fi
if [[ "$changed" == true ]]; then
echo "- $1 to ${LATEST_VERSION}" >> $PR_BODY
echo " https://github.com/fluxcd/$1/blob/${LATEST_VERSION}/CHANGELOG.md" >> $PR_BODY
fi
}
{
# bump controller versions
bump_version helm-controller
bump_version kustomize-controller
bump_version source-controller
bump_version notification-controller
bump_version image-reflector-controller
bump_version image-automation-controller
# diff change
git diff
# export PR_BODY for PR and commit
# NB: this may look strange but it is the way it should be done to
# maintain our precious newlines
# Ref: https://github.com/github/docs/issues/21529
echo 'pr_body<<EOF' >> $GITHUB_OUTPUT
cat $PR_BODY >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit-message: |
Update toolkit components
${{ steps.update.outputs.pr_body }}
committer: GitHub <noreply@github.com>
author: fluxcdbot <fluxcdbot@users.noreply.github.com>
signoff: true
branch: update-components
title: Update toolkit components
body: |
${{ steps.update.outputs.pr_body }}
labels: |
dependencies
reviewers: ${{ secrets.ASSIGNEES }}
- name: Check output
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

View File

@@ -1,74 +0,0 @@
name: Update Components
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
update-components:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Update component versions
id: update
run: |
PR_BODY=""
bump_version() {
local RELEASE_VERSION=$(curl -s https://api.github.com/repos/fluxcd/$1/releases | jq -r 'sort_by(.published_at) | .[-1] | .tag_name')
local CURRENT_VERSION=$(sed -n "s/.*$1\/archive\/\(.*\).zip.*/\1/p;n" manifests/bases/$1/kustomization.yaml)
if [[ "${RELEASE_VERSION}" != "${CURRENT_VERSION}" ]]; then
# bump kustomize
sed -i "s/\($1\/archive\/\)v.*\(.zip\/\/$1-\).*\(\/config.*\)/\1${RELEASE_VERSION}\2${RELEASE_VERSION/v}\3/g" "manifests/bases/$1/kustomization.yaml"
if [[ ! -z $(go list -m all | grep "github.com/fluxcd/$1/api" | awk '{print $2}') ]]; then
# bump go mod
go mod edit -require="github.com/fluxcd/$1/api@${RELEASE_VERSION}"
fi
PR_BODY="$PR_BODY- $1 to ${RELEASE_VERSION}%0A"
fi
}
{
# bump controller versions
bump_version helm-controller
bump_version kustomize-controller
bump_version source-controller
bump_version notification-controller
# add missing and remove unused modules
go mod tidy
# diff change
git diff
# export PR_BODY for PR
echo "::set-output name=pr_body::$PR_BODY"
}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit-message: Update toolkit components
committer: GitHub <noreply@github.com>
author: fluxcdbot <fluxcdbot@users.noreply.github.com>
title: Update toolkit components
body: |
${{ steps.update.outputs.pr_body }}
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
branch: update-components
reviewers: ${{ secrets.ASSIGNEES }}
- name: Check output
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"

11
.gitignore vendored
View File

@@ -11,7 +11,16 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Release
dist/
# Dependency directories (remove the comment below to include it)
# vendor/
bin/
output/
output/
cmd/flux/manifests/
cmd/flux/.manifests.done
testbin/
# Docs
site/

View File

@@ -1,3 +1,4 @@
project_name: flux
builds:
- <<: &build_defaults
binary: flux
@@ -19,6 +20,9 @@ builds:
id: darwin
goos:
- darwin
goarch:
- amd64
- arm64
- <<: *build_defaults
id: windows
goos:
@@ -36,6 +40,37 @@ archives:
format: zip
files:
- none*
source:
enabled: true
name_template: '{{ .ProjectName }}_{{ .Version }}_source_code'
sboms:
- id: source
artifacts: source
documents:
- "{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json"
release:
extra_files:
- glob: output/crd-schemas.tar.gz
- glob: output/manifests.tar.gz
- glob: output/install.yaml
checksum:
extra_files:
- glob: output/crd-schemas.tar.gz
- glob: output/manifests.tar.gz
- glob: output/install.yaml
signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: '${artifact}.pem'
args:
- sign-blob
- "--yes"
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true
brews:
- name: flux
tap:
@@ -43,10 +78,98 @@ brews:
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
folder: Formula
homepage: "https://toolkit.fluxcd.io/"
homepage: "https://fluxcd.io/"
description: "Flux CLI"
dependencies:
- name: kubectl
type: optional
install: |
bin.install "flux"
generate_completions_from_executable(bin/"flux", "completion")
test: |
system "#{bin}/flux --version"
publishers:
- name: aur-pkg-bin
env:
- AUR_BOT_SSH_PRIVATE_KEY={{ .Env.AUR_BOT_SSH_PRIVATE_KEY }}
cmd: |
.github/aur/flux-bin/publish.sh {{ .Version }}
- name: aur-pkg-scm
env:
- AUR_BOT_SSH_PRIVATE_KEY={{ .Env.AUR_BOT_SSH_PRIVATE_KEY }}
cmd: |
.github/aur/flux-scm/publish.sh {{ .Version }}
- name: aur-pkg-go
env:
- AUR_BOT_SSH_PRIVATE_KEY={{ .Env.AUR_BOT_SSH_PRIVATE_KEY }}
cmd: |
.github/aur/flux-go/publish.sh {{ .Version }}
dockers:
- image_templates:
- 'fluxcd/flux-cli:{{ .Tag }}-amd64'
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-amd64'
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- "--pull"
- "--build-arg=ARCH=linux/amd64"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
- image_templates:
- 'fluxcd/flux-cli:{{ .Tag }}-arm64'
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm64'
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- "--pull"
- "--build-arg=ARCH=linux/arm64"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/arm64"
- image_templates:
- 'fluxcd/flux-cli:{{ .Tag }}-arm'
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm'
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: arm
goarm: 7
build_flag_templates:
- "--pull"
- "--build-arg=ARCH=linux/arm"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/arm/v7"
docker_manifests:
- name_template: 'fluxcd/flux-cli:{{ .Tag }}'
image_templates:
- 'fluxcd/flux-cli:{{ .Tag }}-amd64'
- 'fluxcd/flux-cli:{{ .Tag }}-arm64'
- 'fluxcd/flux-cli:{{ .Tag }}-arm'
- name_template: 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}'
image_templates:
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-amd64'
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm64'
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm'
docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
args:
- sign
- "--yes"
- '${artifact}'
artifacts: all
output: true

View File

@@ -1,7 +1,6 @@
# Contributing
Flux is [Apache 2.0
licensed](https://github.com/fluxcd/flux2/blob/main/LICENSE) and
Flux is [Apache 2.0 licensed](https://github.com/fluxcd/flux2/blob/main/LICENSE) and
accepts contributions via GitHub pull requests. This document outlines
some of the conventions on to make it easier to get your contribution
accepted.
@@ -14,15 +13,24 @@ code.
By contributing to this project you agree to the Developer Certificate of
Origin (DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution. No action from you is required, but it's a good idea to see the
[DCO](DCO) file for details before you start contributing code to FluxCD
organization.
contribution.
We require all commits to be signed. By signing off with your signature, you
certify that you wrote the patch or otherwise have the right to contribute the
material by the rules of the [DCO](DCO):
`Signed-off-by: Jane Doe <jane.doe@example.com>`
The signature must contain your real name
(sorry, no pseudonyms or anonymous contributions)
If your `user.name` and `user.email` are configured in your Git config,
you can sign your commit automatically with `git commit -s`.
## Communications
For realtime communications we use Slack: To join the conversation, simply
join the [CNCF](https://slack.cncf.io/) Slack workspace and use the
[#flux-dev](https://cloud-native.slack.com/messages/flux-dev/) channel.
[#flux-contributors](https://cloud-native.slack.com/messages/flux-contributors/) channel.
To discuss ideas and specifications we use [Github
Discussions](https://github.com/fluxcd/flux2/discussions).
@@ -40,27 +48,80 @@ you might want to take a look at the [introductory talk and demo](https://www.yo
This project is composed of:
- [/f/flux2](https://github.com/fluxcd/flux2): The Flux CLI
- [/f/source-manager](https://github.com/fluxcd/source-controller): Kubernetes operator for managing sources
- [/f/kustomize-controller](https://github.com/fluxcd/kustomize-controller): Kubernetes operator for building GitOps pipelines with Kustomize
- [/f/helm-controller](https://github.com/fluxcd/helm-controller): Kubernetes operator for building GitOps pipelines with Helm
- [/f/notification-controller](https://github.com/fluxcd/notification-controller): Kubernetes operator for handling inbound and outbound events
- [flux2](https://github.com/fluxcd/flux2): The Flux CLI
- [source-manager](https://github.com/fluxcd/source-controller): Kubernetes operator for managing sources (Git and Helm repositories, S3-compatible Buckets)
- [kustomize-controller](https://github.com/fluxcd/kustomize-controller): Kubernetes operator for building GitOps pipelines with Kustomize
- [helm-controller](https://github.com/fluxcd/helm-controller): Kubernetes operator for building GitOps pipelines with Helm
- [notification-controller](https://github.com/fluxcd/notification-controller): Kubernetes operator for handling inbound and outbound events
- [image-reflector-controller](https://github.com/fluxcd/image-reflector-controller): Kubernetes operator for scanning container registries
- [image-automation-controller](https://github.com/fluxcd/image-automation-controller): Kubernetes operator for patches container image tags in Git
### Understanding the code
To get started with developing controllers, you might want to review
[our guide](https://toolkit.fluxcd.io/dev-guides/source-watcher/) which
[our guide](https://fluxcd.io/flux/gitops-toolkit/source-watcher/) which
walks you through writing a short and concise controller that watches out
for source changes.
### How to run the test suite
## How to run the test suite
You can run the unit tests by simply doing
Prerequisites:
* go >= 1.20
* kubectl >= 1.24
* kustomize >= 5.0
* coreutils (on Mac OS)
Install the [controller-runtime/envtest](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest) binaries with:
```bash
make install-envtest
```
Then you can run the unit tests with:
```bash
make test
```
After [installing Kubernetes kind](https://kind.sigs.k8s.io/docs/user/quick-start#installation) on your machine,
create a cluster for testing with:
```bash
make setup-kind
```
Then you can run the end-to-end tests with:
```bash
make e2e
```
When the output of the Flux CLI changes, to automatically update the golden
files used in the test, pass `-update` flag to the test as:
```bash
make e2e TEST_ARGS="-update"
```
Since not all packages use golden files for testing, `-update` argument must be
passed only for the packages that use golden files. Use the variables
`TEST_PKG_PATH` for unit tests and `E2E_TEST_PKG_PATH` for e2e tests, to set the
path of the target test package:
```bash
# Unit test
make test TEST_PKG_PATH="./cmd/flux" TEST_ARGS="-update"
# e2e test
make e2e E2E_TEST_PKG_PATH="./cmd/flux" TEST_ARGS="-update"
```
Teardown the e2e environment with:
```bash
make cleanup-kind
```
## Acceptance policy
These things will make a PR more likely to be accepted:

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM alpine:3.18 as builder
RUN apk add --no-cache ca-certificates curl
ARG ARCH=linux/amd64
ARG KUBECTL_VER=1.27.3
RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/${ARCH}/kubectl \
-o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl && \
kubectl version --client=true
FROM alpine:3.18 as flux-cli
RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/local/bin/kubectl /usr/local/bin/
COPY --chmod=755 flux /usr/local/bin/
USER 65534:65534
ENTRYPOINT [ "flux" ]

View File

@@ -2,8 +2,7 @@ The maintainers are generally available in Slack at
https://cloud-native.slack.com in #flux (https://cloud-native.slack.com/messages/CLAJ40HV3)
(obtain an invitation at https://slack.cncf.io/).
In alphabetical order:
The Flux2 maintainers team is identical with the core maintainers of the project
as listed in
Aurel Canciu, Sortlist <aurel@sortlist.com> (github: @relu, slack: relu)
Hidde Beydals, Weaveworks <hidde@weave.works> (github: @hiddeco, slack: hidde)
Stefan Prodan, Weaveworks <stefan@weave.works> (github: @stefanprodan, slack: stefanprodan)
https://github.com/fluxcd/community/blob/main/CORE-MAINTAINERS

View File

@@ -1,9 +1,25 @@
VERSION?=$(shell grep 'VERSION' cmd/flux/main.go | awk '{ print $$4 }' | tr -d '"')
VERSION?=$(shell grep 'VERSION' cmd/flux/main.go | awk '{ print $$4 }' | head -n 1 | tr -d '"')
DEV_VERSION?=0.0.0-$(shell git rev-parse --abbrev-ref HEAD)-$(shell git rev-parse --short HEAD)-$(shell date +%s)
EMBEDDED_MANIFESTS_TARGET=cmd/flux/.manifests.done
TEST_KUBECONFIG?=/tmp/flux-e2e-test-kubeconfig
# Architecture to use envtest with
ENVTEST_ARCH ?= amd64
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
rwildcard=$(foreach d,$(wildcard $(addsuffix *,$(1))),$(call rwildcard,$(d)/,$(2)) $(filter $(subst *,%,$(2)),$(d)))
all: test build
tidy:
go mod tidy
go mod tidy -compat=1.20
cd tests/azure && go mod tidy -compat=1.20
cd tests/integration && go mod tidy -compat=1.20
fmt:
go fmt ./...
@@ -11,19 +27,73 @@ fmt:
vet:
go vet ./...
test: tidy fmt vet docs
go test ./... -coverprofile cover.out
setup-kind:
kind create cluster --name=flux-e2e-test --kubeconfig=$(TEST_KUBECONFIG) --config=.github/kind/config.yaml
kubectl --kubeconfig=$(TEST_KUBECONFIG) apply -f https://docs.projectcalico.org/v3.16/manifests/calico.yaml
kubectl --kubeconfig=$(TEST_KUBECONFIG) -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
build:
CGO_ENABLED=0 go build -o ./bin/flux ./cmd/flux
cleanup-kind:
kind delete cluster --name=flux-e2e-test
rm $(TEST_KUBECONFIG)
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
TEST_PKG_PATH="./..."
test: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet install-envtest
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test $(TEST_PKG_PATH) -coverprofile cover.out --tags=unit $(TEST_ARGS)
E2E_TEST_PKG_PATH="./cmd/flux/..."
e2e: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet
TEST_KUBECONFIG=$(TEST_KUBECONFIG) go test $(E2E_TEST_PKG_PATH) -coverprofile e2e.cover.out --tags=e2e -v -failfast $(TEST_ARGS)
test-with-kind: install-envtest
make setup-kind
make e2e
make cleanup-kind
$(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json)
./manifests/scripts/bundle.sh
touch $@
build: $(EMBEDDED_MANIFESTS_TARGET)
CGO_ENABLED=0 go build -ldflags="-s -w -X main.VERSION=$(VERSION)" -o ./bin/flux ./cmd/flux
build-dev: $(EMBEDDED_MANIFESTS_TARGET)
CGO_ENABLED=0 go build -ldflags="-s -w -X main.VERSION=$(DEV_VERSION)" -o ./bin/flux ./cmd/flux
.PHONY: install
install:
go install cmd/flux
.PHONY: docs
docs:
rm docs/cmd/*
mkdir -p ./docs/cmd && go run ./cmd/flux/ docgen
CGO_ENABLED=0 go install ./cmd/flux
install-dev:
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/flux
setup-bootstrap-patch:
go run ./tests/bootstrap/main.go
setup-image-automation:
cd tests/image-automation && go run main.go
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
ENVTEST_KUBERNETES_VERSION?=latest
install-envtest: setup-envtest
mkdir -p ${ENVTEST_ASSETS_DIR}
$(ENVTEST) use $(ENVTEST_KUBERNETES_VERSION) --arch=$(ENVTEST_ARCH) --bin-dir=$(ENVTEST_ASSETS_DIR)
ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
setup-envtest: ## Download envtest-setup locally if necessary.
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
# go-install-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-install-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef

133
README.md
View File

@@ -1,13 +1,15 @@
# Flux version 2
[![e2e](https://github.com/fluxcd/flux2/workflows/e2e/badge.svg)](https://github.com/fluxcd/flux2/actions)
[![report](https://goreportcard.com/badge/github.com/fluxcd/flux2)](https://goreportcard.com/report/github.com/fluxcd/flux2)
[![license](https://img.shields.io/github/license/fluxcd/flux2.svg)](https://github.com/fluxcd/flux2/blob/main/LICENSE)
[![release](https://img.shields.io/github/release/fluxcd/flux2/all.svg)](https://github.com/fluxcd/flux2/releases)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4782/badge)](https://bestpractices.coreinfrastructure.org/projects/4782)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/fluxcd/flux2/badge)](https://api.securityscorecards.dev/projects/github.com/fluxcd/flux2)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Ffluxcd%2Fflux2.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Ffluxcd%2Fflux2?ref=badge_shield)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/flux2)](https://artifacthub.io/packages/helm/fluxcd-community/flux2)
[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://fluxcd.io/flux/security/slsa-assessment)
Flux is a tool for keeping Kubernetes clusters in sync with sources of
configuration (like Git repositories), and automating updates to
configuration when there is new code to deploy.
configuration (like Git repositories and OCI artifacts),
and automating updates to configuration when there is new code to deploy.
Flux version 2 ("v2") is built from the ground up to use Kubernetes'
API extension system, and to integrate with Prometheus and other core
@@ -19,43 +21,21 @@ Flux v2 is constructed with the [GitOps Toolkit](#gitops-toolkit), a
set of composable APIs and specialized tools for building Continuous
Delivery on top of Kubernetes.
## Flux installation
Flux is a Cloud Native Computing Foundation ([CNCF](https://www.cncf.io/)) project, used in
production by various [organisations](https://fluxcd.io/adopters) and [cloud providers](https://fluxcd.io/ecosystem).
With Homebrew:
## Quickstart and documentation
```sh
brew install fluxcd/tap/flux
```
To get started check out this [guide](https://fluxcd.io/flux/get-started/)
on how to bootstrap Flux on Kubernetes and deploy a sample application in a GitOps manner.
With Bash:
For more comprehensive documentation, see the following guides:
- [Ways of structuring your repositories](https://fluxcd.io/flux/guides/repository-structure/)
- [Manage Helm Releases](https://fluxcd.io/flux/guides/helmreleases/)
- [Automate image updates to Git](https://fluxcd.io/flux/guides/image-update/)
- [Manage Kubernetes secrets with Flux and SOPS](https://fluxcd.io/flux/guides/mozilla-sops/)
```sh
curl -s https://toolkit.fluxcd.io/install.sh | sudo bash
# enable completions in ~/.bash_profile
. <(flux completion bash)
```
Binaries for macOS, Windows and Linux AMD64/ARM are available to download on the
[release page](https://github.com/fluxcd/flux2/releases).
Verify that your cluster satisfies the prerequisites with:
```sh
flux check --pre
```
## Get started
To get started with Flux, start [browsing the
documentation](https://toolkit.fluxcd.io) or get started with one of
the following guides:
- [Get started with Flux (deep dive)](https://toolkit.fluxcd.io/get-started/)
- [Installation](https://toolkit.fluxcd.io/guides/installation/)
- [Manage Helm Releases](https://toolkit.fluxcd.io/guides/helmreleases/)
- [Setup Notifications](https://toolkit.fluxcd.io/guides/notifications/)
- [Setup Webhook Receivers](https://toolkit.fluxcd.io/guides/webhook-receivers/)
If you need help, please refer to our **[Support page](https://fluxcd.io/support/)**.
## GitOps Toolkit
@@ -64,51 +44,58 @@ runtime for Flux v2. The APIs comprise Kubernetes custom resources,
which can be created and updated by a cluster user, or by other
automation tooling.
![overview](docs/diagrams/gitops-toolkit.png)
![overview](https://fluxcd.io/img/diagrams/gitops-toolkit.png)
You can use the toolkit to extend Flux, or to build your own systems
for continuous delivery -- see [the developer
guides](https://toolkit.fluxcd.io/dev-guides/source-watcher/).
guides](https://fluxcd.io/flux/gitops-toolkit/source-watcher/).
### Components
- [Source Controller](https://toolkit.fluxcd.io/components/source/controller/)
- [GitRepository CRD](https://toolkit.fluxcd.io/components/source/gitrepositories/)
- [HelmRepository CRD](https://toolkit.fluxcd.io/components/source/helmrepositories/)
- [HelmChart CRD](https://toolkit.fluxcd.io/components/source/helmcharts/)
- [Bucket CRD](https://toolkit.fluxcd.io/components/source/buckets/)
- [Kustomize Controller](https://toolkit.fluxcd.io/components/kustomize/controller/)
- [Kustomization CRD](https://toolkit.fluxcd.io/components/kustomize/kustomization/)
- [Helm Controller](https://toolkit.fluxcd.io/components/helm/controller/)
- [HelmRelease CRD](https://toolkit.fluxcd.io/components/helm/helmreleases/)
- [Notification Controller](https://toolkit.fluxcd.io/components/notification/controller/)
- [Provider CRD](https://toolkit.fluxcd.io/components/notification/provider/)
- [Alert CRD](https://toolkit.fluxcd.io/components/notification/alert/)
- [Receiver CRD](https://toolkit.fluxcd.io/components/notification/receiver/)
- [Source Controller](https://fluxcd.io/flux/components/source/)
- [GitRepository CRD](https://fluxcd.io/flux/components/source/gitrepositories/)
- [OCIRepository CRD](https://fluxcd.io/flux/components/source/ocirepositories/)
- [HelmRepository CRD](https://fluxcd.io/flux/components/source/helmrepositories/)
- [HelmChart CRD](https://fluxcd.io/flux/components/source/helmcharts/)
- [Bucket CRD](https://fluxcd.io/flux/components/source/buckets/)
- [Kustomize Controller](https://fluxcd.io/flux/components/kustomize/)
- [Kustomization CRD](https://fluxcd.io/flux/components/kustomize/kustomizations/)
- [Helm Controller](https://fluxcd.io/flux/components/helm/)
- [HelmRelease CRD](https://fluxcd.io/flux/components/helm/helmreleases/)
- [Notification Controller](https://fluxcd.io/flux/components/notification/)
- [Provider CRD](https://fluxcd.io/flux/components/notification/providers/)
- [Alert CRD](https://fluxcd.io/flux/components/notification/alerts/)
- [Receiver CRD](https://fluxcd.io/flux/components/notification/receivers/)
- [Image Automation Controllers](https://fluxcd.io/flux/components/image/)
- [ImageRepository CRD](https://fluxcd.io/flux/components/image/imagerepositories/)
- [ImagePolicy CRD](https://fluxcd.io/flux/components/image/imagepolicies/)
- [ImageUpdateAutomation CRD](https://fluxcd.io/flux/components/image/imageupdateautomations/)
## Community
The Flux project is always looking for new contributors and there are a multitude of ways to get involved.
Depending on what you want to do, some of the following bits might be your first steps:
Need help or want to contribute? Please see the links below. The Flux project is always looking for
new contributors and there are a multitude of ways to get involved.
- Join our upcoming dev meetings ([meeting access and agenda](https://docs.google.com/document/d/1l_M0om0qUEN_NNiGgpqJ2tvsF2iioHkaARDeh6b70B0/view))
- Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/)
- Join the [planning discussions](https://github.com/fluxcd/flux2/discussions)
- And if you are completely new to Flux and the GitOps Toolkit, take a look at our [Get Started guide](https://toolkit.fluxcd.io/get-started/) and give us feedback
- To be part of the conversation about Flux's development, [join the flux-dev mailing list](https://lists.cncf.io/g/cncf-flux-dev).
- Check out [how to contribute](CONTRIBUTING.md) to the project
- Getting Started?
- Look at our [Get Started guide](https://fluxcd.io/flux/get-started/) and give us feedback
- Need help?
- First: Ask questions on our [GH Discussions page](https://github.com/fluxcd/flux2/discussions).
- Second: Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/).
- Please follow our [Support Guidelines](https://fluxcd.io/support/)
(in short: be nice, be respectful of volunteers' time, understand that maintainers and
contributors cannot respond to all DMs, and keep discussions in the public #flux channel as much as possible).
- Have feature proposals or want to contribute?
- Propose features on our [GitHub Discussions page](https://github.com/fluxcd/flux2/discussions).
- Join our upcoming dev meetings ([meeting access and agenda](https://docs.google.com/document/d/1l_M0om0qUEN_NNiGgpqJ2tvsF2iioHkaARDeh6b70B0/view)).
- [Join the flux-dev mailing list](https://lists.cncf.io/g/cncf-flux-dev).
- Check out [how to contribute](CONTRIBUTING.md) to the project.
- Check out the [project roadmap](https://fluxcd.io/roadmap/).
### Featured Talks
### Events
- 28 Oct 2020 - [The Kubelist Podcast: Flux with Michael Bridgen](https://www.heavybit.com/library/podcasts/the-kubelist-podcast/ep-5-flux-with-michael-bridgen-of-weaveworks/)
- 19 Oct 2020 - [The Power of GitOps with Flux & GitOps Toolkit - Part 1 with Leigh Capili](https://youtu.be/0v5bjysXTL8)
- 12 Oct 2020 - [Rawkode Live: Introduction to GitOps Toolkit with Stefan Prodan](https://youtu.be/HqTzuOBP0eY)
- 4 Sep 2020 - [KubeCon Europe: The road to Flux v2 and Progressive Delivery with Stefan Prodan & Hidde Beydals](https://youtu.be/8v94nUkXsxU)
- 25 June 2020 - [Cloud Native Nordics: Introduction to GitOps & GitOps Toolkit with Alexis Richardson & Stefan Prodan](https://youtu.be/qQBtSkgl7tI)
- 7 May 2020 - [GitOps Days - Community Special: GitOps Toolkit Experimentation with Stefan Prodan](https://youtu.be/WHzxunv4DKk?t=6521)
Check out our **[events calendar](https://fluxcd.io/#calendar)**,
both with upcoming talks, events and meetings you can attend.
Or view the **[resources section](https://fluxcd.io/resources)**
with past events videos you can watch.
### Upcoming Events
- 30 Nov 2020 - [The Power of GitOps with Flux & GitOps Toolkit - Part 3 with Leigh Capili](https://www.meetup.com/Weave-User-Group/events/274657228/)
We are looking forward to seeing you with us!
We look forward to seeing you with us!

View File

@@ -1,6 +0,0 @@
FROM stefanprodan/alpine-base:latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,25 +1,22 @@
# Flux GitHub Action
Example workflow:
To install the latest Flux CLI on Linux, macOS or Windows GitHub runners:
```yaml
name: e2e
on:
push:
branches:
- '*'
jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Setup Kubernetes Kind
uses: engineerd/setup-kind@v0.5.0
- name: Install Flux in Kubernetes Kind
run: flux install
steps:
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
with:
version: 'latest'
- name: Run Flux CLI
run: flux version --client
```
The Flux GitHub Action can be used to automate various tasks in CI, such as:
- [Automate Flux upgrades on clusters via Pull Requests](https://fluxcd.io/flux/flux-gh-action/#automate-flux-updates)
- [Push Kubernetes manifests to container registries](https://fluxcd.io/flux/flux-gh-action/#push-kubernetes-manifests-to-container-registries)
- [Run end-to-end testing with Flux and Kubernetes Kind](https://fluxcd.io/flux/flux-gh-action/#end-to-end-testing)
For more information, please see the [Flux GitHub Action documentation](https://fluxcd.io/flux/flux-gh-action/).

View File

@@ -1,15 +1,120 @@
name: 'kustomize'
description: 'A GitHub Action for running Flux commands'
author: 'Flux project'
name: Setup Flux CLI
description: A GitHub Action for installing the Flux CLI
author: Flux project
branding:
icon: 'command'
color: 'blue'
color: blue
icon: command
inputs:
version:
description: 'strict semver'
description: "Flux version e.g. 2.0.0 (defaults to latest stable release)"
required: false
arch:
description: "arch can be amd64, arm64 or arm"
required: false
deprecationMessage: "No longer required, action will now detect runner arch."
bindir:
description: "Alternative location for the Flux binary, defaults to path relative to $RUNNER_TOOL_CACHE."
required: false
token:
description: "Token used to authentication against the GitHub.com API. Defaults to the token from the GitHub context of the workflow."
required: false
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.version }}
using: composite
steps:
- name: "Download the binary to the runner's cache dir"
shell: bash
run: |
VERSION=${{ inputs.version }}
TOKEN=${{ inputs.token }}
if [[ -z "$TOKEN" ]]; then
TOKEN=${{ github.token }}
fi
if [[ -z "$VERSION" ]] || [[ "$VERSION" = "latest" ]]; then
VERSION=$(curl -fsSL -H "Authorization: token ${TOKEN}" https://api.github.com/repos/fluxcd/flux2/releases/latest | grep tag_name | cut -d '"' -f 4)
fi
if [[ -z "$VERSION" ]]; then
echo "Unable to determine Flux CLI version"
exit 1
fi
if [[ $VERSION = v* ]]; then
VERSION="${VERSION:1}"
fi
OS=$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')
if [[ "$OS" == "macos" ]]; then
OS="darwin"
fi
ARCH=$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')
if [[ "$ARCH" == "x64" ]]; then
ARCH="amd64"
elif [[ "$ARCH" == "x86" ]]; then
ARCH="386"
fi
FLUX_EXEC_FILE="flux"
if [[ "$OS" == "windows" ]]; then
FLUX_EXEC_FILE="${FLUX_EXEC_FILE}.exe"
fi
FLUX_TOOL_DIR=${{ inputs.bindir }}
if [[ -z "$FLUX_TOOL_DIR" ]]; then
FLUX_TOOL_DIR="${RUNNER_TOOL_CACHE}/flux2/${VERSION}/${OS}/${ARCH}"
fi
if [[ ! -x "$FLUX_TOOL_DIR/FLUX_EXEC_FILE" ]]; then
DL_DIR="$(mktemp -dt flux2-XXXXXX)"
trap 'rm -rf $DL_DIR' EXIT
echo "Downloading flux ${VERSION} for ${OS}/${ARCH}"
FLUX_TARGET_FILE="flux_${VERSION}_${OS}_${ARCH}.tar.gz"
if [[ "$OS" == "windows" ]]; then
FLUX_TARGET_FILE="flux_${VERSION}_${OS}_${ARCH}.zip"
fi
FLUX_CHECKSUMS_FILE="flux_${VERSION}_checksums.txt"
FLUX_DOWNLOAD_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/"
curl -fsSL -o "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_TARGET_FILE"
curl -fsSL -o "$DL_DIR/$FLUX_CHECKSUMS_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_CHECKSUMS_FILE"
echo "Verifying checksum"
sum=""
if command -v openssl > /dev/null; then
sum=$(openssl sha256 "$DL_DIR/$FLUX_TARGET_FILE" | awk '{print $2}')
elif command -v sha256sum > /dev/null; then
sum=$(sha256sum "$DL_DIR/$FLUX_TARGET_FILE" | awk '{print $1}')
fi
if [[ -z "$sum" ]]; then
echo "Neither openssl nor sha256sum found. Cannot calculate checksum."
exit 1
fi
expected_sum=$(grep " $FLUX_TARGET_FILE\$" "$DL_DIR/$FLUX_CHECKSUMS_FILE" | awk '{print $1}')
if [ "$sum" != "$expected_sum" ]; then
echo "SHA sum of ${FLUX_TARGET_FILE} does not match. Aborting."
exit 1
fi
echo "Installing flux to ${FLUX_TOOL_DIR}"
mkdir -p "$FLUX_TOOL_DIR"
if [[ "$OS" == "windows" ]]; then
unzip "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_EXEC_FILE" -d "$FLUX_TOOL_DIR"
else
tar xzf "$DL_DIR/$FLUX_TARGET_FILE" -C "$FLUX_TOOL_DIR" $FLUX_EXEC_FILE
fi
chmod +x "$FLUX_TOOL_DIR/$FLUX_EXEC_FILE"
fi
echo "Adding flux to path"
echo "$FLUX_TOOL_DIR" >> "$GITHUB_PATH"
- name: "Print installed flux version"
shell: bash
run: |
flux -v

View File

@@ -1,40 +0,0 @@
#!/bin/bash
# Copyright 2020 The Flux authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
VERSION=$1
if [ -z $VERSION ]; then
# Find latest release if no version is specified
VERSION=$(curl https://api.github.com/repos/fluxcd/flux2/releases/latest -sL | grep tag_name | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-)
fi
# Download linux binary
BIN_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_amd64.tar.gz"
curl -sL $BIN_URL | tar xz
# Copy binary to GitHub runner
mkdir -p $GITHUB_WORKSPACE/bin
cp ./flux $GITHUB_WORKSPACE/bin
chmod +x $GITHUB_WORKSPACE/bin/flux
# Print version
$GITHUB_WORKSPACE/bin/flux -v
# Add binary to GitHub runner path
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH

57
cmd/flux/alert.go Normal file
View File

@@ -0,0 +1,57 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta3"
)
// notificationv1.Alert
var alertType = apiType{
kind: notificationv1.AlertKind,
humanKind: "alert",
groupVersion: notificationv1.GroupVersion,
}
type alertAdapter struct {
*notificationv1.Alert
}
func (a alertAdapter) asClientObject() client.Object {
return a.Alert
}
func (a alertAdapter) deepCopyClientObject() client.Object {
return a.Alert.DeepCopy()
}
// notificationv1.Alert
type alertListAdapter struct {
*notificationv1.AlertList
}
func (a alertListAdapter) asClientList() client.ObjectList {
return a.AlertList
}
func (a alertListAdapter) len() int {
return len(a.AlertList.Items)
}

View File

@@ -0,0 +1,57 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta3"
)
// notificationv1.Provider
var alertProviderType = apiType{
kind: notificationv1.ProviderKind,
humanKind: "alert provider",
groupVersion: notificationv1.GroupVersion,
}
type alertProviderAdapter struct {
*notificationv1.Provider
}
func (a alertProviderAdapter) asClientObject() client.Object {
return a.Provider
}
func (a alertProviderAdapter) deepCopyClientObject() client.Object {
return a.Provider.DeepCopy()
}
// notificationv1.Provider
type alertProviderListAdapter struct {
*notificationv1.ProviderList
}
func (a alertProviderListAdapter) asClientList() client.ObjectList {
return a.ProviderList
}
func (a alertProviderListAdapter) len() int {
return len(a.ProviderList.Items)
}

View File

@@ -18,237 +18,204 @@ package main
import (
"context"
"crypto/elliptic"
"fmt"
"net/url"
"path/filepath"
"time"
"strings"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/manifestgen/sync"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
var bootstrapCmd = &cobra.Command{
Use: "bootstrap",
Short: "Bootstrap toolkit components",
Long: "The bootstrap sub-commands bootstrap the toolkit components on the targeted Git provider.",
Short: "Deploy Flux on a cluster the GitOps way.",
Long: `The bootstrap sub-commands push the Flux manifests to a Git repository
and deploy Flux on the cluster.`,
}
var (
bootstrapVersion string
bootstrapComponents []string
bootstrapRegistry string
bootstrapImagePullSecret string
bootstrapBranch string
bootstrapWatchAllNamespaces bool
bootstrapNetworkPolicy bool
bootstrapManifestsPath string
bootstrapArch = flags.Arch(defaults.Arch)
bootstrapLogLevel = flags.LogLevel(defaults.LogLevel)
bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"}
bootstrapTokenAuth bool
)
type bootstrapFlags struct {
version string
logLevel flags.LogLevel
branch string
recurseSubmodules bool
manifestsPath string
defaultComponents []string
extraComponents []string
requiredComponents []string
registry string
imagePullSecret string
secretName string
tokenAuth bool
keyAlgorithm flags.PublicKeyAlgorithm
keyRSABits flags.RSAKeyBits
keyECDSACurve flags.ECDSACurve
sshHostname string
caFile string
privateKeyFile string
watchAllNamespaces bool
networkPolicy bool
clusterDomain string
tolerationKeys []string
authorName string
authorEmail string
gpgKeyRingPath string
gpgPassphrase string
gpgKeyID string
force bool
commitMessageAppendix string
}
const (
bootstrapDefaultBranch = "main"
)
var bootstrapArgs = NewBootstrapFlags()
func init() {
bootstrapCmd.PersistentFlags().StringVarP(&bootstrapVersion, "version", "v", defaults.Version,
"toolkit version")
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapComponents, "components", defaults.Components,
bootstrapCmd.PersistentFlags().StringVarP(&bootstrapArgs.version, "version", "v", "",
"toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases")
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapArgs.defaultComponents, "components", rootArgs.defaults.Components,
"list of components, accepts comma-separated values")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapRegistry, "registry", "ghcr.io/fluxcd",
"container registry where the toolkit images are published")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapImagePullSecret, "image-pull-secret", "",
"Kubernetes secret name used for pulling the toolkit images from a private registry")
bootstrapCmd.PersistentFlags().Var(&bootstrapArch, "arch", bootstrapArch.Description())
bootstrapCmd.PersistentFlags().StringVar(&bootstrapBranch, "branch", bootstrapDefaultBranch,
"default branch (for GitHub this must match the default branch setting for the organization)")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapWatchAllNamespaces, "watch-all-namespaces", true,
"watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapNetworkPolicy, "network-policy", true,
"deny ingress access to the toolkit controllers from other namespaces using network policies")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapTokenAuth, "token-auth", false,
"when enabled, the personal access token will be used instead of SSH deploy key")
bootstrapCmd.PersistentFlags().Var(&bootstrapLogLevel, "log-level", bootstrapLogLevel.Description())
bootstrapCmd.PersistentFlags().StringVar(&bootstrapManifestsPath, "manifests", "", "path to the manifest directory")
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapArgs.extraComponents, "components-extra", nil,
"list of components in addition to those supplied or defaulted, accepts values such as 'image-reflector-controller,image-automation-controller'")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.registry, "registry", "ghcr.io/fluxcd",
"container registry where the Flux controller images are published")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.imagePullSecret, "image-pull-secret", "",
"Kubernetes secret name used for pulling the controller images from a private registry")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.branch, "branch", bootstrapDefaultBranch, "Git branch")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.recurseSubmodules, "recurse-submodules", false,
"when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.manifestsPath, "manifests", "", "path to the manifest directory")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.watchAllNamespaces, "watch-all-namespaces", true,
"watch for custom resources in all namespaces, if set to false it will only watch the namespace where the Flux controllers are installed")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.networkPolicy, "network-policy", true,
"setup Kubernetes network policies to deny ingress access to the Flux controllers from other namespaces")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.tokenAuth, "token-auth", false,
"when enabled, the personal access token will be used instead of the SSH deploy key")
bootstrapCmd.PersistentFlags().Var(&bootstrapArgs.logLevel, "log-level", bootstrapArgs.logLevel.Description())
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.clusterDomain, "cluster-domain", rootArgs.defaults.ClusterDomain, "internal cluster domain")
bootstrapCmd.PersistentFlags().StringSliceVar(&bootstrapArgs.tolerationKeys, "toleration-keys", nil,
"list of toleration keys used to schedule the controller pods onto nodes with matching taints")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.secretName, "secret-name", rootArgs.defaults.Namespace, "name of the secret the sync credentials can be found in or stored to")
bootstrapCmd.PersistentFlags().Var(&bootstrapArgs.keyAlgorithm, "ssh-key-algorithm", bootstrapArgs.keyAlgorithm.Description())
bootstrapCmd.PersistentFlags().Var(&bootstrapArgs.keyRSABits, "ssh-rsa-bits", bootstrapArgs.keyRSABits.Description())
bootstrapCmd.PersistentFlags().Var(&bootstrapArgs.keyECDSACurve, "ssh-ecdsa-curve", bootstrapArgs.keyECDSACurve.Description())
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.sshHostname, "ssh-hostname", "", "SSH hostname, to be used when the SSH host differs from the HTTPS one")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.privateKeyFile, "private-key-file", "", "path to a private key file used for authenticating to the Git SSH server")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.authorName, "author-name", "Flux", "author name for Git commits")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.authorEmail, "author-email", "", "author email for Git commits")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.gpgKeyRingPath, "gpg-key-ring", "", "path to GPG key ring for signing commits")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.gpgPassphrase, "gpg-passphrase", "", "passphrase for decrypting GPG private key")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.gpgKeyID, "gpg-key-id", "", "key id for selecting a particular key")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.commitMessageAppendix, "commit-message-appendix", "", "string to add to the commit messages, e.g. '[ci skip]'")
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.force, "force", false, "override existing Flux installation if it's managed by a diffrent tool such as Helm")
bootstrapCmd.PersistentFlags().MarkHidden("manifests")
rootCmd.AddCommand(bootstrapCmd)
}
func NewBootstrapFlags() bootstrapFlags {
return bootstrapFlags{
logLevel: flags.LogLevel(rootArgs.defaults.LogLevel),
requiredComponents: []string{"source-controller", "kustomize-controller"},
keyAlgorithm: flags.PublicKeyAlgorithm(sourcesecret.ECDSAPrivateKeyAlgorithm),
keyRSABits: 2048,
keyECDSACurve: flags.ECDSACurve{Curve: elliptic.P384()},
}
}
func bootstrapComponents() []string {
return append(bootstrapArgs.defaultComponents, bootstrapArgs.extraComponents...)
}
func buildEmbeddedManifestBase() (string, error) {
if !isEmbeddedVersion(bootstrapArgs.version) {
return "", nil
}
tmpBaseDir, err := manifestgen.MkdirTempAbs("", "flux-manifests-")
if err != nil {
return "", err
}
if err := writeEmbeddedManifests(tmpBaseDir); err != nil {
return "", err
}
return tmpBaseDir, nil
}
func bootstrapValidate() error {
for _, component := range bootstrapRequiredComponents {
if !utils.ContainsItemString(bootstrapComponents, component) {
components := bootstrapComponents()
for _, component := range bootstrapArgs.requiredComponents {
if !utils.ContainsItemString(components, component) {
return fmt.Errorf("component %s is required", component)
}
}
if err := utils.ValidateComponents(components); err != nil {
return err
}
return nil
}
func generateInstallManifests(targetPath, namespace, tmpDir string, localManifests string) (string, error) {
opts := install.Options{
BaseURL: localManifests,
Version: bootstrapVersion,
Namespace: namespace,
Components: bootstrapComponents,
Registry: bootstrapRegistry,
ImagePullSecret: bootstrapImagePullSecret,
Arch: bootstrapArch.String(),
WatchAllNamespaces: bootstrapWatchAllNamespaces,
NetworkPolicy: bootstrapNetworkPolicy,
LogLevel: bootstrapLogLevel.String(),
NotificationController: defaults.NotificationController,
ManifestFile: defaults.ManifestFile,
Timeout: timeout,
TargetPath: targetPath,
}
if localManifests == "" {
opts.BaseURL = defaults.BaseURL
}
output, err := install.Generate(opts)
if err != nil {
return "", fmt.Errorf("generating install manifests failed: %w", err)
}
if filePath, err := output.WriteFile(tmpDir); err != nil {
return "", fmt.Errorf("generating install manifests failed: %w", err)
} else {
return filePath, nil
func mapTeamSlice(s []string, defaultPermission string) map[string]string {
m := make(map[string]string, len(s))
for _, v := range s {
m[v] = defaultPermission
if s := strings.Split(v, ":"); len(s) == 2 {
m[s[0]] = s[1]
}
}
return m
}
func applyInstallManifests(ctx context.Context, manifestPath string, components []string) error {
kubectlArgs := []string{"apply", "-f", manifestPath}
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
return fmt.Errorf("install failed")
// confirmBootstrap gets a confirmation for running bootstrap over an existing Flux installation.
// It returns a nil error if Flux is not installed or the user confirms overriding an existing installation
func confirmBootstrap(ctx context.Context, kubeClient client.Client) error {
installed := true
info, err := getFluxClusterInfo(ctx, kubeClient)
if err != nil {
if !errors.IsNotFound(err) {
return fmt.Errorf("cluster info unavailable: %w", err)
}
installed = false
}
for _, deployment := range components {
kubectlArgs = []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
return fmt.Errorf("install failed")
if installed {
err = confirmFluxInstallOverride(info)
if err != nil {
if err == promptui.ErrAbort {
return fmt.Errorf("bootstrap cancelled")
}
return err
}
}
return nil
}
func generateSyncManifests(url, branch, name, namespace, targetPath, tmpDir string, interval time.Duration) error {
opts := sync.Options{
Name: name,
Namespace: namespace,
URL: url,
Branch: branch,
Interval: interval,
TargetPath: targetPath,
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
}
manifest, err := sync.Generate(opts)
if err != nil {
return fmt.Errorf("generating install manifests failed: %w", err)
}
if _, err := manifest.WriteFile(tmpDir); err != nil {
return err
}
if err := utils.GenerateKustomizationYaml(filepath.Join(tmpDir, targetPath, namespace)); err != nil {
return err
}
return nil
}
func applySyncManifests(ctx context.Context, kubeClient client.Client, name, namespace, targetPath, tmpDir string) error {
kubectlArgs := []string{"apply", "-k", filepath.Join(tmpDir, targetPath, namespace)}
if _, err := utils.ExecKubectlCommand(ctx, utils.ModeStderrOS, kubeconfig, kubecontext, kubectlArgs...); err != nil {
return err
}
logger.Waitingf("waiting for cluster sync")
var gitRepository sourcev1.GitRepository
if err := wait.PollImmediate(pollInterval, timeout,
isGitRepositoryReady(ctx, kubeClient, types.NamespacedName{Name: name, Namespace: namespace}, &gitRepository)); err != nil {
return err
}
var kustomization kustomizev1.Kustomization
if err := wait.PollImmediate(pollInterval, timeout,
isKustomizationReady(ctx, kubeClient, types.NamespacedName{Name: name, Namespace: namespace}, &kustomization)); err != nil {
return err
}
return nil
}
func shouldInstallManifests(ctx context.Context, kubeClient client.Client, namespace string) bool {
namespacedName := types.NamespacedName{
Namespace: namespace,
Name: namespace,
}
var kustomization kustomizev1.Kustomization
if err := kubeClient.Get(ctx, namespacedName, &kustomization); err != nil {
return true
}
return kustomization.Status.LastAppliedRevision == ""
}
func shouldCreateDeployKey(ctx context.Context, kubeClient client.Client, namespace string) bool {
namespacedName := types.NamespacedName{
Namespace: namespace,
Name: namespace,
}
var existing corev1.Secret
if err := kubeClient.Get(ctx, namespacedName, &existing); err != nil {
return true
}
return false
}
func generateDeployKey(ctx context.Context, kubeClient client.Client, url *url.URL, namespace string) (string, error) {
pair, err := generateKeyPair(ctx)
if err != nil {
return "", err
}
hostKey, err := scanHostKey(ctx, url)
if err != nil {
return "", err
}
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
Namespace: namespace,
},
StringData: map[string]string{
"identity": string(pair.PrivateKey),
"identity.pub": string(pair.PublicKey),
"known_hosts": string(hostKey),
},
}
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return "", err
}
return string(pair.PublicKey), nil
}

View File

@@ -0,0 +1,297 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/bootstrap"
"github.com/fluxcd/flux2/v2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sync"
)
var bootstrapBServerCmd = &cobra.Command{
Use: "bitbucket-server",
Short: "Deploy Flux on a cluster connected to a Bitbucket Server repository",
Long: `The bootstrap bitbucket-server command creates the Bitbucket Server repository if it doesn't exists and
commits the Flux manifests to the master branch.
Then it configures the target cluster to synchronize with the repository.
If the Flux components are present on the cluster,
the bootstrap command will perform an upgrade if needed.`,
Example: ` # Create a Bitbucket Server API token and export it as an env var
export BITBUCKET_TOKEN=<my-token>
# Run bootstrap for a private repository using HTTPS token authentication
flux bootstrap bitbucket-server --owner=<project> --username=<user> --repository=<repository name> --hostname=<domain> --token-auth --path=clusters/my-cluster
# Run bootstrap for a private repository using SSH authentication
flux bootstrap bitbucket-server --owner=<project> --username=<user> --repository=<repository name> --hostname=<domain> --path=clusters/my-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap bitbucket-server --owner=<user> --repository=<repository name> --private=false --personal --hostname=<domain> --token-auth --path=clusters/my-cluster
# Run bootstrap for an existing repository with a branch named main
flux bootstrap bitbucket-server --owner=<project> --username=<user> --repository=<repository name> --branch=main --hostname=<domain> --token-auth --path=clusters/my-cluster`,
RunE: bootstrapBServerCmdRun,
}
const (
bServerDefaultPermission = "push"
bServerTokenEnvVar = "BITBUCKET_TOKEN"
)
type bServerFlags struct {
owner string
repository string
interval time.Duration
personal bool
username string
private bool
hostname string
path flags.SafeRelativePath
teams []string
readWriteKey bool
reconcile bool
}
var bServerArgs bServerFlags
func init() {
bootstrapBServerCmd.Flags().StringVar(&bServerArgs.owner, "owner", "", "Bitbucket Server user or project name")
bootstrapBServerCmd.Flags().StringVar(&bServerArgs.repository, "repository", "", "Bitbucket Server repository name")
bootstrapBServerCmd.Flags().StringSliceVar(&bServerArgs.teams, "group", []string{}, "Bitbucket Server groups to be given write access (also accepts comma-separated values)")
bootstrapBServerCmd.Flags().BoolVar(&bServerArgs.personal, "personal", false, "if true, the owner is assumed to be a Bitbucket Server user; otherwise a group")
bootstrapBServerCmd.Flags().StringVarP(&bServerArgs.username, "username", "u", "git", "authentication username")
bootstrapBServerCmd.Flags().BoolVar(&bServerArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapBServerCmd.Flags().DurationVar(&bServerArgs.interval, "interval", time.Minute, "sync interval")
bootstrapBServerCmd.Flags().StringVar(&bServerArgs.hostname, "hostname", "", "Bitbucket Server hostname")
bootstrapBServerCmd.Flags().Var(&bServerArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapBServerCmd.Flags().BoolVar(&bServerArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapBServerCmd.Flags().BoolVar(&bServerArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapCmd.AddCommand(bootstrapBServerCmd)
}
func bootstrapBServerCmdRun(cmd *cobra.Command, args []string) error {
bitbucketToken := os.Getenv(bServerTokenEnvVar)
if bitbucketToken == "" {
var err error
bitbucketToken, err = readPasswordFromStdin("Please enter your Bitbucket personal access token (PAT): ")
if err != nil {
return fmt.Errorf("could not read token: %w", err)
}
}
if bServerArgs.hostname == "" {
return fmt.Errorf("invalid hostname %q", bServerArgs.hostname)
}
if err := bootstrapValidate(); err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
if !bootstrapArgs.force {
err = confirmBootstrap(ctx, kubeClient)
if err != nil {
return err
}
}
// Manifest base
if ver, err := getVersion(bootstrapArgs.version); err != nil {
return err
} else {
bootstrapArgs.version = ver
}
manifestsBase, err := buildEmbeddedManifestBase()
if err != nil {
return err
}
defer os.RemoveAll(manifestsBase)
user := bServerArgs.username
if bServerArgs.personal {
user = bServerArgs.owner
}
var caBundle []byte
if bootstrapArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
// Build Bitbucket Server provider
providerCfg := provider.Config{
Provider: provider.GitProviderStash,
Hostname: bServerArgs.hostname,
Username: user,
Token: bitbucketToken,
CaBundle: caBundle,
}
providerClient, err := provider.BuildGitProvider(providerCfg)
if err != nil {
return err
}
// Lazy go-git repository
tmpDir, err := manifestgen.MkdirTempAbs("", "flux-bootstrap-")
if err != nil {
return fmt.Errorf("failed to create temporary working dir: %w", err)
}
defer os.RemoveAll(tmpDir)
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
gitClient, err := gogit.NewClient(tmpDir, &git.AuthOptions{
Transport: git.HTTPS,
Username: user,
Password: bitbucketToken,
CAFile: caBundle,
}, clientOpts...)
if err != nil {
return fmt.Errorf("failed to create a Git client: %w", err)
}
// Install manifest config
installOptions := install.Options{
BaseURL: rootArgs.defaults.BaseURL,
Version: bootstrapArgs.version,
Namespace: *kubeconfigArgs.Namespace,
Components: bootstrapComponents(),
Registry: bootstrapArgs.registry,
ImagePullSecret: bootstrapArgs.imagePullSecret,
WatchAllNamespaces: bootstrapArgs.watchAllNamespaces,
NetworkPolicy: bootstrapArgs.networkPolicy,
LogLevel: bootstrapArgs.logLevel.String(),
NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout,
TargetPath: bServerArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys,
}
if customBaseURL := bootstrapArgs.manifestsPath; customBaseURL != "" {
installOptions.BaseURL = customBaseURL
}
// Source generation and secret config
secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName,
Namespace: *kubeconfigArgs.Namespace,
TargetPath: bServerArgs.path.String(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
if bootstrapArgs.tokenAuth {
if bServerArgs.personal {
secretOpts.Username = bServerArgs.owner
} else {
secretOpts.Username = bServerArgs.username
}
secretOpts.Password = bitbucketToken
secretOpts.CAFile = caBundle
} else {
keypair, err := sourcesecret.LoadKeyPairFromPath(bootstrapArgs.privateKeyFile, gitArgs.password)
if err != nil {
return err
}
secretOpts.Keypair = keypair
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
secretOpts.SSHHostname = bServerArgs.hostname
if bootstrapArgs.sshHostname != "" {
secretOpts.SSHHostname = bootstrapArgs.sshHostname
}
}
// Sync manifest config
syncOpts := sync.Options{
Interval: bServerArgs.interval,
Name: *kubeconfigArgs.Namespace,
Namespace: *kubeconfigArgs.Namespace,
Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName,
TargetPath: bServerArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
}
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
if err != nil {
return err
}
// Bootstrap config
bootstrapOpts := []bootstrap.GitProviderOption{
bootstrap.WithProviderRepository(bServerArgs.owner, bServerArgs.repository, bServerArgs.personal),
bootstrap.WithBranch(bootstrapArgs.branch),
bootstrap.WithBootstrapTransportType("https"),
bootstrap.WithSignature(bootstrapArgs.authorName, bootstrapArgs.authorEmail),
bootstrap.WithCommitMessageAppendix(bootstrapArgs.commitMessageAppendix),
bootstrap.WithProviderTeamPermissions(mapTeamSlice(bServerArgs.teams, bServerDefaultPermission)),
bootstrap.WithReadWriteKeyPermissions(bServerArgs.readWriteKey),
bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions),
bootstrap.WithLogger(logger),
bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID),
}
if bootstrapArgs.sshHostname != "" {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname))
}
if bootstrapArgs.tokenAuth {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSyncTransportType("https"))
}
if !bServerArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
}
if bServerArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
// Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
if err != nil {
return err
}
// Run
return bootstrap.Run(ctx, b, manifestsBase, installOptions, secretOpts, syncOpts, rootArgs.pollInterval, rootArgs.timeout)
}

376
cmd/flux/bootstrap_git.go Normal file
View File

@@ -0,0 +1,376 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"net/url"
"os"
"strings"
"time"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/bootstrap"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sync"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
)
var bootstrapGitCmd = &cobra.Command{
Use: "git",
Short: "Deploy Flux on a cluster connected to a Git repository",
Long: `The bootstrap git command commits the Flux manifests to the
branch of a Git repository. And then it configures the target cluster to synchronize with
that repository. If the Flux components are present on the cluster, the bootstrap
command will perform an upgrade if needed.`,
Example: ` # Run bootstrap for a Git repository and authenticate with your SSH agent
flux bootstrap git --url=ssh://git@example.com/repository.git --path=clusters/my-cluster
# Run bootstrap for a Git repository and authenticate using a password
flux bootstrap git --url=https://example.com/repository.git --password=<password> --path=clusters/my-cluster
# Run bootstrap for a Git repository and authenticate using a password from environment variable
GIT_PASSWORD=<password> && flux bootstrap git --url=https://example.com/repository.git --path=clusters/my-cluster
# Run bootstrap for a Git repository with a passwordless private key
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key> --path=clusters/my-cluster
# Run bootstrap for a Git repository with a private key and password
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key> --password=<password> --path=clusters/my-cluster
# Run bootstrap for a Git repository on AWS CodeCommit
flux bootstrap git --url=ssh://<SSH-Key-ID>@git-codecommit.<region>.amazonaws.com/v1/repos/<repository> --private-key-file=<path/to/private.key> --password=<SSH-passphrase> --path=clusters/my-cluster
# Run bootstrap for a Git repository on Azure Devops
flux bootstrap git --url=ssh://git@ssh.dev.azure.com/v3/<org>/<project>/<repository> --ssh-key-algorithm=rsa --ssh-rsa-bits=4096 --path=clusters/my-cluster
`,
RunE: bootstrapGitCmdRun,
}
type gitFlags struct {
url string
interval time.Duration
path flags.SafeRelativePath
username string
password string
silent bool
insecureHttpAllowed bool
}
const (
gitPasswordEnvVar = "GIT_PASSWORD"
)
var gitArgs gitFlags
func init() {
bootstrapGitCmd.Flags().StringVar(&gitArgs.url, "url", "", "Git repository URL")
bootstrapGitCmd.Flags().DurationVar(&gitArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGitCmd.Flags().Var(&gitArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGitCmd.Flags().StringVarP(&gitArgs.username, "username", "u", "git", "basic authentication username")
bootstrapGitCmd.Flags().StringVarP(&gitArgs.password, "password", "p", "", "basic authentication password")
bootstrapGitCmd.Flags().BoolVarP(&gitArgs.silent, "silent", "s", false, "assumes the deploy key is already setup, skips confirmation")
bootstrapGitCmd.Flags().BoolVar(&gitArgs.insecureHttpAllowed, "allow-insecure-http", false, "allows insecure HTTP connections")
bootstrapCmd.AddCommand(bootstrapGitCmd)
}
func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
gitPassword := os.Getenv(gitPasswordEnvVar)
if gitPassword != "" && gitArgs.password == "" {
gitArgs.password = gitPassword
}
if bootstrapArgs.tokenAuth && gitArgs.password == "" {
var err error
gitPassword, err = readPasswordFromStdin("Please enter your Git repository password: ")
if err != nil {
return fmt.Errorf("could not read token: %w", err)
}
gitArgs.password = gitPassword
}
if err := bootstrapValidate(); err != nil {
return err
}
repositoryURL, err := url.Parse(gitArgs.url)
if err != nil {
return err
}
if strings.Contains(repositoryURL.Hostname(), "git-codecommit") && strings.Contains(repositoryURL.Hostname(), "amazonaws.com") {
if repositoryURL.Scheme == string(git.SSH) {
if repositoryURL.User == nil {
return fmt.Errorf("invalid AWS CodeCommit url: ssh username should be specified in the url")
}
if repositoryURL.User.Username() == git.DefaultPublicKeyAuthUser {
return fmt.Errorf("invalid AWS CodeCommit url: ssh username should be the SSH key ID for the provided private key")
}
if bootstrapArgs.privateKeyFile == "" {
return fmt.Errorf("private key file is required for bootstrapping against AWS CodeCommit using ssh")
}
}
if repositoryURL.Scheme == string(git.HTTPS) && !bootstrapArgs.tokenAuth {
return fmt.Errorf("--token-auth=true must be specified for using an HTTPS AWS CodeCommit url")
}
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
if !bootstrapArgs.force {
err = confirmBootstrap(ctx, kubeClient)
if err != nil {
return err
}
}
// Manifest base
if ver, err := getVersion(bootstrapArgs.version); err != nil {
return err
} else {
bootstrapArgs.version = ver
}
manifestsBase, err := buildEmbeddedManifestBase()
if err != nil {
return err
}
defer os.RemoveAll(manifestsBase)
// Lazy go-git repository
tmpDir, err := manifestgen.MkdirTempAbs("", "flux-bootstrap-")
if err != nil {
return fmt.Errorf("failed to create temporary working dir: %w", err)
}
defer os.RemoveAll(tmpDir)
var caBundle []byte
if bootstrapArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
authOpts, err := getAuthOpts(repositoryURL, caBundle)
if err != nil {
return fmt.Errorf("failed to create authentication options for %s: %w", repositoryURL.String(), err)
}
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
if gitArgs.insecureHttpAllowed {
clientOpts = append(clientOpts, gogit.WithInsecureCredentialsOverHTTP())
}
gitClient, err := gogit.NewClient(tmpDir, authOpts, clientOpts...)
if err != nil {
return fmt.Errorf("failed to create a Git client: %w", err)
}
// Install manifest config
installOptions := install.Options{
BaseURL: rootArgs.defaults.BaseURL,
Version: bootstrapArgs.version,
Namespace: *kubeconfigArgs.Namespace,
Components: bootstrapComponents(),
Registry: bootstrapArgs.registry,
ImagePullSecret: bootstrapArgs.imagePullSecret,
WatchAllNamespaces: bootstrapArgs.watchAllNamespaces,
NetworkPolicy: bootstrapArgs.networkPolicy,
LogLevel: bootstrapArgs.logLevel.String(),
NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout,
TargetPath: gitArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys,
}
if customBaseURL := bootstrapArgs.manifestsPath; customBaseURL != "" {
installOptions.BaseURL = customBaseURL
}
// Source generation and secret config
secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName,
Namespace: *kubeconfigArgs.Namespace,
TargetPath: gitArgs.path.String(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
if bootstrapArgs.tokenAuth {
secretOpts.Username = gitArgs.username
secretOpts.Password = gitArgs.password
secretOpts.CAFile = caBundle
// Remove port of the given host when not syncing over HTTP/S to not assume port for protocol
// This _might_ be overwritten later on by e.g. --ssh-hostname
if repositoryURL.Scheme != "https" && repositoryURL.Scheme != "http" {
repositoryURL.Host = repositoryURL.Hostname()
}
// Configure repository URL to match auth config for sync.
repositoryURL.User = nil
if !gitArgs.insecureHttpAllowed {
repositoryURL.Scheme = "https"
}
} else {
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.Password = gitArgs.password
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
// Configure repository URL to match auth config for sync
// Override existing user when user is not already set
// or when a username was passed in
if repositoryURL.User == nil || gitArgs.username != "git" {
repositoryURL.User = url.User(gitArgs.username)
}
repositoryURL.Scheme = "ssh"
if bootstrapArgs.sshHostname != "" {
repositoryURL.Host = bootstrapArgs.sshHostname
}
keypair, err := sourcesecret.LoadKeyPairFromPath(bootstrapArgs.privateKeyFile, gitArgs.password)
if err != nil {
return err
}
secretOpts.Keypair = keypair
// Configure last as it depends on the config above.
secretOpts.SSHHostname = repositoryURL.Host
}
// Sync manifest config
syncOpts := sync.Options{
Interval: gitArgs.interval,
Name: *kubeconfigArgs.Namespace,
Namespace: *kubeconfigArgs.Namespace,
URL: repositoryURL.String(),
Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName,
TargetPath: gitArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
}
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
if err != nil {
return err
}
// Bootstrap config
bootstrapOpts := []bootstrap.GitOption{
bootstrap.WithRepositoryURL(gitArgs.url),
bootstrap.WithBranch(bootstrapArgs.branch),
bootstrap.WithSignature(bootstrapArgs.authorName, bootstrapArgs.authorEmail),
bootstrap.WithCommitMessageAppendix(bootstrapArgs.commitMessageAppendix),
bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions),
bootstrap.WithPostGenerateSecretFunc(promptPublicKey),
bootstrap.WithLogger(logger),
bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID),
}
// Setup bootstrapper with constructed configs
b, err := bootstrap.NewPlainGitProvider(gitClient, kubeClient, bootstrapOpts...)
if err != nil {
return err
}
// Run
return bootstrap.Run(ctx, b, manifestsBase, installOptions, secretOpts, syncOpts, rootArgs.pollInterval, rootArgs.timeout)
}
// getAuthOpts retruns a AuthOptions based on the scheme
// of the given URL and the configured flags. If the protocol equals
// "ssh" but no private key is configured, authentication using the local
// SSH-agent is attempted.
func getAuthOpts(u *url.URL, caBundle []byte) (*git.AuthOptions, error) {
switch u.Scheme {
case "http":
if !gitArgs.insecureHttpAllowed {
return nil, fmt.Errorf("scheme http is insecure, pass --allow-insecure-http=true to allow it")
}
return &git.AuthOptions{
Transport: git.HTTP,
Username: gitArgs.username,
Password: gitArgs.password,
}, nil
case "https":
return &git.AuthOptions{
Transport: git.HTTPS,
Username: gitArgs.username,
Password: gitArgs.password,
CAFile: caBundle,
}, nil
case "ssh":
authOpts := &git.AuthOptions{
Transport: git.SSH,
Username: u.User.Username(),
Password: gitArgs.password,
}
if bootstrapArgs.privateKeyFile != "" {
pk, err := os.ReadFile(bootstrapArgs.privateKeyFile)
if err != nil {
return nil, err
}
kh, err := sourcesecret.ScanHostKey(u.Host)
if err != nil {
return nil, err
}
authOpts.Identity = pk
authOpts.KnownHosts = kh
}
return authOpts, nil
default:
return nil, fmt.Errorf("scheme %q is not supported", u.Scheme)
}
}
func promptPublicKey(ctx context.Context, secret corev1.Secret, _ sourcesecret.Options) error {
ppk, ok := secret.StringData[sourcesecret.PublicKeySecretKey]
if !ok {
return nil
}
logger.Successf("public key: %s", strings.TrimSpace(ppk))
if !gitArgs.silent {
prompt := promptui.Prompt{
Label: "Please give the key access to your repository",
IsConfirm: true,
}
_, err := prompt.Run()
if err != nil {
return fmt.Errorf("aborting")
}
}
return nil
}

275
cmd/flux/bootstrap_gitea.go Normal file
View File

@@ -0,0 +1,275 @@
/*
Copyright 2023 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/bootstrap"
"github.com/fluxcd/flux2/v2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sync"
)
var bootstrapGiteaCmd = &cobra.Command{
Use: "gitea",
Short: "Deploy Flux on a cluster connected to a Gitea repository",
Long: `The bootstrap gitea command creates the Gitea repository if it doesn't exists and
commits the Flux manifests to the specified branch.
Then it configures the target cluster to synchronize with that repository.
If the Flux components are present on the cluster,
the bootstrap command will perform an upgrade if needed.`,
Example: ` # Create a Gitea personal access token and export it as an env var
export GITEA_TOKEN=<my-token>
# Run bootstrap for a private repository owned by a Gitea organization
flux bootstrap gitea --owner=<organization> --repository=<repository name> --path=clusters/my-cluster
# Run bootstrap for a private repository and assign organization teams to it
flux bootstrap gitea --owner=<organization> --repository=<repository name> --team=<team1 slug> --team=<team2 slug> --path=clusters/my-cluster
# Run bootstrap for a private repository and assign organization teams with their access level(e.g maintain, admin) to it
flux bootstrap gitea --owner=<organization> --repository=<repository name> --team=<team1 slug>:<access-level> --path=clusters/my-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap gitea --owner=<user> --repository=<repository name> --private=false --personal=true --path=clusters/my-cluster
# Run bootstrap for a private repository hosted on Gitea Enterprise using SSH auth
flux bootstrap gitea --owner=<organization> --repository=<repository name> --hostname=<domain> --ssh-hostname=<domain> --path=clusters/my-cluster
# Run bootstrap for a private repository hosted on Gitea Enterprise using HTTPS auth
flux bootstrap gitea --owner=<organization> --repository=<repository name> --hostname=<domain> --token-auth --path=clusters/my-cluster
# Run bootstrap for an existing repository with a branch named main
flux bootstrap gitea --owner=<organization> --repository=<repository name> --branch=main --path=clusters/my-cluster`,
RunE: bootstrapGiteaCmdRun,
}
type giteaFlags struct {
owner string
repository string
interval time.Duration
personal bool
private bool
hostname string
path flags.SafeRelativePath
teams []string
readWriteKey bool
reconcile bool
}
const (
gtDefaultPermission = "maintain"
gtDefaultDomain = "gitea.com"
gtTokenEnvVar = "GITEA_TOKEN"
)
var giteaArgs giteaFlags
func init() {
bootstrapGiteaCmd.Flags().StringVar(&giteaArgs.owner, "owner", "", "Gitea user or organization name")
bootstrapGiteaCmd.Flags().StringVar(&giteaArgs.repository, "repository", "", "Gitea repository name")
bootstrapGiteaCmd.Flags().StringSliceVar(&giteaArgs.teams, "team", []string{}, "Gitea team and the access to be given to it(team:maintain). Defaults to maintainer access if no access level is specified (also accepts comma-separated values)")
bootstrapGiteaCmd.Flags().BoolVar(&giteaArgs.personal, "personal", false, "if true, the owner is assumed to be a Gitea user; otherwise an org")
bootstrapGiteaCmd.Flags().BoolVar(&giteaArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapGiteaCmd.Flags().DurationVar(&giteaArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGiteaCmd.Flags().StringVar(&giteaArgs.hostname, "hostname", gtDefaultDomain, "Gitea hostname")
bootstrapGiteaCmd.Flags().Var(&giteaArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGiteaCmd.Flags().BoolVar(&giteaArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapGiteaCmd.Flags().BoolVar(&giteaArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapCmd.AddCommand(bootstrapGiteaCmd)
}
func bootstrapGiteaCmdRun(cmd *cobra.Command, args []string) error {
gtToken := os.Getenv(gtTokenEnvVar)
if gtToken == "" {
var err error
gtToken, err = readPasswordFromStdin("Please enter your Gitea personal access token (PAT): ")
if err != nil {
return fmt.Errorf("could not read token: %w", err)
}
}
if err := bootstrapValidate(); err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
// Manifest base
if ver, err := getVersion(bootstrapArgs.version); err != nil {
return err
} else {
bootstrapArgs.version = ver
}
manifestsBase, err := buildEmbeddedManifestBase()
if err != nil {
return err
}
defer os.RemoveAll(manifestsBase)
var caBundle []byte
if bootstrapArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
// Build Gitea provider
providerCfg := provider.Config{
Provider: provider.GitProviderGitea,
Hostname: giteaArgs.hostname,
Token: gtToken,
CaBundle: caBundle,
}
providerClient, err := provider.BuildGitProvider(providerCfg)
if err != nil {
return err
}
tmpDir, err := manifestgen.MkdirTempAbs("", "flux-bootstrap-")
if err != nil {
return fmt.Errorf("failed to create temporary working dir: %w", err)
}
defer os.RemoveAll(tmpDir)
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
gitClient, err := gogit.NewClient(tmpDir, &git.AuthOptions{
Transport: git.HTTPS,
Username: giteaArgs.owner,
Password: gtToken,
CAFile: caBundle,
}, clientOpts...)
if err != nil {
return fmt.Errorf("failed to create a Git client: %w", err)
}
// Install manifest config
installOptions := install.Options{
BaseURL: rootArgs.defaults.BaseURL,
Version: bootstrapArgs.version,
Namespace: *kubeconfigArgs.Namespace,
Components: bootstrapComponents(),
Registry: bootstrapArgs.registry,
ImagePullSecret: bootstrapArgs.imagePullSecret,
WatchAllNamespaces: bootstrapArgs.watchAllNamespaces,
NetworkPolicy: bootstrapArgs.networkPolicy,
LogLevel: bootstrapArgs.logLevel.String(),
NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout,
TargetPath: giteaArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys,
}
if customBaseURL := bootstrapArgs.manifestsPath; customBaseURL != "" {
installOptions.BaseURL = customBaseURL
}
// Source generation and secret config
secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName,
Namespace: *kubeconfigArgs.Namespace,
TargetPath: giteaArgs.path.ToSlash(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
if bootstrapArgs.tokenAuth {
secretOpts.Username = "git"
secretOpts.Password = gtToken
secretOpts.CAFile = caBundle
} else {
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
secretOpts.SSHHostname = giteaArgs.hostname
if bootstrapArgs.sshHostname != "" {
secretOpts.SSHHostname = bootstrapArgs.sshHostname
}
}
// Sync manifest config
syncOpts := sync.Options{
Interval: giteaArgs.interval,
Name: *kubeconfigArgs.Namespace,
Namespace: *kubeconfigArgs.Namespace,
Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName,
TargetPath: giteaArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
}
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
if err != nil {
return err
}
// Bootstrap config
bootstrapOpts := []bootstrap.GitProviderOption{
bootstrap.WithProviderRepository(giteaArgs.owner, giteaArgs.repository, giteaArgs.personal),
bootstrap.WithBranch(bootstrapArgs.branch),
bootstrap.WithBootstrapTransportType("https"),
bootstrap.WithSignature(bootstrapArgs.authorName, bootstrapArgs.authorEmail),
bootstrap.WithCommitMessageAppendix(bootstrapArgs.commitMessageAppendix),
bootstrap.WithProviderTeamPermissions(mapTeamSlice(giteaArgs.teams, gtDefaultPermission)),
bootstrap.WithReadWriteKeyPermissions(giteaArgs.readWriteKey),
bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions),
bootstrap.WithLogger(logger),
bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID),
}
if bootstrapArgs.sshHostname != "" {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname))
}
if bootstrapArgs.tokenAuth {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSyncTransportType("https"))
}
if !giteaArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
}
if giteaArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
// Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
if err != nil {
return err
}
// Run
return bootstrap.Run(ctx, b, manifestsBase, installOptions, secretOpts, syncOpts, rootArgs.pollInterval, rootArgs.timeout)
}

View File

@@ -19,270 +19,264 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
"path"
"time"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/bootstrap"
"github.com/fluxcd/flux2/v2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sync"
)
var bootstrapGitHubCmd = &cobra.Command{
Use: "github",
Short: "Bootstrap toolkit components in a GitHub repository",
Short: "Deploy Flux on a cluster connected to a GitHub repository",
Long: `The bootstrap github command creates the GitHub repository if it doesn't exists and
commits the toolkit components manifests to the main branch.
Then it configures the target cluster to synchronize with the repository.
If the toolkit components are present on the cluster,
commits the Flux manifests to the specified branch.
Then it configures the target cluster to synchronize with that repository.
If the Flux components are present on the cluster,
the bootstrap command will perform an upgrade if needed.`,
Example: ` # Create a GitHub personal access token and export it as an env var
export GITHUB_TOKEN=<my-token>
# Run bootstrap for a private repo owned by a GitHub organization
flux bootstrap github --owner=<organization> --repository=<repo name>
# Run bootstrap for a private repository owned by a GitHub organization
flux bootstrap github --owner=<organization> --repository=<repository name> --path=clusters/my-cluster
# Run bootstrap for a private repo and assign organization teams to it
flux bootstrap github --owner=<organization> --repository=<repo name> --team=<team1 slug> --team=<team2 slug>
# Run bootstrap for a private repository and assign organization teams to it
flux bootstrap github --owner=<organization> --repository=<repository name> --team=<team1 slug> --team=<team2 slug> --path=clusters/my-cluster
# Run bootstrap for a repository path
flux bootstrap github --owner=<organization> --repository=<repo name> --path=dev-cluster
# Run bootstrap for a private repository and assign organization teams with their access level(e.g maintain, admin) to it
flux bootstrap github --owner=<organization> --repository=<repository name> --team=<team1 slug>:<access-level> --path=clusters/my-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap github --owner=<user> --repository=<repo name> --private=false --personal=true
flux bootstrap github --owner=<user> --repository=<repository name> --private=false --personal=true --path=clusters/my-cluster
# Run bootstrap for a private repo hosted on GitHub Enterprise using SSH auth
flux bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain> --ssh-hostname=<domain>
# Run bootstrap for a private repository hosted on GitHub Enterprise using SSH auth
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --ssh-hostname=<domain> --path=clusters/my-cluster
# Run bootstrap for a private repo hosted on GitHub Enterprise using HTTPS auth
flux bootstrap github --owner=<organization> --repository=<repo name> --hostname=<domain> --token-auth
# Run bootstrap for a private repository hosted on GitHub Enterprise using HTTPS auth
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --token-auth --path=clusters/my-cluster
# Run bootstrap for a an existing repository with a branch named main
flux bootstrap github --owner=<organization> --repository=<repo name> --branch=main
`,
# Run bootstrap for an existing repository with a branch named main
flux bootstrap github --owner=<organization> --repository=<repository name> --branch=main --path=clusters/my-cluster`,
RunE: bootstrapGitHubCmdRun,
}
var (
ghOwner string
ghRepository string
ghInterval time.Duration
ghPersonal bool
ghPrivate bool
ghHostname string
ghPath string
ghTeams []string
ghDelete bool
ghSSHHostname string
)
type githubFlags struct {
owner string
repository string
interval time.Duration
personal bool
private bool
hostname string
path flags.SafeRelativePath
teams []string
readWriteKey bool
reconcile bool
}
const (
ghDefaultPermission = "maintain"
ghDefaultDomain = "github.com"
ghTokenEnvVar = "GITHUB_TOKEN"
)
func init() {
bootstrapGitHubCmd.Flags().StringVar(&ghOwner, "owner", "", "GitHub user or organization name")
bootstrapGitHubCmd.Flags().StringVar(&ghRepository, "repository", "", "GitHub repository name")
bootstrapGitHubCmd.Flags().StringArrayVar(&ghTeams, "team", []string{}, "GitHub team to be given maintainer access")
bootstrapGitHubCmd.Flags().BoolVar(&ghPersonal, "personal", false, "is personal repository")
bootstrapGitHubCmd.Flags().BoolVar(&ghPrivate, "private", true, "is private repository")
bootstrapGitHubCmd.Flags().DurationVar(&ghInterval, "interval", time.Minute, "sync interval")
bootstrapGitHubCmd.Flags().StringVar(&ghHostname, "hostname", git.GitHubDefaultHostname, "GitHub hostname")
bootstrapGitHubCmd.Flags().StringVar(&ghSSHHostname, "ssh-hostname", "", "GitHub SSH hostname, to be used when the SSH host differs from the HTTPS one")
bootstrapGitHubCmd.Flags().StringVar(&ghPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
var githubArgs githubFlags
bootstrapGitHubCmd.Flags().BoolVar(&ghDelete, "delete", false, "delete repository (used for testing only)")
bootstrapGitHubCmd.Flags().MarkHidden("delete")
func init() {
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.owner, "owner", "", "GitHub user or organization name")
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.repository, "repository", "", "GitHub repository name")
bootstrapGitHubCmd.Flags().StringSliceVar(&githubArgs.teams, "team", []string{}, "GitHub team and the access to be given to it(team:maintain). Defaults to maintainer access if no access level is specified (also accepts comma-separated values)")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.personal, "personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapGitHubCmd.Flags().DurationVar(&githubArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.hostname, "hostname", ghDefaultDomain, "GitHub hostname")
bootstrapGitHubCmd.Flags().Var(&githubArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapCmd.AddCommand(bootstrapGitHubCmd)
}
func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
ghToken := os.Getenv(git.GitHubTokenName)
ghToken := os.Getenv(ghTokenEnvVar)
if ghToken == "" {
return fmt.Errorf("%s environment variable not found", git.GitHubTokenName)
var err error
ghToken, err = readPasswordFromStdin("Please enter your GitHub personal access token (PAT): ")
if err != nil {
return fmt.Errorf("could not read token: %w", err)
}
}
if err := bootstrapValidate(); err != nil {
return err
}
repository, err := git.NewRepository(ghRepository, ghOwner, ghHostname, ghToken, "flux", ghOwner+"@users.noreply.github.com")
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
if ghSSHHostname != "" {
repository.SSHHost = ghSSHHostname
if !bootstrapArgs.force {
err = confirmBootstrap(ctx, kubeClient)
if err != nil {
return err
}
}
provider := &git.GithubProvider{
IsPrivate: ghPrivate,
IsPersonal: ghPersonal,
// Manifest base
if ver, err := getVersion(bootstrapArgs.version); err != nil {
return err
} else {
bootstrapArgs.version = ver
}
tmpDir, err := ioutil.TempDir("", namespace)
manifestsBase, err := buildEmbeddedManifestBase()
if err != nil {
return err
}
defer os.RemoveAll(manifestsBase)
var caBundle []byte
if bootstrapArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
// Build GitHub provider
providerCfg := provider.Config{
Provider: provider.GitProviderGitHub,
Hostname: githubArgs.hostname,
Token: ghToken,
CaBundle: caBundle,
}
providerClient, err := provider.BuildGitProvider(providerCfg)
if err != nil {
return err
}
tmpDir, err := manifestgen.MkdirTempAbs("", "flux-bootstrap-")
if err != nil {
return fmt.Errorf("failed to create temporary working dir: %w", err)
}
defer os.RemoveAll(tmpDir)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
if ghDelete {
if err := provider.DeleteRepository(ctx, repository); err != nil {
return err
}
logger.Successf("repository deleted")
return nil
}
// create GitHub repository if doesn't exists
logger.Actionf("connecting to %s", ghHostname)
changed, err := provider.CreateRepository(ctx, repository)
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
gitClient, err := gogit.NewClient(tmpDir, &git.AuthOptions{
Transport: git.HTTPS,
Username: githubArgs.owner,
Password: ghToken,
CAFile: caBundle,
}, clientOpts...)
if err != nil {
return err
}
if changed {
logger.Successf("repository created")
return fmt.Errorf("failed to create a Git client: %w", err)
}
withErrors := false
// add teams to org repository
if !ghPersonal {
for _, team := range ghTeams {
if changed, err := provider.AddTeam(ctx, repository, team, ghDefaultPermission); err != nil {
logger.Failuref(err.Error())
withErrors = true
} else if changed {
logger.Successf("%s team access granted", team)
}
}
// Install manifest config
installOptions := install.Options{
BaseURL: rootArgs.defaults.BaseURL,
Version: bootstrapArgs.version,
Namespace: *kubeconfigArgs.Namespace,
Components: bootstrapComponents(),
Registry: bootstrapArgs.registry,
ImagePullSecret: bootstrapArgs.imagePullSecret,
WatchAllNamespaces: bootstrapArgs.watchAllNamespaces,
NetworkPolicy: bootstrapArgs.networkPolicy,
LogLevel: bootstrapArgs.logLevel.String(),
NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout,
TargetPath: githubArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys,
}
if customBaseURL := bootstrapArgs.manifestsPath; customBaseURL != "" {
installOptions.BaseURL = customBaseURL
}
// clone repository and checkout the main branch
if err := repository.Checkout(ctx, bootstrapBranch, tmpDir); err != nil {
return err
// Source generation and secret config
secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName,
Namespace: *kubeconfigArgs.Namespace,
TargetPath: githubArgs.path.ToSlash(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
logger.Successf("repository cloned")
// generate install manifests
logger.Generatef("generating manifests")
manifest, err := generateInstallManifests(ghPath, namespace, tmpDir, bootstrapManifestsPath)
if err != nil {
return err
}
// stage install manifests
changed, err = repository.Commit(ctx, path.Join(ghPath, namespace), "Add manifests")
if err != nil {
return err
}
// push install manifests
if changed {
if err := repository.Push(ctx); err != nil {
return err
}
logger.Successf("components manifests pushed")
if bootstrapArgs.tokenAuth {
secretOpts.Username = "git"
secretOpts.Password = ghToken
secretOpts.CAFile = caBundle
} else {
logger.Successf("components are up to date")
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
secretOpts.SSHHostname = githubArgs.hostname
if bootstrapArgs.sshHostname != "" {
secretOpts.SSHHostname = bootstrapArgs.sshHostname
}
}
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
// Sync manifest config
syncOpts := sync.Options{
Interval: githubArgs.interval,
Name: *kubeconfigArgs.Namespace,
Namespace: *kubeconfigArgs.Namespace,
Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName,
TargetPath: githubArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
}
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
if err != nil {
return err
}
// determine if repo synchronization is working
isInstall := shouldInstallManifests(ctx, kubeClient, namespace)
if isInstall {
// apply install manifests
logger.Actionf("installing components in %s namespace", namespace)
if err := applyInstallManifests(ctx, manifest, bootstrapComponents); err != nil {
return err
}
logger.Successf("install completed")
// Bootstrap config
bootstrapOpts := []bootstrap.GitProviderOption{
bootstrap.WithProviderRepository(githubArgs.owner, githubArgs.repository, githubArgs.personal),
bootstrap.WithBranch(bootstrapArgs.branch),
bootstrap.WithBootstrapTransportType("https"),
bootstrap.WithSignature(bootstrapArgs.authorName, bootstrapArgs.authorEmail),
bootstrap.WithCommitMessageAppendix(bootstrapArgs.commitMessageAppendix),
bootstrap.WithProviderTeamPermissions(mapTeamSlice(githubArgs.teams, ghDefaultPermission)),
bootstrap.WithReadWriteKeyPermissions(githubArgs.readWriteKey),
bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions),
bootstrap.WithLogger(logger),
bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID),
}
if bootstrapArgs.sshHostname != "" {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname))
}
if bootstrapArgs.tokenAuth {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSyncTransportType("https"))
}
if !githubArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
}
if githubArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
repoURL := repository.GetURL()
if bootstrapTokenAuth {
// setup HTTPS token auth
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
Namespace: namespace,
},
StringData: map[string]string{
"username": "git",
"password": ghToken,
},
}
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return err
}
} else {
// setup SSH deploy key
repoURL = repository.GetSSH()
if shouldCreateDeployKey(ctx, kubeClient, namespace) {
logger.Actionf("configuring deploy key")
u, err := url.Parse(repository.GetSSH())
if err != nil {
return fmt.Errorf("git URL parse failed: %w", err)
}
key, err := generateDeployKey(ctx, kubeClient, u, namespace)
if err != nil {
return fmt.Errorf("generating deploy key failed: %w", err)
}
keyName := "flux"
if ghPath != "" {
keyName = fmt.Sprintf("flux-%s", ghPath)
}
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
return err
} else if changed {
logger.Successf("deploy key configured")
}
}
}
// configure repo synchronization
logger.Actionf("generating sync manifests")
if err := generateSyncManifests(repoURL, bootstrapBranch, namespace, namespace, ghPath, tmpDir, ghInterval); err != nil {
// Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
if err != nil {
return err
}
// commit and push manifests
if changed, err = repository.Commit(ctx, path.Join(ghPath, namespace), "Add manifests"); err != nil {
return err
} else if changed {
if err := repository.Push(ctx); err != nil {
return err
}
logger.Successf("sync manifests pushed")
}
// apply manifests and waiting for sync
logger.Actionf("applying sync manifests")
if err := applySyncManifests(ctx, kubeClient, namespace, namespace, ghPath, tmpDir); err != nil {
return err
}
if withErrors {
return fmt.Errorf("bootstrap completed with errors")
}
logger.Successf("bootstrap finished")
return nil
// Run
return bootstrap.Run(ctx, b, manifestsBase, installOptions, secretOpts, syncOpts, rootArgs.pollInterval, rootArgs.timeout)
}

View File

@@ -19,232 +19,300 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
"path"
"regexp"
"strings"
"time"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/bootstrap"
"github.com/fluxcd/flux2/v2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sync"
)
var bootstrapGitLabCmd = &cobra.Command{
Use: "gitlab",
Short: "Bootstrap toolkit components in a GitLab repository",
Short: "Deploy Flux on a cluster connected to a GitLab repository",
Long: `The bootstrap gitlab command creates the GitLab repository if it doesn't exists and
commits the toolkit components manifests to the master branch.
Then it configures the target cluster to synchronize with the repository.
If the toolkit components are present on the cluster,
commits the Flux manifests to the specified branch.
Then it configures the target cluster to synchronize with that repository.
If the Flux components are present on the cluster,
the bootstrap command will perform an upgrade if needed.`,
Example: ` # Create a GitLab API token and export it as an env var
export GITLAB_TOKEN=<my-token>
# Run bootstrap for a private repo using HTTPS token authentication
flux bootstrap gitlab --owner=<group> --repository=<repo name> --token-auth
# Run bootstrap for a private repository using HTTPS token authentication
flux bootstrap gitlab --owner=<group> --repository=<repository name> --token-auth
# Run bootstrap for a private repo using SSH authentication
flux bootstrap gitlab --owner=<group> --repository=<repo name>
# Run bootstrap for a private repository using SSH authentication
flux bootstrap gitlab --owner=<group> --repository=<repository name>
# Run bootstrap for a repository path
flux bootstrap gitlab --owner=<group> --repository=<repo name> --path=dev-cluster
flux bootstrap gitlab --owner=<group> --repository=<repository name> --path=dev-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal --token-auth
flux bootstrap gitlab --owner=<user> --repository=<repository name> --private=false --personal --token-auth
# Run bootstrap for a private repo hosted on a GitLab server
flux bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain> --token-auth
# Run bootstrap for a private repository hosted on a GitLab server
flux bootstrap gitlab --owner=<group> --repository=<repository name> --hostname=<domain> --token-auth
# Run bootstrap for a an existing repository with a branch named main
flux bootstrap gitlab --owner=<organization> --repository=<repo name> --branch=main --token-auth
`,
# Run bootstrap for an existing repository with a branch named main
flux bootstrap gitlab --owner=<organization> --repository=<repository name> --branch=main --token-auth
# Run bootstrap for a private repository using Deploy Token authentication
flux bootstrap gitlab --owner=<group> --repository=<repository name> --deploy-token-auth
`,
RunE: bootstrapGitLabCmdRun,
}
var (
glOwner string
glRepository string
glInterval time.Duration
glPersonal bool
glPrivate bool
glHostname string
glSSHHostname string
glPath string
const (
glDefaultPermission = "maintain"
glDefaultDomain = "gitlab.com"
glTokenEnvVar = "GITLAB_TOKEN"
gitlabProjectRegex = `\A[[:alnum:]\x{00A9}-\x{1f9ff}_][[:alnum:]\p{Pd}\x{00A9}-\x{1f9ff}_\.]*\z`
)
type gitlabFlags struct {
owner string
repository string
interval time.Duration
personal bool
private bool
hostname string
path flags.SafeRelativePath
teams []string
readWriteKey bool
reconcile bool
deployTokenAuth bool
}
var gitlabArgs gitlabFlags
func init() {
bootstrapGitLabCmd.Flags().StringVar(&glOwner, "owner", "", "GitLab user or group name")
bootstrapGitLabCmd.Flags().StringVar(&glRepository, "repository", "", "GitLab repository name")
bootstrapGitLabCmd.Flags().BoolVar(&glPersonal, "personal", false, "is personal repository")
bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository")
bootstrapGitLabCmd.Flags().DurationVar(&glInterval, "interval", time.Minute, "sync interval")
bootstrapGitLabCmd.Flags().StringVar(&glHostname, "hostname", git.GitLabDefaultHostname, "GitLab hostname")
bootstrapGitLabCmd.Flags().StringVar(&glSSHHostname, "ssh-hostname", "", "GitLab SSH hostname, to be used when the SSH host differs from the HTTPS one")
bootstrapGitLabCmd.Flags().StringVar(&glPath, "path", "", "repository path, when specified the cluster sync will be scoped to this path")
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.owner, "owner", "", "GitLab user or group name")
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.repository, "repository", "", "GitLab repository name")
bootstrapGitLabCmd.Flags().StringSliceVar(&gitlabArgs.teams, "team", []string{}, "GitLab teams to be given maintainer access (also accepts comma-separated values)")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.personal, "personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapGitLabCmd.Flags().DurationVar(&gitlabArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.hostname, "hostname", glDefaultDomain, "GitLab hostname")
bootstrapGitLabCmd.Flags().Var(&gitlabArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.deployTokenAuth, "deploy-token-auth", false, "when enabled, a Project Deploy Token is generated and will be used instead of the SSH deploy token")
bootstrapCmd.AddCommand(bootstrapGitLabCmd)
}
func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
glToken := os.Getenv(git.GitLabTokenName)
glToken := os.Getenv(glTokenEnvVar)
if glToken == "" {
return fmt.Errorf("%s environment variable not found", git.GitLabTokenName)
var err error
glToken, err = readPasswordFromStdin("Please enter your GitLab personal access token (PAT): ")
if err != nil {
return fmt.Errorf("could not read token: %w", err)
}
}
if projectNameIsValid, err := regexp.MatchString(gitlabProjectRegex, gitlabArgs.repository); err != nil || !projectNameIsValid {
if err == nil {
err = fmt.Errorf("%s is an invalid project name for gitlab.\nIt can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'.", gitlabArgs.repository)
}
return err
}
if bootstrapArgs.tokenAuth && gitlabArgs.deployTokenAuth {
return fmt.Errorf("--token-auth and --deploy-token-auth cannot be set both.")
}
if err := bootstrapValidate(); err != nil {
return err
}
repository, err := git.NewRepository(glRepository, glOwner, glHostname, glToken, "flux", glOwner+"@users.noreply.gitlab.com")
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
if glSSHHostname != "" {
repository.SSHHost = glSSHHostname
if !bootstrapArgs.force {
err = confirmBootstrap(ctx, kubeClient)
if err != nil {
return err
}
}
provider := &git.GitLabProvider{
IsPrivate: glPrivate,
IsPersonal: glPersonal,
// Manifest base
if ver, err := getVersion(bootstrapArgs.version); err != nil {
return err
} else {
bootstrapArgs.version = ver
}
manifestsBase, err := buildEmbeddedManifestBase()
if err != nil {
return err
}
defer os.RemoveAll(manifestsBase)
var caBundle []byte
if bootstrapArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(bootstrapArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
// Build GitLab provider
providerCfg := provider.Config{
Provider: provider.GitProviderGitLab,
Hostname: gitlabArgs.hostname,
Token: glToken,
CaBundle: caBundle,
}
// Workaround for: https://github.com/fluxcd/go-git-providers/issues/55
if hostname := providerCfg.Hostname; hostname != glDefaultDomain &&
!strings.HasPrefix(hostname, "https://") &&
!strings.HasPrefix(hostname, "http://") {
providerCfg.Hostname = "https://" + providerCfg.Hostname
}
providerClient, err := provider.BuildGitProvider(providerCfg)
if err != nil {
return err
}
tmpDir, err := ioutil.TempDir("", namespace)
// Lazy go-git repository
tmpDir, err := manifestgen.MkdirTempAbs("", "flux-bootstrap-")
if err != nil {
return err
return fmt.Errorf("failed to create temporary working dir: %w", err)
}
defer os.RemoveAll(tmpDir)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
// create GitLab project if doesn't exists
logger.Actionf("connecting to %s", glHostname)
changed, err := provider.CreateRepository(ctx, repository)
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage(), gogit.WithFallbackToDefaultKnownHosts()}
gitClient, err := gogit.NewClient(tmpDir, &git.AuthOptions{
Transport: git.HTTPS,
Username: gitlabArgs.owner,
Password: glToken,
CAFile: caBundle,
}, clientOpts...)
if err != nil {
return err
}
if changed {
logger.Successf("repository created")
return fmt.Errorf("failed to create a Git client: %w", err)
}
// clone repository and checkout the master branch
if err := repository.Checkout(ctx, bootstrapBranch, tmpDir); err != nil {
return err
// Install manifest config
installOptions := install.Options{
BaseURL: rootArgs.defaults.BaseURL,
Version: bootstrapArgs.version,
Namespace: *kubeconfigArgs.Namespace,
Components: bootstrapComponents(),
Registry: bootstrapArgs.registry,
ImagePullSecret: bootstrapArgs.imagePullSecret,
WatchAllNamespaces: bootstrapArgs.watchAllNamespaces,
NetworkPolicy: bootstrapArgs.networkPolicy,
LogLevel: bootstrapArgs.logLevel.String(),
NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout,
TargetPath: gitlabArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys,
}
logger.Successf("repository cloned")
// generate install manifests
logger.Generatef("generating manifests")
manifest, err := generateInstallManifests(glPath, namespace, tmpDir, bootstrapManifestsPath)
if err != nil {
return err
if customBaseURL := bootstrapArgs.manifestsPath; customBaseURL != "" {
installOptions.BaseURL = customBaseURL
}
// stage install manifests
changed, err = repository.Commit(ctx, path.Join(glPath, namespace), "Add manifests")
if err != nil {
return err
// Source generation and secret config
secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName,
Namespace: *kubeconfigArgs.Namespace,
TargetPath: gitlabArgs.path.String(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
// push install manifests
if changed {
if err := repository.Push(ctx); err != nil {
return err
}
logger.Successf("components manifests pushed")
if bootstrapArgs.tokenAuth {
secretOpts.Username = "git"
secretOpts.Password = glToken
secretOpts.CAFile = caBundle
} else if gitlabArgs.deployTokenAuth {
// the actual deploy token will be reconciled later
secretOpts.CAFile = caBundle
} else {
logger.Successf("components are up to date")
}
// determine if repo synchronization is working
isInstall := shouldInstallManifests(ctx, kubeClient, namespace)
if isInstall {
// apply install manifests
logger.Actionf("installing components in %s namespace", namespace)
if err := applyInstallManifests(ctx, manifest, bootstrapComponents); err != nil {
keypair, err := sourcesecret.LoadKeyPairFromPath(bootstrapArgs.privateKeyFile, gitArgs.password)
if err != nil {
return err
}
logger.Successf("install completed")
}
secretOpts.Keypair = keypair
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
repoURL := repository.GetURL()
if bootstrapTokenAuth {
// setup HTTPS token auth
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
Namespace: namespace,
},
StringData: map[string]string{
"username": "git",
"password": glToken,
},
}
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return err
}
} else {
// setup SSH deploy key
repoURL = repository.GetSSH()
if shouldCreateDeployKey(ctx, kubeClient, namespace) {
logger.Actionf("configuring deploy key")
u, err := url.Parse(repoURL)
if err != nil {
return fmt.Errorf("git URL parse failed: %w", err)
}
key, err := generateDeployKey(ctx, kubeClient, u, namespace)
if err != nil {
return fmt.Errorf("generating deploy key failed: %w", err)
}
keyName := "flux"
if glPath != "" {
keyName = fmt.Sprintf("flux-%s", glPath)
}
if changed, err := provider.AddDeployKey(ctx, repository, key, keyName); err != nil {
return err
} else if changed {
logger.Successf("deploy key configured")
}
secretOpts.SSHHostname = gitlabArgs.hostname
if bootstrapArgs.sshHostname != "" {
secretOpts.SSHHostname = bootstrapArgs.sshHostname
}
}
// configure repo synchronization
logger.Actionf("generating sync manifests")
if err := generateSyncManifests(repoURL, bootstrapBranch, namespace, namespace, glPath, tmpDir, glInterval); err != nil {
// Sync manifest config
syncOpts := sync.Options{
Interval: gitlabArgs.interval,
Name: *kubeconfigArgs.Namespace,
Namespace: *kubeconfigArgs.Namespace,
Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName,
TargetPath: gitlabArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile,
RecurseSubmodules: bootstrapArgs.recurseSubmodules,
}
entityList, err := bootstrap.LoadEntityListFromPath(bootstrapArgs.gpgKeyRingPath)
if err != nil {
return err
}
// commit and push manifests
if changed, err = repository.Commit(ctx, path.Join(glPath, namespace), "Add manifests"); err != nil {
return err
} else if changed {
if err := repository.Push(ctx); err != nil {
return err
}
logger.Successf("sync manifests pushed")
// Bootstrap config
bootstrapOpts := []bootstrap.GitProviderOption{
bootstrap.WithProviderRepository(gitlabArgs.owner, gitlabArgs.repository, gitlabArgs.personal),
bootstrap.WithBranch(bootstrapArgs.branch),
bootstrap.WithBootstrapTransportType("https"),
bootstrap.WithSignature(bootstrapArgs.authorName, bootstrapArgs.authorEmail),
bootstrap.WithCommitMessageAppendix(bootstrapArgs.commitMessageAppendix),
bootstrap.WithProviderTeamPermissions(mapTeamSlice(gitlabArgs.teams, glDefaultPermission)),
bootstrap.WithReadWriteKeyPermissions(gitlabArgs.readWriteKey),
bootstrap.WithKubeconfig(kubeconfigArgs, kubeclientOptions),
bootstrap.WithLogger(logger),
bootstrap.WithGitCommitSigning(entityList, bootstrapArgs.gpgPassphrase, bootstrapArgs.gpgKeyID),
}
if bootstrapArgs.sshHostname != "" {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSSHHostname(bootstrapArgs.sshHostname))
}
if bootstrapArgs.tokenAuth || gitlabArgs.deployTokenAuth {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithSyncTransportType("https"))
}
if gitlabArgs.deployTokenAuth {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithDeployTokenAuth())
}
if !gitlabArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
}
if gitlabArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
// apply manifests and waiting for sync
logger.Actionf("applying sync manifests")
if err := applySyncManifests(ctx, kubeClient, namespace, namespace, glPath, tmpDir); err != nil {
// Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)
if err != nil {
return err
}
logger.Successf("bootstrap finished")
return nil
// Run
return bootstrap.Run(ctx, b, manifestsBase, installOptions, secretOpts, syncOpts, rootArgs.pollInterval, rootArgs.timeout)
}

31
cmd/flux/build.go Normal file
View File

@@ -0,0 +1,31 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/cobra"
)
var buildCmd = &cobra.Command{
Use: "build",
Short: "Build a flux resource",
Long: `The build command is used to build flux resources.`,
}
func init() {
rootCmd.AddCommand(buildCmd)
}

117
cmd/flux/build_artifact.go Normal file
View File

@@ -0,0 +1,117 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"os"
"strings"
"github.com/spf13/cobra"
oci "github.com/fluxcd/pkg/oci/client"
"github.com/fluxcd/pkg/sourceignore"
)
var buildArtifactCmd = &cobra.Command{
Use: "artifact",
Short: "Build artifact",
Long: withPreviewNote(`The build artifact command creates a tgz file with the manifests
from the given directory or a single manifest file.`),
Example: ` # Build the given manifests directory into an artifact
flux build artifact --path ./path/to/local/manifests --output ./path/to/artifact.tgz
# Build the given single manifest file into an artifact
flux build artifact --path ./path/to/local/manifest.yaml --output ./path/to/artifact.tgz
# List the files bundled in the artifact
tar -ztvf ./path/to/artifact.tgz
`,
RunE: buildArtifactCmdRun,
}
type buildArtifactFlags struct {
output string
path string
ignorePaths []string
}
var excludeOCI = append(strings.Split(sourceignore.ExcludeVCS, ","), strings.Split(sourceignore.ExcludeExt, ",")...)
var buildArtifactArgs buildArtifactFlags
func init() {
buildArtifactCmd.Flags().StringVarP(&buildArtifactArgs.path, "path", "p", "", "Path to the directory where the Kubernetes manifests are located.")
buildArtifactCmd.Flags().StringVarP(&buildArtifactArgs.output, "output", "o", "artifact.tgz", "Path to where the artifact tgz file should be written.")
buildArtifactCmd.Flags().StringSliceVar(&buildArtifactArgs.ignorePaths, "ignore-paths", excludeOCI, "set paths to ignore in .gitignore format")
buildCmd.AddCommand(buildArtifactCmd)
}
func buildArtifactCmdRun(cmd *cobra.Command, args []string) error {
if buildArtifactArgs.path == "" {
return fmt.Errorf("invalid path %q", buildArtifactArgs.path)
}
path := buildArtifactArgs.path
var err error
if buildArtifactArgs.path == "-" {
path, err = saveReaderToFile(os.Stdin)
if err != nil {
return err
}
defer os.Remove(path)
}
if _, err := os.Stat(path); err != nil {
return fmt.Errorf("invalid path '%s', must point to an existing directory or file", path)
}
logger.Actionf("building artifact from %s", path)
ociClient := oci.NewClient(oci.DefaultOptions())
if err := ociClient.Build(buildArtifactArgs.output, path, buildArtifactArgs.ignorePaths); err != nil {
return fmt.Errorf("building artifact failed, error: %w", err)
}
logger.Successf("artifact created at %s", buildArtifactArgs.output)
return nil
}
func saveReaderToFile(reader io.Reader) (string, error) {
b, err := io.ReadAll(bufio.NewReader(reader))
if err != nil {
return "", err
}
b = bytes.TrimRight(b, "\r\n")
f, err := os.CreateTemp("", "*.yaml")
if err != nil {
return "", fmt.Errorf("unable to create temp dir for stdin")
}
defer f.Close()
if _, err := f.Write(b); err != nil {
return "", fmt.Errorf("error writing stdin to file: %w", err)
}
return f.Name(), nil
}

View File

@@ -0,0 +1,70 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"os"
"strings"
"testing"
. "github.com/onsi/gomega"
)
func Test_saveReaderToFile(t *testing.T) {
g := NewWithT(t)
testString := `apiVersion: v1
kind: ConfigMap
metadata:
name: myapp
data:
foo: bar`
tests := []struct {
name string
string string
expectErr bool
}{
{
name: "yaml",
string: testString,
},
{
name: "yaml with carriage return",
string: testString + "\r\n",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tmpFile, err := saveReaderToFile(strings.NewReader(tt.string))
g.Expect(err).To(BeNil())
t.Cleanup(func() { _ = os.Remove(tmpFile) })
b, err := os.ReadFile(tmpFile)
if tt.expectErr {
g.Expect(err).To(Not(BeNil()))
return
}
g.Expect(err).To(BeNil())
g.Expect(string(b)).To(BeEquivalentTo(testString))
})
}
}

View File

@@ -0,0 +1,156 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"os"
"os/signal"
"github.com/fluxcd/pkg/ssa"
"github.com/spf13/cobra"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/flux2/v2/internal/build"
)
var buildKsCmd = &cobra.Command{
Use: "kustomization",
Aliases: []string{"ks"},
Short: "Build Kustomization",
Long: `The build command queries the Kubernetes API and fetches the specified Flux Kustomization.
It then uses the fetched in cluster flux kustomization to perform needed transformation on the local kustomization.yaml
pointed at by --path. The local kustomization.yaml is generated if it does not exist. Finally it builds the overlays using the local kustomization.yaml, and write the resulting multi-doc YAML to stdout.
It is possible to specify a Flux kustomization file using --kustomization-file.`,
Example: `# Build the local manifests as they were built on the cluster
flux build kustomization my-app --path ./path/to/local/manifests
# Build using a local flux kustomization file
flux build kustomization my-app --path ./path/to/local/manifests --kustomization-file ./path/to/local/my-app.yaml
# Build in dry-run mode without connecting to the cluster.
# Note that variable substitutions from Secrets and ConfigMaps are skipped in dry-run mode.
flux build kustomization my-app --path ./path/to/local/manifests \
--kustomization-file ./path/to/local/my-app.yaml \
--dry-run
# Exclude files by providing a comma separated list of entries that follow the .gitignore pattern fromat.
flux build kustomization my-app --path ./path/to/local/manifests \
--kustomization-file ./path/to/local/my-app.yaml \
--ignore-paths "/to_ignore/**/*.yaml,ignore.yaml"`,
ValidArgsFunction: resourceNamesCompletionFunc(kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)),
RunE: buildKsCmdRun,
}
type buildKsFlags struct {
kustomizationFile string
path string
ignorePaths []string
dryRun bool
}
var buildKsArgs buildKsFlags
func init() {
buildKsCmd.Flags().StringVar(&buildKsArgs.path, "path", "", "Path to the manifests location.")
buildKsCmd.Flags().StringVar(&buildKsArgs.kustomizationFile, "kustomization-file", "", "Path to the Flux Kustomization YAML file.")
buildKsCmd.Flags().StringSliceVar(&buildKsArgs.ignorePaths, "ignore-paths", nil, "set paths to ignore in .gitignore format")
buildKsCmd.Flags().BoolVar(&buildKsArgs.dryRun, "dry-run", false, "Dry run mode.")
buildCmd.AddCommand(buildKsCmd)
}
func buildKsCmdRun(cmd *cobra.Command, args []string) (err error) {
if len(args) < 1 {
return fmt.Errorf("%s name is required", kustomizationType.humanKind)
}
name := args[0]
if buildKsArgs.path == "" {
return fmt.Errorf("invalid resource path %q", buildKsArgs.path)
}
if fs, err := os.Stat(buildKsArgs.path); err != nil || !fs.IsDir() {
return fmt.Errorf("invalid resource path %q", buildKsArgs.path)
}
if buildKsArgs.dryRun && buildKsArgs.kustomizationFile == "" {
return fmt.Errorf("dry-run mode requires a kustomization file")
}
if buildKsArgs.kustomizationFile != "" {
if fs, err := os.Stat(buildKsArgs.kustomizationFile); os.IsNotExist(err) || fs.IsDir() {
return fmt.Errorf("invalid kustomization file %q", buildKsArgs.kustomizationFile)
}
}
var builder *build.Builder
if buildKsArgs.dryRun {
builder, err = build.NewBuilder(name, buildKsArgs.path,
build.WithTimeout(rootArgs.timeout),
build.WithKustomizationFile(buildKsArgs.kustomizationFile),
build.WithDryRun(buildKsArgs.dryRun),
build.WithNamespace(*kubeconfigArgs.Namespace),
build.WithIgnore(buildKsArgs.ignorePaths),
)
} else {
builder, err = build.NewBuilder(name, buildKsArgs.path,
build.WithClientConfig(kubeconfigArgs, kubeclientOptions),
build.WithTimeout(rootArgs.timeout),
build.WithKustomizationFile(buildKsArgs.kustomizationFile),
build.WithIgnore(buildKsArgs.ignorePaths),
)
}
if err != nil {
return err
}
// create a signal channel
sigc := make(chan os.Signal, 1)
signal.Notify(sigc, os.Interrupt)
errChan := make(chan error)
go func() {
objects, err := builder.Build()
if err != nil {
errChan <- err
}
manifests, err := ssa.ObjectsToYAML(objects)
if err != nil {
errChan <- err
}
cmd.Print(manifests)
errChan <- nil
}()
select {
case <-sigc:
fmt.Println("Build cancelled... exiting.")
return builder.Cancel()
case err := <-errChan:
if err != nil {
return err
}
}
return nil
}

View File

@@ -0,0 +1,202 @@
//go:build unit
// +build unit
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"bytes"
"os"
"testing"
"text/template"
)
func setup(t *testing.T, tmpl map[string]string) {
t.Helper()
testEnv.CreateObjectFile("./testdata/build-kustomization/podinfo-source.yaml", tmpl, t)
testEnv.CreateObjectFile("./testdata/build-kustomization/podinfo-kustomization.yaml", tmpl, t)
}
func TestBuildKustomization(t *testing.T) {
tests := []struct {
name string
args string
resultFile string
assertFunc string
}{
{
name: "no args",
args: "build kustomization podinfo",
resultFile: "invalid resource path \"\"",
assertFunc: "assertError",
},
{
name: "build podinfo",
args: "build kustomization podinfo --path ./testdata/build-kustomization/podinfo",
resultFile: "./testdata/build-kustomization/podinfo-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build podinfo without service",
args: "build kustomization podinfo --path ./testdata/build-kustomization/delete-service",
resultFile: "./testdata/build-kustomization/podinfo-without-service-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build deployment and configmap with var substitution",
args: "build kustomization podinfo --path ./testdata/build-kustomization/var-substitution",
resultFile: "./testdata/build-kustomization/podinfo-with-var-substitution-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build ignore",
args: "build kustomization podinfo --path ./testdata/build-kustomization/ignore --ignore-paths \"!configmap.yaml,!secret.yaml\"",
resultFile: "./testdata/build-kustomization/podinfo-with-ignore-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
}
tmpl := map[string]string{
"fluxns": allocateNamespace("flux-system"),
}
setup(t, tmpl)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var assert assertFunc
switch tt.assertFunc {
case "assertGoldenTemplateFile":
assert = assertGoldenTemplateFile(tt.resultFile, tmpl)
case "assertError":
assert = assertError(tt.resultFile)
}
cmd := cmdTestCase{
args: tt.args + " -n " + tmpl["fluxns"],
assert: assert,
}
cmd.runTestCmd(t)
})
}
}
func TestBuildLocalKustomization(t *testing.T) {
podinfo := `apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
namespace: {{ .fluxns }}
spec:
interval: 5m0s
path: ./kustomize
force: true
prune: true
sourceRef:
kind: GitRepository
name: podinfo
targetNamespace: default
postBuild:
substitute:
cluster_env: "prod"
cluster_region: "eu-central-1"
`
tests := []struct {
name string
args string
resultFile string
assertFunc string
}{
{
name: "no args",
args: "build kustomization podinfo --kustomization-file ./wrongfile/ --path ./testdata/build-kustomization/podinfo",
resultFile: "invalid kustomization file \"./wrongfile/\"",
assertFunc: "assertError",
},
{
name: "build podinfo",
args: "build kustomization podinfo --kustomization-file ./testdata/build-kustomization/podinfo.yaml --path ./testdata/build-kustomization/podinfo",
resultFile: "./testdata/build-kustomization/podinfo-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build podinfo without service",
args: "build kustomization podinfo --kustomization-file ./testdata/build-kustomization/podinfo.yaml --path ./testdata/build-kustomization/delete-service",
resultFile: "./testdata/build-kustomization/podinfo-without-service-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build deployment and configmap with var substitution",
args: "build kustomization podinfo --kustomization-file ./testdata/build-kustomization/podinfo.yaml --path ./testdata/build-kustomization/var-substitution",
resultFile: "./testdata/build-kustomization/podinfo-with-var-substitution-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "build deployment and configmap with var substitution in dry-run mode",
args: "build kustomization podinfo --kustomization-file ./testdata/build-kustomization/podinfo.yaml --path ./testdata/build-kustomization/var-substitution --dry-run",
resultFile: "./testdata/build-kustomization/podinfo-with-var-substitution-result.yaml",
assertFunc: "assertGoldenTemplateFile",
},
}
tmpl := map[string]string{
"fluxns": allocateNamespace("flux-system"),
}
setup(t, tmpl)
testEnv.CreateObjectFile("./testdata/build-kustomization/podinfo-source.yaml", tmpl, t)
temp, err := template.New("podinfo").Parse(podinfo)
if err != nil {
t.Fatal(err)
}
var b bytes.Buffer
err = temp.Execute(&b, tmpl)
if err != nil {
t.Fatal(err)
}
err = os.WriteFile("./testdata/build-kustomization/podinfo.yaml", b.Bytes(), 0666)
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() { _ = os.Remove("./testdata/build-kustomization/podinfo.yaml") })
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var assert assertFunc
switch tt.assertFunc {
case "assertGoldenTemplateFile":
assert = assertGoldenTemplateFile(tt.resultFile, tmpl)
case "assertError":
assert = assertError(tt.resultFile)
}
cmd := cmdTestCase{
args: tt.args + " -n " + tmpl["fluxns"],
assert: assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -18,66 +18,88 @@ package main
import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
"strings"
"time"
"github.com/blang/semver/v4"
"github.com/fluxcd/flux2/internal/utils"
"github.com/Masterminds/semver/v3"
"github.com/spf13/cobra"
apimachineryversion "k8s.io/apimachinery/pkg/version"
v1 "k8s.io/api/apps/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/pkg/version"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/v2/pkg/status"
)
var checkCmd = &cobra.Command{
Use: "check",
Short: "Check requirements and installation",
Long: `The check command will perform a series of checks to validate that
the local environment is configured correctly and if the installed components are healthy.`,
Long: withPreviewNote(`The check command will perform a series of checks to validate that
the local environment is configured correctly and if the installed components are healthy.`),
Example: ` # Run pre-installation checks
flux check --pre
# Run installation checks
flux check
`,
flux check`,
RunE: runCheckCmd,
}
var (
checkPre bool
checkComponents []string
)
type kubectlVersion struct {
ClientVersion *apimachineryversion.Info `json:"clientVersion"`
type checkFlags struct {
pre bool
components []string
extraComponents []string
pollInterval time.Duration
}
var kubernetesConstraints = []string{
">=1.25.0-0",
}
var checkArgs checkFlags
func init() {
checkCmd.Flags().BoolVarP(&checkPre, "pre", "", false,
checkCmd.Flags().BoolVarP(&checkArgs.pre, "pre", "", false,
"only run pre-installation checks")
checkCmd.Flags().StringSliceVar(&checkComponents, "components", defaults.Components,
checkCmd.Flags().StringSliceVar(&checkArgs.components, "components", rootArgs.defaults.Components,
"list of components, accepts comma-separated values")
checkCmd.Flags().StringSliceVar(&checkArgs.extraComponents, "components-extra", nil,
"list of components in addition to those supplied or defaulted, accepts comma-separated values")
checkCmd.Flags().DurationVar(&checkArgs.pollInterval, "poll-interval", 5*time.Second,
"how often the health checker should poll the cluster for the latest state of the resources.")
rootCmd.AddCommand(checkCmd)
}
func runCheckCmd(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
logger.Actionf("checking prerequisites")
checkFailed := false
if !kubectlCheck(ctx, ">=1.18.0") {
fluxCheck()
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
cfg, err := utils.KubeConfig(kubeconfigArgs, kubeclientOptions)
if err != nil {
return fmt.Errorf("Kubernetes client initialization failed: %s", err.Error())
}
kubeClient, err := client.New(cfg, client.Options{Scheme: utils.NewScheme()})
if err != nil {
return err
}
if !kubernetesCheck(cfg, kubernetesConstraints) {
checkFailed = true
}
if !kubernetesCheck(">=1.16.0") {
checkFailed = true
}
if checkPre {
if checkArgs.pre {
if checkFailed {
os.Exit(1)
}
@@ -85,105 +107,156 @@ func runCheckCmd(cmd *cobra.Command, args []string) error {
return nil
}
logger.Actionf("checking controllers")
if !componentsCheck() {
logger.Actionf("checking version in cluster")
if !fluxClusterVersionCheck(ctx, kubeClient) {
checkFailed = true
}
logger.Actionf("checking controllers")
if !componentsCheck(ctx, kubeClient) {
checkFailed = true
}
logger.Actionf("checking crds")
if !crdsCheck(ctx, kubeClient) {
checkFailed = true
}
if checkFailed {
logger.Failuref("check failed")
os.Exit(1)
}
logger.Successf("all checks passed")
return nil
}
func kubectlCheck(ctx context.Context, version string) bool {
_, err := exec.LookPath("kubectl")
func fluxCheck() {
curSv, err := version.ParseVersion(VERSION)
if err != nil {
logger.Failuref("kubectl not found")
return false
return
}
kubectlArgs := []string{"version", "--client", "--output", "json"}
output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...)
// Exclude development builds.
if curSv.Prerelease() != "" {
return
}
latest, err := install.GetLatestVersion()
if err != nil {
logger.Failuref("kubectl version can't be determined")
return false
return
}
kv := &kubectlVersion{}
if err = json.Unmarshal([]byte(output), kv); err != nil {
logger.Failuref("kubectl version output can't be unmarshaled")
return false
}
v, err := semver.ParseTolerant(kv.ClientVersion.GitVersion)
latestSv, err := version.ParseVersion(latest)
if err != nil {
logger.Failuref("kubectl version can't be parsed")
return false
return
}
rng, _ := semver.ParseRange(version)
if !rng(v) {
logger.Failuref("kubectl version must be %s", version)
return false
if latestSv.GreaterThan(curSv) {
logger.Failuref("flux %s <%s (new CLI version is available, please upgrade)", curSv, latestSv)
}
logger.Successf("kubectl %s %s", v.String(), version)
return true
}
func kubernetesCheck(version string) bool {
cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
func kubernetesCheck(cfg *rest.Config, constraints []string) bool {
clientSet, err := kubernetes.NewForConfig(cfg)
if err != nil {
logger.Failuref("Kubernetes client initialization failed: %s", err.Error())
return false
}
client, err := kubernetes.NewForConfig(cfg)
if err != nil {
logger.Failuref("Kubernetes client initialization failed: %s", err.Error())
return false
}
ver, err := client.Discovery().ServerVersion()
kv, err := clientSet.Discovery().ServerVersion()
if err != nil {
logger.Failuref("Kubernetes API call failed: %s", err.Error())
return false
}
v, err := semver.ParseTolerant(ver.String())
v, err := version.ParseVersion(kv.String())
if err != nil {
logger.Failuref("Kubernetes version can't be determined")
return false
}
rng, _ := semver.ParseRange(version)
if !rng(v) {
logger.Failuref("Kubernetes version must be %s", version)
var valid bool
var vrange string
for _, constraint := range constraints {
c, _ := semver.NewConstraint(constraint)
if c.Check(v) {
valid = true
vrange = constraint
break
}
}
if !valid {
logger.Failuref("Kubernetes version %s does not match %s", v.Original(), constraints[0])
return false
}
logger.Successf("Kubernetes %s %s", v.String(), version)
logger.Successf("Kubernetes %s %s", v.String(), vrange)
return true
}
func componentsCheck() bool {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
func componentsCheck(ctx context.Context, kubeClient client.Client) bool {
statusChecker, err := status.NewStatusCheckerWithClient(kubeClient, checkArgs.pollInterval, rootArgs.timeout, logger)
if err != nil {
return false
}
ok := true
for _, deployment := range checkComponents {
kubectlArgs := []string{"-n", namespace, "rollout", "status", "deployment", deployment, "--timeout", timeout.String()}
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...); err != nil {
logger.Failuref("%s: %s", deployment, strings.TrimSuffix(output, "\n"))
ok = false
} else {
logger.Successf("%s is healthy", deployment)
selector := client.MatchingLabels{manifestgen.PartOfLabelKey: manifestgen.PartOfLabelValue}
var list v1.DeploymentList
ns := *kubeconfigArgs.Namespace
if err := kubeClient.List(ctx, &list, client.InNamespace(ns), selector); err == nil {
if len(list.Items) == 0 {
logger.Failuref("no controllers found in the '%s' namespace with the label selector '%s=%s'",
ns, manifestgen.PartOfLabelKey, manifestgen.PartOfLabelValue)
return false
}
kubectlArgs = []string{"-n", namespace, "get", "deployment", deployment, "-o", "jsonpath=\"{..image}\""}
if output, err := utils.ExecKubectlCommand(ctx, utils.ModeCapture, kubeconfig, kubecontext, kubectlArgs...); err == nil {
logger.Actionf(strings.TrimPrefix(strings.TrimSuffix(output, "\""), "\""))
for _, d := range list.Items {
if ref, err := buildComponentObjectRefs(d.Name); err == nil {
if err := statusChecker.Assess(ref...); err != nil {
ok = false
}
}
for _, c := range d.Spec.Template.Spec.Containers {
logger.Actionf(c.Image)
}
}
}
return ok
}
func crdsCheck(ctx context.Context, kubeClient client.Client) bool {
ok := true
selector := client.MatchingLabels{manifestgen.PartOfLabelKey: manifestgen.PartOfLabelValue}
var list apiextensionsv1.CustomResourceDefinitionList
if err := kubeClient.List(ctx, &list, client.InNamespace(*kubeconfigArgs.Namespace), selector); err == nil {
if len(list.Items) == 0 {
logger.Failuref("no crds found with the label selector '%s=%s'",
manifestgen.PartOfLabelKey, manifestgen.PartOfLabelValue)
return false
}
for _, crd := range list.Items {
versions := crd.Status.StoredVersions
if len(versions) > 0 {
logger.Successf(crd.Name + "/" + versions[len(versions)-1])
} else {
ok = false
logger.Failuref("no stored versions for %s", crd.Name)
}
}
}
return ok
}
func fluxClusterVersionCheck(ctx context.Context, kubeClient client.Client) bool {
clusterInfo, err := getFluxClusterInfo(ctx, kubeClient)
if err != nil {
logger.Failuref("checking failed: %s", err.Error())
return false
}
if clusterInfo.distribution() != "" {
logger.Successf("distribution: %s", clusterInfo.distribution())
}
logger.Successf("bootstrapped: %t", clusterInfo.bootstrapped)
return true
}

53
cmd/flux/check_test.go Normal file
View File

@@ -0,0 +1,53 @@
//go:build e2e
// +build e2e
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"encoding/json"
"strings"
"testing"
"github.com/fluxcd/flux2/v2/internal/utils"
)
func TestCheckPre(t *testing.T) {
jsonOutput, err := utils.ExecKubectlCommand(context.TODO(), utils.ModeCapture, *kubeconfigArgs.KubeConfig, *kubeconfigArgs.Context, "version", "--output", "json")
if err != nil {
t.Fatalf("Error running utils.ExecKubectlCommand: %v", err.Error())
}
var versions map[string]interface{}
if err := json.Unmarshal([]byte(jsonOutput), &versions); err != nil {
t.Fatalf("Error unmarshalling '%s': %v", jsonOutput, err.Error())
}
serverGitVersion := strings.TrimPrefix(
versions["serverVersion"].(map[string]interface{})["gitVersion"].(string),
"v")
cmd := cmdTestCase{
args: "check --pre",
assert: assertGoldenTemplateFile("testdata/check/check_pre.golden", map[string]string{
"serverVersion": serverGitVersion,
}),
}
cmd.runTestCmd(t)
}

126
cmd/flux/cluster_info.go Normal file
View File

@@ -0,0 +1,126 @@
/*
Copyright 2023 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"github.com/manifoldco/promptui"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/v2/pkg/manifestgen"
)
// bootstrapLabels are labels put on a resource by kustomize-controller. These labels on the CRD indicates
// that flux has been bootstrapped.
var bootstrapLabels = []string{
fmt.Sprintf("%s/name", kustomizev1.GroupVersion.Group),
fmt.Sprintf("%s/namespace", kustomizev1.GroupVersion.Group),
}
// fluxClusterInfo contains information about an existing flux installation on a cluster.
type fluxClusterInfo struct {
// bootstrapped indicates that Flux was installed using the `flux bootstrap` command.
bootstrapped bool
// managedBy is the name of the tool being used to manage the installation of Flux.
managedBy string
// partOf indicates which distribution the instance is a part of.
partOf string
// version is the Flux version number in semver format.
version string
}
// getFluxClusterInfo returns information on the Flux installation running on the cluster.
// If an error occurred, the returned error will be non-nil.
//
// This function retrieves the GitRepository CRD from the cluster and checks it
// for a set of labels used to determine the Flux version and how Flux was installed.
// It returns the NotFound error from the underlying library if it was unable to find
// the GitRepository CRD and this can be used to check if Flux is installed.
func getFluxClusterInfo(ctx context.Context, c client.Client) (fluxClusterInfo, error) {
var info fluxClusterInfo
crdMetadata := &metav1.PartialObjectMetadata{
TypeMeta: metav1.TypeMeta{
APIVersion: apiextensionsv1.SchemeGroupVersion.String(),
Kind: "CustomResourceDefinition",
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("gitrepositories.%s", sourcev1.GroupVersion.Group),
},
}
if err := c.Get(ctx, client.ObjectKeyFromObject(crdMetadata), crdMetadata); err != nil {
return info, err
}
info.version = crdMetadata.Labels[manifestgen.VersionLabelKey]
var present bool
for _, l := range bootstrapLabels {
_, present = crdMetadata.Labels[l]
}
if present {
info.bootstrapped = true
}
// the `app.kubernetes.io/managed-by` label is not set by flux but might be set by other
// tools used to install Flux e.g Helm.
if manager, ok := crdMetadata.Labels["app.kubernetes.io/managed-by"]; ok {
info.managedBy = manager
}
if partOf, ok := crdMetadata.Labels[manifestgen.PartOfLabelKey]; ok {
info.partOf = partOf
}
return info, nil
}
// confirmFluxInstallOverride displays a prompt to the user so that they can confirm before overriding
// a Flux installation. It returns nil if the installation should continue,
// promptui.ErrAbort if the user doesn't confirm, or an error encountered.
func confirmFluxInstallOverride(info fluxClusterInfo) error {
// no need to display prompt if installation is managed by Flux
if installManagedByFlux(info.managedBy) {
return nil
}
display := fmt.Sprintf("Flux %s has been installed on this cluster with %s!", info.version, info.managedBy)
fmt.Fprintln(rootCmd.ErrOrStderr(), display)
prompt := promptui.Prompt{
Label: fmt.Sprintf("Are you sure you want to override the %s installation? Y/N", info.managedBy),
IsConfirm: true,
}
_, err := prompt.Run()
return err
}
func (info fluxClusterInfo) distribution() string {
distribution := info.version
if info.partOf != "" {
distribution = fmt.Sprintf("%s-%s", info.partOf, info.version)
}
return distribution
}
func installManagedByFlux(manager string) bool {
return manager == "" || manager == "flux"
}

View File

@@ -0,0 +1,141 @@
/*
Copyright 2023 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"os"
"testing"
. "github.com/onsi/gomega"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/ssa"
)
func Test_getFluxClusterInfo(t *testing.T) {
g := NewWithT(t)
f, err := os.Open("./testdata/cluster_info/gitrepositories.yaml")
g.Expect(err).To(BeNil())
objs, err := ssa.ReadObjects(f)
g.Expect(err).To(Not(HaveOccurred()))
gitrepo := objs[0]
tests := []struct {
name string
labels map[string]string
wantErr bool
wantInfo fluxClusterInfo
}{
{
name: "no git repository CRD present",
wantErr: true,
},
{
name: "CRD with kustomize-controller labels",
labels: map[string]string{
fmt.Sprintf("%s/name", kustomizev1.GroupVersion.Group): "flux-system",
fmt.Sprintf("%s/namespace", kustomizev1.GroupVersion.Group): "flux-system",
"app.kubernetes.io/version": "v2.1.0",
},
wantInfo: fluxClusterInfo{
version: "v2.1.0",
bootstrapped: true,
},
},
{
name: "CRD with kustomize-controller labels and managed-by label",
labels: map[string]string{
fmt.Sprintf("%s/name", kustomizev1.GroupVersion.Group): "flux-system",
fmt.Sprintf("%s/namespace", kustomizev1.GroupVersion.Group): "flux-system",
"app.kubernetes.io/version": "v2.1.0",
"app.kubernetes.io/managed-by": "flux",
},
wantInfo: fluxClusterInfo{
version: "v2.1.0",
bootstrapped: true,
managedBy: "flux",
},
},
{
name: "CRD with only managed-by label",
labels: map[string]string{
"app.kubernetes.io/version": "v2.1.0",
"app.kubernetes.io/managed-by": "helm",
},
wantInfo: fluxClusterInfo{
version: "v2.1.0",
managedBy: "helm",
},
},
{
name: "CRD with no labels",
labels: map[string]string{},
wantInfo: fluxClusterInfo{},
},
{
name: "CRD with only version label",
labels: map[string]string{
"app.kubernetes.io/version": "v2.1.0",
},
wantInfo: fluxClusterInfo{
version: "v2.1.0",
},
},
{
name: "CRD with version and part-of labels",
labels: map[string]string{
"app.kubernetes.io/version": "v2.1.0",
"app.kubernetes.io/part-of": "flux",
},
wantInfo: fluxClusterInfo{
version: "v2.1.0",
partOf: "flux",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
newscheme := runtime.NewScheme()
apiextensionsv1.AddToScheme(newscheme)
builder := fake.NewClientBuilder().WithScheme(newscheme)
if tt.labels != nil {
gitrepo.SetLabels(tt.labels)
builder = builder.WithRuntimeObjects(gitrepo)
}
client := builder.Build()
info, err := getFluxClusterInfo(context.Background(), client)
if tt.wantErr {
g.Expect(err).To(HaveOccurred())
g.Expect(errors.IsNotFound(err)).To(BeTrue())
} else {
g.Expect(err).To(Not(HaveOccurred()))
}
g.Expect(info).To(BeEquivalentTo(tt.wantInfo))
})
}
}

View File

@@ -17,15 +17,96 @@ limitations under the License.
package main
import (
"context"
"strings"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
)
var completionCmd = &cobra.Command{
Use: "completion",
Short: "Generates completion scripts for various shells",
Long: "The completion sub-command generates completion scripts for various shells",
Long: `The completion sub-command generates completion scripts for various shells.`,
}
func init() {
rootCmd.AddCommand(completionCmd)
}
func contextsCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
rawConfig, err := kubeconfigArgs.ToRawKubeConfigLoader().RawConfig()
if err != nil {
return completionError(err)
}
var comps []string
for name := range rawConfig.Contexts {
if strings.HasPrefix(name, toComplete) {
comps = append(comps, name)
}
}
return comps, cobra.ShellCompDirectiveNoFileComp
}
func resourceNamesCompletionFunc(gvk schema.GroupVersionKind) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
cfg, err := utils.KubeConfig(kubeconfigArgs, kubeclientOptions)
if err != nil {
return completionError(err)
}
mapper, err := kubeconfigArgs.ToRESTMapper()
if err != nil {
return completionError(err)
}
mapping, err := mapper.RESTMapping(gvk.GroupKind(), gvk.Version)
if err != nil {
return completionError(err)
}
client, err := dynamic.NewForConfig(cfg)
if err != nil {
return completionError(err)
}
var dr dynamic.ResourceInterface
if mapping.Scope.Name() == meta.RESTScopeNameNamespace {
dr = client.Resource(mapping.Resource).Namespace(*kubeconfigArgs.Namespace)
} else {
dr = client.Resource(mapping.Resource)
}
list, err := dr.List(ctx, metav1.ListOptions{})
if err != nil {
return completionError(err)
}
var comps []string
for _, item := range list.Items {
name := item.GetName()
if strings.HasPrefix(name, toComplete) {
comps = append(comps, name)
}
}
return comps, cobra.ShellCompDirectiveNoFileComp
}
}
func completionError(err error) ([]string, cobra.ShellCompDirective) {
cobra.CompError(err.Error())
return nil, cobra.ShellCompDirectiveError
}

View File

@@ -25,6 +25,7 @@ import (
var completionBashCmd = &cobra.Command{
Use: "bash",
Short: "Generates bash completion scripts",
Long: `The completion sub-command generates completion scripts for bash.`,
Example: `To load completion run
. <(flux completion bash)
@@ -32,8 +33,7 @@ var completionBashCmd = &cobra.Command{
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
command -v flux >/dev/null && . <(flux completion bash)
`,
command -v flux >/dev/null && . <(flux completion bash)`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenBashCompletion(os.Stdout)
},

View File

@@ -25,16 +25,12 @@ import (
var completionFishCmd = &cobra.Command{
Use: "fish",
Short: "Generates fish completion scripts",
Example: `To load completion run
Long: `The completion sub-command generates completion scripts for fish.`,
Example: `To configure your fish shell to load completions for each session write this script to your completions dir:
. <(flux completion fish)
flux completion fish > ~/.config/fish/completions/flux.fish
To configure your fish shell to load completions for each session write this script to your completions dir:
flux completion fish > ~/.config/fish/completions/flux
See http://fishshell.com/docs/current/index.html#completion-own for more details
`,
See http://fishshell.com/docs/current/index.html#completion-own for more details`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenFishCompletion(os.Stdout, true)
},

View File

@@ -25,6 +25,7 @@ import (
var completionPowerShellCmd = &cobra.Command{
Use: "powershell",
Short: "Generates powershell completion scripts",
Long: `The completion sub-command generates completion scripts for powershell.`,
Example: `To load completion run
. <(flux completion powershell)
@@ -34,13 +35,12 @@ To configure your powershell shell to load completions for each session add to y
Windows:
cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
flux completion >> flux-completion.ps1
flux completion powershell >> flux-completion.ps1
Linux:
cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules"
flux completion >> flux-completions.ps1
`,
flux completion powershell >> flux-completions.ps1`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenPowerShellCompletion(os.Stdout)
},

View File

@@ -17,6 +17,7 @@ limitations under the License.
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
@@ -25,25 +26,27 @@ import (
var completionZshCmd = &cobra.Command{
Use: "zsh",
Short: "Generates zsh completion scripts",
Long: `The completion sub-command generates completion scripts for zsh.`,
Example: `To load completion run
. <(flux completion zsh) && compdef _flux flux
. <(flux completion zsh)
To configure your zsh shell to load completions for each session add to your zshrc
# ~/.zshrc or ~/.profile
command -v flux >/dev/null && . <(flux completion zsh) && compdef _flux flux
command -v flux >/dev/null && . <(flux completion zsh)
or write a cached file in one of the completion directories in your ${fpath}:
echo "${fpath// /\n}" | grep -i completion
flux completions zsh > _flux
flux completion zsh > _flux
mv _flux ~/.oh-my-zsh/completions # oh-my-zsh
mv _flux ~/.zprezto/modules/completion/external/src/ # zprezto
`,
mv _flux ~/.zprezto/modules/completion/external/src/ # zprezto`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenZshCompletion(os.Stdout)
// Cobra doesn't source zsh completion file, explicitly doing it here
fmt.Println("compdef _flux flux")
},
}

View File

@@ -17,38 +17,131 @@ limitations under the License.
package main
import (
"context"
"fmt"
"regexp"
"strings"
"time"
"k8s.io/apimachinery/pkg/util/validation"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createCmd = &cobra.Command{
Use: "create",
Short: "Create or update sources and resources",
Long: "The create sub-commands generate sources and resources.",
Long: `The create sub-commands generate sources and resources.`,
}
var (
type createFlags struct {
interval time.Duration
export bool
labels []string
)
}
var createArgs createFlags
func init() {
createCmd.PersistentFlags().DurationVarP(&interval, "interval", "", time.Minute, "source sync interval")
createCmd.PersistentFlags().BoolVar(&export, "export", false, "export in YAML format to stdout")
createCmd.PersistentFlags().StringSliceVar(&labels, "label", nil,
createCmd.PersistentFlags().DurationVarP(&createArgs.interval, "interval", "", time.Minute, "source sync interval")
createCmd.PersistentFlags().BoolVar(&createArgs.export, "export", false, "export in YAML format to stdout")
createCmd.PersistentFlags().StringSliceVar(&createArgs.labels, "label", nil,
"set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)")
createCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("name is required")
}
name := args[0]
if !validateObjectName(name) {
return fmt.Errorf("name '%s' is invalid, it should adhere to standard defined in RFC 1123, the name can only contain alphanumeric characters or '-'", name)
}
return nil
}
rootCmd.AddCommand(createCmd)
}
// upsertable is an interface for values that can be used in `upsert`.
type upsertable interface {
adapter
named
}
// upsert updates or inserts an object. Instead of providing the
// object itself, you provide a named (as in Name and Namespace)
// template value, and a mutate function which sets the values you
// want to update. The mutate function is nullary -- you mutate a
// value in the closure, e.g., by doing this:
//
// var existing Value
// existing.Name = name
// existing.Namespace = ns
// upsert(ctx, client, valueAdapter{&value}, func() error {
// value.Spec = onePreparedEarlier
// })
func (names apiType) upsert(ctx context.Context, kubeClient client.Client, object upsertable, mutate func() error) (types.NamespacedName, error) {
nsname := types.NamespacedName{
Namespace: object.GetNamespace(),
Name: object.GetName(),
}
op, err := controllerutil.CreateOrUpdate(ctx, kubeClient, object.asClientObject(), mutate)
if err != nil {
return nsname, err
}
switch op {
case controllerutil.OperationResultCreated:
logger.Successf("%s created", names.kind)
case controllerutil.OperationResultUpdated:
logger.Successf("%s updated", names.kind)
}
return nsname, nil
}
type upsertWaitable interface {
upsertable
statusable
}
// upsertAndWait encodes the pattern of creating or updating a
// resource, then waiting for it to reconcile. See the note on
// `upsert` for how to work with the `mutate` argument.
func (names apiType) upsertAndWait(object upsertWaitable, mutate func() error) error {
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions) // NB globals
if err != nil {
return err
}
logger.Generatef("generating %s", names.kind)
logger.Actionf("applying %s", names.kind)
namespacedName, err := imageRepositoryType.upsert(ctx, kubeClient, object, mutate)
if err != nil {
return err
}
logger.Waitingf("waiting for %s reconciliation", names.kind)
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, object.asClientObject())); err != nil {
return err
}
logger.Successf("%s reconciliation completed", names.kind)
return nil
}
func parseLabels() (map[string]string, error) {
result := make(map[string]string)
for _, label := range labels {
for _, label := range createArgs.labels {
// validate key value pair
parts := strings.Split(label, "=")
if len(parts) != 2 {
@@ -70,3 +163,8 @@ func parseLabels() (map[string]string, error) {
return result, nil
}
func validateObjectName(name string) bool {
r := regexp.MustCompile(`^[a-z0-9]([a-z0-9\-]){0,61}[a-z0-9]$`)
return r.MatchString(name)
}

View File

@@ -20,68 +20,66 @@ import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/pkg/apis/meta"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b3 "github.com/fluxcd/notification-controller/api/v1beta3"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createAlertCmd = &cobra.Command{
Use: "alert [name]",
Short: "Create or update a Alert resource",
Long: "The create alert command generates a Alert resource.",
Long: withPreviewNote(`The create alert command generates a Alert resource.`),
Example: ` # Create an Alert for kustomization events
flux create alert \
--event-severity info \
--event-source Kustomization/flux-system \
--provider-ref slack \
flux-system
`,
flux-system`,
RunE: createAlertCmdRun,
}
var (
aProviderRef string
aEventSeverity string
aEventSources []string
)
type alertFlags struct {
providerRef string
eventSeverity string
eventSources []string
}
var alertArgs alertFlags
func init() {
createAlertCmd.Flags().StringVar(&aProviderRef, "provider-ref", "", "reference to provider")
createAlertCmd.Flags().StringVar(&aEventSeverity, "event-severity", "", "severity of events to send alerts for")
createAlertCmd.Flags().StringArrayVar(&aEventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>)")
createAlertCmd.Flags().StringVar(&alertArgs.providerRef, "provider-ref", "", "reference to provider")
createAlertCmd.Flags().StringVar(&alertArgs.eventSeverity, "event-severity", "", "severity of events to send alerts for")
createAlertCmd.Flags().StringSliceVar(&alertArgs.eventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>), also accepts comma-separated values")
createCmd.AddCommand(createAlertCmd)
}
func createAlertCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Alert name is required")
}
name := args[0]
if aProviderRef == "" {
if alertArgs.providerRef == "" {
return fmt.Errorf("provider ref is required")
}
eventSources := []notificationv1.CrossNamespaceObjectReference{}
for _, eventSource := range aEventSources {
kind, name := utils.ParseObjectKindName(eventSource)
for _, eventSource := range alertArgs.eventSources {
kind, name, namespace := utils.ParseObjectKindNameNamespace(eventSource)
if kind == "" {
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", eventSource)
}
eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{
Kind: kind,
Name: name,
Kind: kind,
Name: name,
Namespace: namespace,
})
}
@@ -94,34 +92,34 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
return err
}
if !export {
if !createArgs.export {
logger.Generatef("generating Alert")
}
alert := notificationv1.Alert{
alert := notificationv1b3.Alert{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: notificationv1.AlertSpec{
ProviderRef: corev1.LocalObjectReference{
Name: aProviderRef,
Spec: notificationv1b3.AlertSpec{
ProviderRef: meta.LocalObjectReference{
Name: alertArgs.providerRef,
},
EventSeverity: aEventSeverity,
EventSeverity: alertArgs.eventSeverity,
EventSources: eventSources,
Suspend: false,
},
}
if export {
return exportAlert(alert)
if createArgs.export {
return printExport(exportAlert(&alert))
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
@@ -133,8 +131,8 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for Alert reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isAlertReady(ctx, kubeClient, namespacedName, &alert)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isStaticObjectReadyConditionFunc(kubeClient, namespacedName, &alert)); err != nil {
return err
}
logger.Successf("Alert %s is ready", name)
@@ -142,13 +140,13 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
}
func upsertAlert(ctx context.Context, kubeClient client.Client,
alert *notificationv1.Alert) (types.NamespacedName, error) {
alert *notificationv1b3.Alert) (types.NamespacedName, error) {
namespacedName := types.NamespacedName{
Namespace: alert.GetNamespace(),
Name: alert.GetName(),
}
var existing notificationv1.Alert
var existing notificationv1b3.Alert
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
@@ -171,23 +169,3 @@ func upsertAlert(ctx context.Context, kubeClient client.Client,
logger.Successf("Alert updated")
return namespacedName, nil
}
func isAlertReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, alert *notificationv1.Alert) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, alert)
if err != nil {
return false, err
}
if c := apimeta.FindStatusCondition(alert.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

View File

@@ -21,23 +21,22 @@ import (
"fmt"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta3"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createAlertProviderCmd = &cobra.Command{
Use: "alert-provider [name]",
Short: "Create or update a Provider resource",
Long: "The create alert-provider command generates a Provider resource.",
Long: withPreviewNote(`The create alert-provider command generates a Provider resource.`),
Example: ` # Create a Provider for a Slack channel
flux create alert-provider slack \
--type slack \
@@ -49,35 +48,33 @@ var createAlertProviderCmd = &cobra.Command{
flux create alert-provider github-podinfo \
--type github \
--address https://github.com/stefanprodan/podinfo \
--secret-ref github-token
`,
--secret-ref github-token`,
RunE: createAlertProviderCmdRun,
}
var (
apType string
apChannel string
apUsername string
apAddress string
apSecretRef string
)
type alertProviderFlags struct {
alertType string
channel string
username string
address string
secretRef string
}
var alertProviderArgs alertProviderFlags
func init() {
createAlertProviderCmd.Flags().StringVar(&apType, "type", "", "type of provider")
createAlertProviderCmd.Flags().StringVar(&apChannel, "channel", "", "channel to send messages to in the case of a chat provider")
createAlertProviderCmd.Flags().StringVar(&apUsername, "username", "", "bot username used by the provider")
createAlertProviderCmd.Flags().StringVar(&apAddress, "address", "", "path to either the git repository, chat provider or webhook")
createAlertProviderCmd.Flags().StringVar(&apSecretRef, "secret-ref", "", "name of secret containing authentication token")
createAlertProviderCmd.Flags().StringVar(&alertProviderArgs.alertType, "type", "", "type of provider")
createAlertProviderCmd.Flags().StringVar(&alertProviderArgs.channel, "channel", "", "channel to send messages to in the case of a chat provider")
createAlertProviderCmd.Flags().StringVar(&alertProviderArgs.username, "username", "", "bot username used by the provider")
createAlertProviderCmd.Flags().StringVar(&alertProviderArgs.address, "address", "", "path to either the git repository, chat provider or webhook")
createAlertProviderCmd.Flags().StringVar(&alertProviderArgs.secretRef, "secret-ref", "", "name of secret containing authentication token")
createCmd.AddCommand(createAlertProviderCmd)
}
func createAlertProviderCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Provider name is required")
}
name := args[0]
if apType == "" {
if alertProviderArgs.alertType == "" {
return fmt.Errorf("Provider type is required")
}
@@ -86,38 +83,38 @@ func createAlertProviderCmdRun(cmd *cobra.Command, args []string) error {
return err
}
if !export {
if !createArgs.export {
logger.Generatef("generating Provider")
}
provider := notificationv1.Provider{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: notificationv1.ProviderSpec{
Type: apType,
Channel: apChannel,
Username: apUsername,
Address: apAddress,
Type: alertProviderArgs.alertType,
Channel: alertProviderArgs.channel,
Username: alertProviderArgs.username,
Address: alertProviderArgs.address,
},
}
if apSecretRef != "" {
provider.Spec.SecretRef = &corev1.LocalObjectReference{
Name: apSecretRef,
if alertProviderArgs.secretRef != "" {
provider.Spec.SecretRef = &meta.LocalObjectReference{
Name: alertProviderArgs.secretRef,
}
}
if export {
return exportAlertProvider(provider)
if createArgs.export {
return printExport(exportAlertProvider(&provider))
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
@@ -129,8 +126,8 @@ func createAlertProviderCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for Provider reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isAlertProviderReady(ctx, kubeClient, namespacedName, &provider)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isStaticObjectReadyConditionFunc(kubeClient, namespacedName, &provider)); err != nil {
return err
}
@@ -169,23 +166,3 @@ func upsertAlertProvider(ctx context.Context, kubeClient client.Client,
logger.Successf("Provider updated")
return namespacedName, nil
}
func isAlertProviderReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, provider *notificationv1.Provider) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, provider)
if err != nil {
return false, err
}
if c := apimeta.FindStatusCondition(provider.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

View File

@@ -18,17 +18,20 @@ package main
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/runtime/transform"
"github.com/spf13/cobra"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
@@ -42,7 +45,7 @@ var createHelmReleaseCmd = &cobra.Command{
Use: "helmrelease [name]",
Aliases: []string{"hr"},
Short: "Create or update a HelmRelease resource",
Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.",
Long: withPreviewNote(`The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.`),
Example: ` # Create a HelmRelease with a chart from a HelmRepository source
flux create hr podinfo \
--interval=10m \
@@ -62,11 +65,12 @@ var createHelmReleaseCmd = &cobra.Command{
--source=Bucket/podinfo \
--chart=./charts/podinfo
# Create a HelmRelease with values from a local YAML file
# Create a HelmRelease with values from local YAML files
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./my-values.yaml
--values=./my-values1.yaml \
--values=./my-values2.yaml
# Create a HelmRelease with values from a Kubernetes secret
kubectl -n app create secret generic my-secret-values \
@@ -78,56 +82,75 @@ var createHelmReleaseCmd = &cobra.Command{
# Create a HelmRelease with a custom release name
flux create hr podinfo \
--release-name=podinfo-dev
--release-name=podinfo-dev \
--source=HelmRepository/podinfo \
--chart=podinfo \
--chart=podinfo
# Create a HelmRelease targeting another namespace than the resource
flux create hr podinfo \
--target-namespace=default \
--target-namespace=test \
--create-target-namespace=true \
--source=HelmRepository/podinfo \
--chart=podinfo
# Create a HelmRelease using a source from a different namespace
flux create hr podinfo \
--namespace=default \
--source=HelmRepository/podinfo.flux-system \
--chart=podinfo
# Create a HelmRelease definition on disk without applying it on the cluster
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./values.yaml \
--export > podinfo-release.yaml
`,
--export > podinfo-release.yaml`,
RunE: createHelmReleaseCmdRun,
}
var (
hrName string
hrSource flags.HelmChartSource
hrDependsOn []string
hrChart string
hrChartVersion string
hrTargetNamespace string
hrValuesFile string
hrValuesFrom flags.HelmReleaseValuesFrom
)
type helmReleaseFlags struct {
name string
source flags.HelmChartSource
dependsOn []string
chart string
chartVersion string
targetNamespace string
createNamespace bool
valuesFiles []string
valuesFrom []string
saName string
crds flags.CRDsPolicy
reconcileStrategy string
chartInterval time.Duration
kubeConfigSecretRef string
}
var helmReleaseArgs helmReleaseFlags
var supportedHelmReleaseValuesFromKinds = []string{"Secret", "ConfigMap"}
func init() {
createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
createHelmReleaseCmd.Flags().Var(&hrSource, "source", hrSource.Description())
createHelmReleaseCmd.Flags().StringVar(&hrChart, "chart", "", "Helm chart name or path")
createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
createHelmReleaseCmd.Flags().Var(&hrValuesFrom, "values-from", hrValuesFrom.Description())
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.name, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.targetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
createHelmReleaseCmd.Flags().BoolVar(&helmReleaseArgs.createNamespace, "create-target-namespace", false, "create the target namespace if it does not exist")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.reconcileStrategy, "reconcile-strategy", "ChartVersion", "the reconcile strategy for helm chart created by the helm release(accepted values: Revision and ChartRevision)")
createHelmReleaseCmd.Flags().DurationVarP(&helmReleaseArgs.chartInterval, "chart-interval", "", 0, "the interval of which to check for new chart versions")
createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.valuesFiles, "values", nil, "local path to values.yaml files, also accepts comma-separated values")
createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.valuesFrom, "values-from", nil, "a Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>', where kind must be one of: (Secret,ConfigMap)")
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.crds, "crds", helmReleaseArgs.crds.Description())
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.kubeConfigSecretRef, "kubeconfig-secret-ref", "", "the name of the Kubernetes Secret that contains a key with the kubeconfig file for connecting to a remote cluster")
createCmd.AddCommand(createHelmReleaseCmd)
}
func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("HelmRelease name is required")
}
name := args[0]
if hrChart == "" {
if helmReleaseArgs.chart == "" {
return fmt.Errorf("chart name or path is required")
}
@@ -136,66 +159,138 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
return err
}
if !export {
if !createArgs.export {
logger.Generatef("generating HelmRelease")
}
if !validateStrategy(helmReleaseArgs.reconcileStrategy) {
return fmt.Errorf("'%s' is an invalid reconcile strategy(valid: Revision, ChartVersion)",
helmReleaseArgs.reconcileStrategy)
}
helmRelease := helmv2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: helmv2.HelmReleaseSpec{
ReleaseName: hrName,
DependsOn: utils.MakeDependsOn(hrDependsOn),
ReleaseName: helmReleaseArgs.name,
DependsOn: utils.MakeDependsOn(helmReleaseArgs.dependsOn),
Interval: metav1.Duration{
Duration: interval,
Duration: createArgs.interval,
},
TargetNamespace: hrTargetNamespace,
TargetNamespace: helmReleaseArgs.targetNamespace,
Chart: helmv2.HelmChartTemplate{
Spec: helmv2.HelmChartTemplateSpec{
Chart: hrChart,
Version: hrChartVersion,
Chart: helmReleaseArgs.chart,
Version: helmReleaseArgs.chartVersion,
SourceRef: helmv2.CrossNamespaceObjectReference{
Kind: hrSource.Kind,
Name: hrSource.Name,
Kind: helmReleaseArgs.source.Kind,
Name: helmReleaseArgs.source.Name,
Namespace: helmReleaseArgs.source.Namespace,
},
ReconcileStrategy: helmReleaseArgs.reconcileStrategy,
},
},
Suspend: false,
},
}
if hrValuesFile != "" {
data, err := ioutil.ReadFile(hrValuesFile)
if err != nil {
return fmt.Errorf("reading values from %s failed: %w", hrValuesFile, err)
if helmReleaseArgs.kubeConfigSecretRef != "" {
helmRelease.Spec.KubeConfig = &meta.KubeConfigReference{
SecretRef: meta.SecretKeyReference{
Name: helmReleaseArgs.kubeConfigSecretRef,
},
}
}
if helmReleaseArgs.chartInterval != 0 {
helmRelease.Spec.Chart.Spec.Interval = &metav1.Duration{
Duration: helmReleaseArgs.chartInterval,
}
}
if helmReleaseArgs.createNamespace {
if helmRelease.Spec.Install == nil {
helmRelease.Spec.Install = &helmv2.Install{}
}
json, err := yaml.YAMLToJSON(data)
if err != nil {
return fmt.Errorf("converting values to JSON from %s failed: %w", hrValuesFile, err)
helmRelease.Spec.Install.CreateNamespace = helmReleaseArgs.createNamespace
}
if helmReleaseArgs.saName != "" {
helmRelease.Spec.ServiceAccountName = helmReleaseArgs.saName
}
if helmReleaseArgs.crds != "" {
if helmRelease.Spec.Install == nil {
helmRelease.Spec.Install = &helmv2.Install{}
}
helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: json}
helmRelease.Spec.Install.CRDs = helmv2.Create
helmRelease.Spec.Upgrade = &helmv2.Upgrade{CRDs: helmv2.CRDsPolicy(helmReleaseArgs.crds.String())}
}
if hrValuesFrom.String() != "" {
helmRelease.Spec.ValuesFrom = []helmv2.ValuesReference{{
Kind: hrValuesFrom.Kind,
Name: hrValuesFrom.Name,
}}
if len(helmReleaseArgs.valuesFiles) > 0 {
valuesMap := make(map[string]interface{})
for _, v := range helmReleaseArgs.valuesFiles {
data, err := os.ReadFile(v)
if err != nil {
return fmt.Errorf("reading values from %s failed: %w", v, err)
}
jsonBytes, err := yaml.YAMLToJSON(data)
if err != nil {
return fmt.Errorf("converting values to JSON from %s failed: %w", v, err)
}
jsonMap := make(map[string]interface{})
if err := json.Unmarshal(jsonBytes, &jsonMap); err != nil {
return fmt.Errorf("unmarshaling values from %s failed: %w", v, err)
}
valuesMap = transform.MergeMaps(valuesMap, jsonMap)
}
jsonRaw, err := json.Marshal(valuesMap)
if err != nil {
return fmt.Errorf("marshaling values failed: %w", err)
}
helmRelease.Spec.Values = &apiextensionsv1.JSON{Raw: jsonRaw}
}
if export {
return exportHelmRelease(helmRelease)
if len(helmReleaseArgs.valuesFrom) != 0 {
values := []helmv2.ValuesReference{}
for _, value := range helmReleaseArgs.valuesFrom {
sourceKind, sourceName := utils.ParseObjectKindName(value)
if sourceKind == "" {
return fmt.Errorf("invalid Kubernetes object reference '%s', must be in format <kind>/<name>", value)
}
cleanSourceKind, ok := utils.ContainsEqualFoldItemString(supportedHelmReleaseValuesFromKinds, sourceKind)
if !ok {
return fmt.Errorf("reference kind '%s' is not supported, must be one of: %s",
sourceKind, strings.Join(supportedHelmReleaseValuesFromKinds, ", "))
}
values = append(values, helmv2.ValuesReference{
Name: sourceName,
Kind: cleanSourceKind,
})
}
helmRelease.Spec.ValuesFrom = values
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
if createArgs.export {
return printExport(exportHelmRelease(&helmRelease))
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
@@ -207,8 +302,8 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for HelmRelease reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isHelmReleaseReady(ctx, kubeClient, namespacedName, &helmRelease)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, &helmRelease)); err != nil {
return err
}
logger.Successf("HelmRelease %s is ready", name)
@@ -248,19 +343,14 @@ func upsertHelmRelease(ctx context.Context, kubeClient client.Client,
return namespacedName, nil
}
func isHelmReleaseReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, helmRelease *helmv2.HelmRelease) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, helmRelease)
if err != nil {
return false, err
}
func validateStrategy(input string) bool {
allowedStrategy := []string{"Revision", "ChartVersion"}
// Confirm the state we are observing is for the current generation
if helmRelease.Generation != helmRelease.Status.ObservedGeneration {
return false, nil
for _, strategy := range allowedStrategy {
if strategy == input {
return true
}
return apimeta.IsStatusConditionTrue(helmRelease.Status.Conditions, meta.ReadyCondition), nil
}
return false
}

33
cmd/flux/create_image.go Normal file
View File

@@ -0,0 +1,33 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/cobra"
)
var createImageCmd = &cobra.Command{
Use: "image",
Short: "Create or update resources dealing with image automation",
Long: `The create image sub-commands work with image automation objects;
that is, object controlling updates to git based on e.g., new container images
being available.`,
}
func init() {
createCmd.AddCommand(createImageCmd)
}

View File

@@ -0,0 +1,258 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"regexp/syntax"
"strings"
"unicode"
"unicode/utf8"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/fluxcd/pkg/apis/meta"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
)
var createImagePolicyCmd = &cobra.Command{
Use: "policy [name]",
Short: "Create or update an ImagePolicy object",
Long: withPreviewNote(`The create image policy command generates an ImagePolicy resource.
An ImagePolicy object calculates a "latest image" given an image
repository and a policy, e.g., semver.
The image that sorts highest according to the policy is recorded in
the status of the object.`),
Example: ` # Create an ImagePolicy to select the latest stable release
flux create image policy podinfo \
--image-ref=podinfo \
--select-semver=">=1.0.0"
# Create an ImagePolicy to select the latest main branch build tagged as "${GIT_BRANCH}-${GIT_SHA:0:7}-$(date +%s)"
flux create image policy podinfo \
--image-ref=podinfo \
--select-numeric=asc \
--filter-regex='^main-[a-f0-9]+-(?P<ts>[0-9]+)' \
--filter-extract='$ts'`,
RunE: createImagePolicyRun}
type imagePolicyFlags struct {
imageRef string
semver string
alpha string
numeric string
filterRegex string
filterExtract string
}
var imagePolicyArgs = imagePolicyFlags{}
func init() {
flags := createImagePolicyCmd.Flags()
flags.StringVar(&imagePolicyArgs.imageRef, "image-ref", "", "the name of an image repository object")
flags.StringVar(&imagePolicyArgs.semver, "select-semver", "", "a semver range to apply to tags; e.g., '1.x'")
flags.StringVar(&imagePolicyArgs.alpha, "select-alpha", "", "use alphabetical sorting to select image; either \"asc\" meaning select the last, or \"desc\" meaning select the first")
flags.StringVar(&imagePolicyArgs.numeric, "select-numeric", "", "use numeric sorting to select image; either \"asc\" meaning select the last, or \"desc\" meaning select the first")
flags.StringVar(&imagePolicyArgs.filterRegex, "filter-regex", "", "regular expression pattern used to filter the image tags")
flags.StringVar(&imagePolicyArgs.filterExtract, "filter-extract", "", "replacement pattern (using capture groups from --filter-regex) to use for sorting")
createImageCmd.AddCommand(createImagePolicyCmd)
}
// getObservedGeneration is implemented here, since it's not
// (presently) needed elsewhere.
func (obj imagePolicyAdapter) getObservedGeneration() int64 {
return obj.ImagePolicy.Status.ObservedGeneration
}
func createImagePolicyRun(cmd *cobra.Command, args []string) error {
objectName := args[0]
if imagePolicyArgs.imageRef == "" {
return fmt.Errorf("the name of an ImageRepository in the namespace is required (--image-ref)")
}
labels, err := parseLabels()
if err != nil {
return err
}
var policy = imagev1.ImagePolicy{
ObjectMeta: metav1.ObjectMeta{
Name: objectName,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
},
Spec: imagev1.ImagePolicySpec{
ImageRepositoryRef: meta.NamespacedObjectReference{
Name: imagePolicyArgs.imageRef,
},
},
}
switch {
case imagePolicyArgs.semver != "" && imagePolicyArgs.alpha != "":
case imagePolicyArgs.semver != "" && imagePolicyArgs.numeric != "":
case imagePolicyArgs.alpha != "" && imagePolicyArgs.numeric != "":
return fmt.Errorf("only one of --select-semver, --select-alpha or --select-numeric can be specified")
case imagePolicyArgs.semver != "":
policy.Spec.Policy.SemVer = &imagev1.SemVerPolicy{
Range: imagePolicyArgs.semver,
}
case imagePolicyArgs.alpha != "":
if imagePolicyArgs.alpha != "desc" && imagePolicyArgs.alpha != "asc" {
return fmt.Errorf("--select-alpha must be one of [\"asc\", \"desc\"]")
}
policy.Spec.Policy.Alphabetical = &imagev1.AlphabeticalPolicy{
Order: imagePolicyArgs.alpha,
}
case imagePolicyArgs.numeric != "":
if imagePolicyArgs.numeric != "desc" && imagePolicyArgs.numeric != "asc" {
return fmt.Errorf("--select-numeric must be one of [\"asc\", \"desc\"]")
}
policy.Spec.Policy.Numerical = &imagev1.NumericalPolicy{
Order: imagePolicyArgs.numeric,
}
default:
return fmt.Errorf("a policy must be provided with either --select-semver or --select-alpha")
}
if imagePolicyArgs.filterRegex != "" {
exp, err := syntax.Parse(imagePolicyArgs.filterRegex, syntax.Perl)
if err != nil {
return fmt.Errorf("--filter-regex is an invalid regex pattern")
}
policy.Spec.FilterTags = &imagev1.TagFilter{
Pattern: imagePolicyArgs.filterRegex,
}
if imagePolicyArgs.filterExtract != "" {
if err := validateExtractStr(imagePolicyArgs.filterExtract, exp.CapNames()); err != nil {
return err
}
policy.Spec.FilterTags.Extract = imagePolicyArgs.filterExtract
}
} else if imagePolicyArgs.filterExtract != "" {
return fmt.Errorf("cannot specify --filter-extract without specifying --filter-regex")
}
if createArgs.export {
return printExport(exportImagePolicy(&policy))
}
var existing imagev1.ImagePolicy
copyName(&existing, &policy)
err = imagePolicyType.upsertAndWait(imagePolicyAdapter{&existing}, func() error {
existing.Spec = policy.Spec
existing.SetLabels(policy.Labels)
return nil
})
return err
}
// Performs a dry-run of the extract function in Regexp to validate the template
func validateExtractStr(template string, capNames []string) error {
for len(template) > 0 {
i := strings.Index(template, "$")
if i < 0 {
return nil
}
template = template[i:]
if len(template) > 1 && template[1] == '$' {
template = template[2:]
continue
}
name, num, rest, ok := extract(template)
if !ok {
// Malformed extract string, assume user didn't want this
return fmt.Errorf("--filter-extract is malformed")
}
template = rest
if num >= 0 {
// we won't worry about numbers as we can't validate these
continue
} else {
found := false
for _, capName := range capNames {
if name == capName {
found = true
}
}
if !found {
return fmt.Errorf("capture group $%s used in --filter-extract not found in --filter-regex", name)
}
}
}
return nil
}
// extract method from the regexp package
// returns the name or number of the value prepended by $
func extract(str string) (name string, num int, rest string, ok bool) {
if len(str) < 2 || str[0] != '$' {
return
}
brace := false
if str[1] == '{' {
brace = true
str = str[2:]
} else {
str = str[1:]
}
i := 0
for i < len(str) {
rune, size := utf8.DecodeRuneInString(str[i:])
if !unicode.IsLetter(rune) && !unicode.IsDigit(rune) && rune != '_' {
break
}
i += size
}
if i == 0 {
// empty name is not okay
return
}
name = str[:i]
if brace {
if i >= len(str) || str[i] != '}' {
// missing closing brace
return
}
i++
}
// Parse number.
num = 0
for i := 0; i < len(name); i++ {
if name[i] < '0' || '9' < name[i] || num >= 1e8 {
num = -1
break
}
num = num*10 + int(name[i]) - '0'
}
// Disallow leading zeros.
if name[0] == '0' && len(name) > 1 {
num = -1
}
rest = str[i:]
ok = true
return
}

View File

@@ -0,0 +1,139 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"time"
"github.com/google/go-containerregistry/pkg/name"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/fluxcd/pkg/apis/meta"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
)
var createImageRepositoryCmd = &cobra.Command{
Use: "repository [name]",
Short: "Create or update an ImageRepository object",
Long: withPreviewNote(`The create image repository command generates an ImageRepository resource.
An ImageRepository object specifies an image repository to scan.`),
Example: ` # Create an ImageRepository object to scan the alpine image repository:
flux create image repository alpine-repo --image alpine --interval 20m
# Create an image repository that uses an image pull secret (assumed to
# have been created already):
flux create image repository myapp-repo \
--secret-ref image-pull \
--image ghcr.io/example.com/myapp --interval 5m
# Create a TLS secret for a local image registry using a self-signed
# host certificate, and use it to scan an image. ca.pem is a file
# containing the CA certificate used to sign the host certificate.
flux create secret tls local-registry-cert --ca-file ./ca.pem
flux create image repository app-repo \
--cert-secret-ref local-registry-cert \
--image local-registry:5000/app --interval 5m
# Create a TLS secret with a client certificate and key, and use it
# to scan a private image registry.
flux create secret tls client-cert \
--cert-file client.crt --key-file client.key
flux create image repository app-repo \
--cert-secret-ref client-cert \
--image registry.example.com/private/app --interval 5m`,
RunE: createImageRepositoryRun,
}
type imageRepoFlags struct {
image string
secretRef string
certSecretRef string
timeout time.Duration
}
var imageRepoArgs = imageRepoFlags{}
func init() {
flags := createImageRepositoryCmd.Flags()
flags.StringVar(&imageRepoArgs.image, "image", "", "the image repository to scan; e.g., library/alpine")
flags.StringVar(&imageRepoArgs.secretRef, "secret-ref", "", "the name of a docker-registry secret to use for credentials")
flags.StringVar(&imageRepoArgs.certSecretRef, "cert-ref", "", "the name of a secret to use for TLS certificates")
// NB there is already a --timeout in the global flags, for
// controlling timeout on operations while e.g., creating objects.
flags.DurationVar(&imageRepoArgs.timeout, "scan-timeout", 0, "a timeout for scanning; this defaults to the interval if not set")
createImageCmd.AddCommand(createImageRepositoryCmd)
}
func createImageRepositoryRun(cmd *cobra.Command, args []string) error {
objectName := args[0]
if imageRepoArgs.image == "" {
return fmt.Errorf("an image repository (--image) is required")
}
if _, err := name.NewRepository(imageRepoArgs.image); err != nil {
return fmt.Errorf("unable to parse image value: %w", err)
}
labels, err := parseLabels()
if err != nil {
return err
}
var repo = imagev1.ImageRepository{
ObjectMeta: metav1.ObjectMeta{
Name: objectName,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
},
Spec: imagev1.ImageRepositorySpec{
Image: imageRepoArgs.image,
Interval: metav1.Duration{Duration: createArgs.interval},
},
}
if imageRepoArgs.timeout != 0 {
repo.Spec.Timeout = &metav1.Duration{Duration: imageRepoArgs.timeout}
}
if imageRepoArgs.secretRef != "" {
repo.Spec.SecretRef = &meta.LocalObjectReference{
Name: imageRepoArgs.secretRef,
}
}
if imageRepoArgs.certSecretRef != "" {
repo.Spec.CertSecretRef = &meta.LocalObjectReference{
Name: imageRepoArgs.certSecretRef,
}
}
if createArgs.export {
return printExport(exportImageRepository(&repo))
}
// a temp value for use with the rest
var existing imagev1.ImageRepository
copyName(&existing, &repo)
err = imageRepositoryType.upsertAndWait(imageRepositoryAdapter{&existing}, func() error {
existing.Spec = repo.Spec
existing.Labels = repo.Labels
return nil
})
return err
}

View File

@@ -0,0 +1,178 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var createImageUpdateCmd = &cobra.Command{
Use: "update [name]",
Short: "Create or update an ImageUpdateAutomation object",
Long: withPreviewNote(`The create image update command generates an ImageUpdateAutomation resource.
An ImageUpdateAutomation object specifies an automated update to images
mentioned in YAMLs in a git repository.`),
Example: ` # Configure image updates for the main repository created by flux bootstrap
flux create image update flux-system \
--git-repo-ref=flux-system \
--git-repo-path="./clusters/my-cluster" \
--checkout-branch=main \
--author-name=flux \
--author-email=flux@example.com \
--commit-template="{{range .Updated.Images}}{{println .}}{{end}}"
# Configure image updates to push changes to a different branch, if the branch doesn't exists it will be created
flux create image update flux-system \
--git-repo-ref=flux-system \
--git-repo-path="./clusters/my-cluster" \
--checkout-branch=main \
--push-branch=image-updates \
--author-name=flux \
--author-email=flux@example.com \
--commit-template="{{range .Updated.Images}}{{println .}}{{end}}"
# Configure image updates for a Git repository in a different namespace
flux create image update apps \
--namespace=apps \
--git-repo-ref=flux-system \
--git-repo-namespace=flux-system \
--git-repo-path="./clusters/my-cluster" \
--checkout-branch=main \
--push-branch=image-updates \
--author-name=flux \
--author-email=flux@example.com \
--commit-template="{{range .Updated.Images}}{{println .}}{{end}}"
`,
RunE: createImageUpdateRun,
}
type imageUpdateFlags struct {
gitRepoName string
gitRepoNamespace string
gitRepoPath string
checkoutBranch string
pushBranch string
commitTemplate string
authorName string
authorEmail string
}
var imageUpdateArgs = imageUpdateFlags{}
func init() {
flags := createImageUpdateCmd.Flags()
flags.StringVar(&imageUpdateArgs.gitRepoName, "git-repo-ref", "", "the name of a GitRepository resource with details of the upstream Git repository")
flags.StringVar(&imageUpdateArgs.gitRepoNamespace, "git-repo-namespace", "", "the namespace of the GitRepository resource, defaults to the ImageUpdateAutomation namespace")
flags.StringVar(&imageUpdateArgs.gitRepoPath, "git-repo-path", "", "path to the directory containing the manifests to be updated, defaults to the repository root")
flags.StringVar(&imageUpdateArgs.checkoutBranch, "checkout-branch", "", "the branch to checkout")
flags.StringVar(&imageUpdateArgs.pushBranch, "push-branch", "", "the branch to push commits to, defaults to the checkout branch if not specified")
flags.StringVar(&imageUpdateArgs.commitTemplate, "commit-template", "", "a template for commit messages")
flags.StringVar(&imageUpdateArgs.authorName, "author-name", "", "the name to use for commit author")
flags.StringVar(&imageUpdateArgs.authorEmail, "author-email", "", "the email to use for commit author")
createImageCmd.AddCommand(createImageUpdateCmd)
}
func createImageUpdateRun(cmd *cobra.Command, args []string) error {
objectName := args[0]
if imageUpdateArgs.gitRepoName == "" {
return fmt.Errorf("a reference to a GitRepository is required (--git-repo-ref)")
}
if imageUpdateArgs.checkoutBranch == "" {
return fmt.Errorf("the Git repository branch is required (--checkout-branch)")
}
if imageUpdateArgs.authorName == "" {
return fmt.Errorf("the author name is required (--author-name)")
}
if imageUpdateArgs.authorEmail == "" {
return fmt.Errorf("the author email is required (--author-email)")
}
labels, err := parseLabels()
if err != nil {
return err
}
var update = autov1.ImageUpdateAutomation{
ObjectMeta: metav1.ObjectMeta{
Name: objectName,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
},
Spec: autov1.ImageUpdateAutomationSpec{
SourceRef: autov1.CrossNamespaceSourceReference{
Kind: sourcev1.GitRepositoryKind,
Name: imageUpdateArgs.gitRepoName,
Namespace: imageUpdateArgs.gitRepoNamespace,
},
GitSpec: &autov1.GitSpec{
Checkout: &autov1.GitCheckoutSpec{
Reference: sourcev1.GitRepositoryRef{
Branch: imageUpdateArgs.checkoutBranch,
},
},
Commit: autov1.CommitSpec{
Author: autov1.CommitUser{
Name: imageUpdateArgs.authorName,
Email: imageUpdateArgs.authorEmail,
},
MessageTemplate: imageUpdateArgs.commitTemplate,
},
},
Interval: metav1.Duration{
Duration: createArgs.interval,
},
},
}
if imageUpdateArgs.pushBranch != "" {
update.Spec.GitSpec.Push = &autov1.PushSpec{
Branch: imageUpdateArgs.pushBranch,
}
}
if imageUpdateArgs.gitRepoPath != "" {
update.Spec.Update = &autov1.UpdateStrategy{
Path: imageUpdateArgs.gitRepoPath,
Strategy: autov1.UpdateStrategySetters,
}
}
if createArgs.export {
return printExport(exportImageUpdate(&update))
}
var existing autov1.ImageUpdateAutomation
copyName(&existing, &update)
err = imageUpdateAutomationType.upsertAndWait(imageUpdateAutomationAdapter{&existing}, func() error {
existing.Spec = update.Spec
existing.Labels = update.Labels
return nil
})
return err
}

View File

@@ -23,102 +23,125 @@ import (
"time"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createKsCmd = &cobra.Command{
Use: "kustomization [name]",
Aliases: []string{"ks"},
Short: "Create or update a Kustomization resource",
Long: "The kustomization source create command generates a Kustomize resource for a given source.",
Long: `The create command generates a Kustomization resource for a given source.`,
Example: ` # Create a Kustomization resource from a source at a given path
flux create kustomization contour \
--source=contour \
--path="./examples/contour/" \
flux create kustomization kyverno \
--source=GitRepository/kyverno \
--path="./config/release" \
--prune=true \
--interval=10m \
--validation=client \
--health-check="Deployment/contour.projectcontour" \
--health-check="DaemonSet/envoy.projectcontour" \
--interval=60m \
--wait=true \
--health-check-timeout=3m
# Create a Kustomization resource that depends on the previous one
flux create kustomization webapp \
--depends-on=contour \
--source=webapp \
--path="./deploy/overlays/dev" \
flux create kustomization kyverno-policies \
--depends-on=kyverno \
--source=GitRepository/kyverno-policies \
--path="./policies/flux" \
--prune=true \
--interval=5m \
--validation=client
--interval=5m
# Create a Kustomization using a source from a different namespace
flux create kustomization podinfo \
--namespace=default \
--source=GitRepository/podinfo.flux-system \
--path="./kustomize" \
--prune=true \
--interval=5m
# Create a Kustomization resource that references an OCIRepository
flux create kustomization podinfo \
--source=OCIRepository/podinfo \
--target-namespace=default \
--prune=true \
--interval=5m
# Create a Kustomization resource that references a Bucket
flux create kustomization secrets \
--source=Bucket/secrets \
--prune=true \
--interval=5m
`,
--interval=5m`,
RunE: createKsCmdRun,
}
var (
ksSource flags.KustomizationSource
ksPath string
ksPrune bool
ksDependsOn []string
ksValidation string
ksHealthCheck []string
ksHealthTimeout time.Duration
ksSAName string
ksDecryptionProvider flags.DecryptionProvider
ksDecryptionSecret string
ksTargetNamespace string
)
type kustomizationFlags struct {
source flags.KustomizationSource
path flags.SafeRelativePath
prune bool
dependsOn []string
validation string
healthCheck []string
healthTimeout time.Duration
saName string
decryptionProvider flags.DecryptionProvider
decryptionSecret string
targetNamespace string
wait bool
kubeConfigSecretRef string
retryInterval time.Duration
}
var kustomizationArgs = NewKustomizationFlags()
func init() {
createKsCmd.Flags().Var(&ksSource, "source", ksSource.Description())
createKsCmd.Flags().StringVar(&ksPath, "path", "./", "path to the directory containing the Kustomization file")
createKsCmd.Flags().BoolVar(&ksPrune, "prune", false, "enable garbage collection")
createKsCmd.Flags().StringArrayVar(&ksHealthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
createKsCmd.Flags().DurationVar(&ksHealthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
createKsCmd.Flags().StringVar(&ksValidation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'")
createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name")
createKsCmd.Flags().Var(&ksDecryptionProvider, "decryption-provider", ksDecryptionProvider.Description())
createKsCmd.Flags().StringVar(&ksDecryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
createKsCmd.Flags().StringVar(&ksTargetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization")
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
createKsCmd.Flags().BoolVar(&kustomizationArgs.wait, "wait", false, "enable health checking of all the applied resources")
createKsCmd.Flags().StringSliceVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
createKsCmd.Flags().DurationVar(&kustomizationArgs.healthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
createKsCmd.Flags().StringVar(&kustomizationArgs.validation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
createKsCmd.Flags().StringSliceVar(&kustomizationArgs.dependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>', also accepts comma-separated values")
createKsCmd.Flags().StringVar(&kustomizationArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization")
createKsCmd.Flags().Var(&kustomizationArgs.decryptionProvider, "decryption-provider", kustomizationArgs.decryptionProvider.Description())
createKsCmd.Flags().StringVar(&kustomizationArgs.decryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
createKsCmd.Flags().StringVar(&kustomizationArgs.targetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization")
createKsCmd.Flags().StringVar(&kustomizationArgs.kubeConfigSecretRef, "kubeconfig-secret-ref", "", "the name of the Kubernetes Secret that contains a key with the kubeconfig file for connecting to a remote cluster")
createKsCmd.Flags().MarkDeprecated("validation", "this arg is no longer used, all resources are validated using server-side apply dry-run")
createKsCmd.Flags().DurationVar(&kustomizationArgs.retryInterval, "retry-interval", 0, "the interval at which to retry a previously failed reconciliation")
createCmd.AddCommand(createKsCmd)
}
func createKsCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Kustomization name is required")
func NewKustomizationFlags() kustomizationFlags {
return kustomizationFlags{
path: "./",
}
}
func createKsCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
if ksPath == "" {
if kustomizationArgs.path == "" {
return fmt.Errorf("path is required")
}
if !strings.HasPrefix(ksPath, "./") {
if !strings.HasPrefix(kustomizationArgs.path.String(), "./") {
return fmt.Errorf("path must begin with ./")
}
if !export {
if !createArgs.export {
logger.Generatef("generating Kustomization")
}
ksLabels, err := parseLabels()
kslabels, err := parseLabels()
if err != nil {
return err
}
@@ -126,29 +149,37 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
kustomization := kustomizev1.Kustomization{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: ksLabels,
Namespace: *kubeconfigArgs.Namespace,
Labels: kslabels,
},
Spec: kustomizev1.KustomizationSpec{
DependsOn: utils.MakeDependsOn(ksDependsOn),
DependsOn: utils.MakeDependsOn(kustomizationArgs.dependsOn),
Interval: metav1.Duration{
Duration: interval,
Duration: createArgs.interval,
},
Path: ksPath,
Prune: ksPrune,
Path: kustomizationArgs.path.ToSlash(),
Prune: kustomizationArgs.prune,
SourceRef: kustomizev1.CrossNamespaceSourceReference{
Kind: ksSource.Kind,
Name: ksSource.Name,
Kind: kustomizationArgs.source.Kind,
Name: kustomizationArgs.source.Name,
Namespace: kustomizationArgs.source.Namespace,
},
Suspend: false,
Validation: ksValidation,
TargetNamespace: ksTargetNamespace,
TargetNamespace: kustomizationArgs.targetNamespace,
},
}
if len(ksHealthCheck) > 0 {
healthChecks := make([]kustomizev1.CrossNamespaceObjectReference, 0)
for _, w := range ksHealthCheck {
if kustomizationArgs.kubeConfigSecretRef != "" {
kustomization.Spec.KubeConfig = &meta.KubeConfigReference{
SecretRef: meta.SecretKeyReference{
Name: kustomizationArgs.kubeConfigSecretRef,
},
}
}
if len(kustomizationArgs.healthCheck) > 0 && !kustomizationArgs.wait {
healthChecks := make([]meta.NamespacedObjectKindReference, 0)
for _, w := range kustomizationArgs.healthCheck {
kindObj := strings.Split(w, "/")
if len(kindObj) != 2 {
return fmt.Errorf("invalid health check '%s' must be in the format 'kind/name.namespace' %v", w, kindObj)
@@ -170,7 +201,7 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("invalid health check '%s' must be in the format 'kind/name.namespace'", w)
}
check := kustomizev1.CrossNamespaceObjectReference{
check := meta.NamespacedObjectKindReference{
Kind: kind,
Name: nameNs[0],
Namespace: nameNs[1],
@@ -183,32 +214,43 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
}
kustomization.Spec.HealthChecks = healthChecks
kustomization.Spec.Timeout = &metav1.Duration{
Duration: ksHealthTimeout,
Duration: kustomizationArgs.healthTimeout,
}
}
if ksSAName != "" {
kustomization.Spec.ServiceAccountName = ksSAName
if kustomizationArgs.wait {
kustomization.Spec.Wait = true
kustomization.Spec.Timeout = &metav1.Duration{
Duration: kustomizationArgs.healthTimeout,
}
}
if ksDecryptionProvider != "" {
if kustomizationArgs.saName != "" {
kustomization.Spec.ServiceAccountName = kustomizationArgs.saName
}
if kustomizationArgs.decryptionProvider != "" {
kustomization.Spec.Decryption = &kustomizev1.Decryption{
Provider: ksDecryptionProvider.String(),
Provider: kustomizationArgs.decryptionProvider.String(),
}
if ksDecryptionSecret != "" {
kustomization.Spec.Decryption.SecretRef = &corev1.LocalObjectReference{Name: ksDecryptionSecret}
if kustomizationArgs.decryptionSecret != "" {
kustomization.Spec.Decryption.SecretRef = &meta.LocalObjectReference{Name: kustomizationArgs.decryptionSecret}
}
}
if export {
return exportKs(kustomization)
if kustomizationArgs.retryInterval > 0 {
kustomization.Spec.RetryInterval = &metav1.Duration{Duration: kustomizationArgs.retryInterval}
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
if createArgs.export {
return printExport(exportKs(&kustomization))
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
@@ -220,8 +262,8 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for Kustomization reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isKustomizationReady(ctx, kubeClient, namespacedName, &kustomization)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, &kustomization)); err != nil {
return err
}
logger.Successf("Kustomization %s is ready", name)
@@ -260,28 +302,3 @@ func upsertKustomization(ctx context.Context, kubeClient client.Client,
logger.Successf("Kustomization updated")
return namespacedName, nil
}
func isKustomizationReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, kustomization *kustomizev1.Kustomization) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, kustomization)
if err != nil {
return false, err
}
// Confirm the state we are observing is for the current generation
if kustomization.Generation != kustomization.Status.ObservedGeneration {
return false, nil
}
if c := apimeta.FindStatusCondition(kustomization.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

View File

@@ -21,23 +21,22 @@ import (
"fmt"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createReceiverCmd = &cobra.Command{
Use: "receiver [name]",
Short: "Create or update a Receiver resource",
Long: "The create receiver command generates a Receiver resource.",
Long: `The create receiver command generates a Receiver resource.`,
Example: ` # Create a Receiver
flux create receiver github-receiver \
--type github \
@@ -45,42 +44,40 @@ var createReceiverCmd = &cobra.Command{
--event push \
--secret-ref webhook-token \
--resource GitRepository/webapp \
--resource HelmRepository/webapp
`,
--resource HelmRepository/webapp`,
RunE: createReceiverCmdRun,
}
var (
rcvType string
rcvSecretRef string
rcvEvents []string
rcvResources []string
)
type receiverFlags struct {
receiverType string
secretRef string
events []string
resources []string
}
var receiverArgs receiverFlags
func init() {
createReceiverCmd.Flags().StringVar(&rcvType, "type", "", "")
createReceiverCmd.Flags().StringVar(&rcvSecretRef, "secret-ref", "", "")
createReceiverCmd.Flags().StringArrayVar(&rcvEvents, "event", []string{}, "")
createReceiverCmd.Flags().StringArrayVar(&rcvResources, "resource", []string{}, "")
createReceiverCmd.Flags().StringVar(&receiverArgs.receiverType, "type", "", "")
createReceiverCmd.Flags().StringVar(&receiverArgs.secretRef, "secret-ref", "", "")
createReceiverCmd.Flags().StringSliceVar(&receiverArgs.events, "event", []string{}, "also accepts comma-separated values")
createReceiverCmd.Flags().StringSliceVar(&receiverArgs.resources, "resource", []string{}, "also accepts comma-separated values")
createCmd.AddCommand(createReceiverCmd)
}
func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Receiver name is required")
}
name := args[0]
if rcvType == "" {
if receiverArgs.receiverType == "" {
return fmt.Errorf("Receiver type is required")
}
if rcvSecretRef == "" {
if receiverArgs.secretRef == "" {
return fmt.Errorf("secret ref is required")
}
resources := []notificationv1.CrossNamespaceObjectReference{}
for _, resource := range rcvResources {
for _, resource := range receiverArgs.resources {
kind, name := utils.ParseObjectKindName(resource)
if kind == "" {
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", resource)
@@ -101,35 +98,35 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
return err
}
if !export {
if !createArgs.export {
logger.Generatef("generating Receiver")
}
receiver := notificationv1.Receiver{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: notificationv1.ReceiverSpec{
Type: rcvType,
Events: rcvEvents,
Type: receiverArgs.receiverType,
Events: receiverArgs.events,
Resources: resources,
SecretRef: corev1.LocalObjectReference{
Name: rcvSecretRef,
SecretRef: meta.LocalObjectReference{
Name: receiverArgs.secretRef,
},
Suspend: false,
},
}
if export {
return exportReceiver(receiver)
if createArgs.export {
return printExport(exportReceiver(&receiver))
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
@@ -141,13 +138,13 @@ func createReceiverCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for Receiver reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isReceiverReady(ctx, kubeClient, namespacedName, &receiver)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, &receiver)); err != nil {
return err
}
logger.Successf("Receiver %s is ready", name)
logger.Successf("generated webhook URL %s", receiver.Status.URL)
logger.Successf("generated webhook URL %s", receiver.Status.WebhookPath)
return nil
}
@@ -181,23 +178,3 @@ func upsertReceiver(ctx context.Context, kubeClient client.Client,
logger.Successf("Receiver updated")
return namespacedName, nil
}
func isReceiverReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, receiver *notificationv1.Receiver) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, receiver)
if err != nil {
return false, err
}
if c := apimeta.FindStatusCondition(receiver.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

63
cmd/flux/create_secret.go Normal file
View File

@@ -0,0 +1,63 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
)
var createSecretCmd = &cobra.Command{
Use: "secret",
Short: "Create or update Kubernetes secrets",
Long: `The create source sub-commands generate Kubernetes secrets specific to Flux.`,
}
func init() {
createCmd.AddCommand(createSecretCmd)
}
func upsertSecret(ctx context.Context, kubeClient client.Client, secret corev1.Secret) error {
namespacedName := types.NamespacedName{
Namespace: secret.GetNamespace(),
Name: secret.GetName(),
}
var existing corev1.Secret
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
if err := kubeClient.Create(ctx, &secret); err != nil {
return err
} else {
return nil
}
}
return err
}
existing.StringData = secret.StringData
if err := kubeClient.Update(ctx, &existing); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,213 @@
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"crypto/elliptic"
"fmt"
"net/url"
"os"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/yaml"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
var createSecretGitCmd = &cobra.Command{
Use: "git [name]",
Short: "Create or update a Kubernetes secret for Git authentication",
Long: `The create secret git command generates a Kubernetes secret with Git credentials.
For Git over SSH, the host and SSH keys are automatically generated and stored
in the secret.
For Git over HTTP/S, the provided basic authentication credentials or bearer
authentication token are stored in the secret.`,
Example: ` # Create a Git SSH authentication secret using an ECDSA P-521 curve public key
flux create secret git podinfo-auth \
--url=ssh://git@github.com/stefanprodan/podinfo \
--ssh-key-algorithm=ecdsa \
--ssh-ecdsa-curve=p521
# Create a Git SSH authentication secret with a passwordless private key from file
# The public SSH host key will still be gathered from the host
flux create secret git podinfo-auth \
--url=ssh://git@github.com/stefanprodan/podinfo \
--private-key-file=./private.key
# Create a Git SSH authentication secret with a passworded private key from file
# The public SSH host key will still be gathered from the host
flux create secret git podinfo-auth \
--url=ssh://git@github.com/stefanprodan/podinfo \
--private-key-file=./private.key \
--password=<password>
# Create a secret for a Git repository using basic authentication
flux create secret git podinfo-auth \
--url=https://github.com/stefanprodan/podinfo \
--username=username \
--password=password
# Create a Git SSH secret on disk
flux create secret git podinfo-auth \
--url=ssh://git@github.com/stefanprodan/podinfo \
--export > podinfo-auth.yaml
# Print the deploy key
yq eval '.stringData."identity.pub"' podinfo-auth.yaml
# Encrypt the secret on disk with Mozilla SOPS
sops --encrypt --encrypted-regex '^(data|stringData)$' \
--in-place podinfo-auth.yaml`,
RunE: createSecretGitCmdRun,
}
type secretGitFlags struct {
url string
username string
password string
keyAlgorithm flags.PublicKeyAlgorithm
rsaBits flags.RSAKeyBits
ecdsaCurve flags.ECDSACurve
caFile string
caCrtFile string
privateKeyFile string
bearerToken string
}
var secretGitArgs = NewSecretGitFlags()
func init() {
createSecretGitCmd.Flags().StringVar(&secretGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository")
createSecretGitCmd.Flags().StringVarP(&secretGitArgs.username, "username", "u", "", "basic authentication username")
createSecretGitCmd.Flags().StringVarP(&secretGitArgs.password, "password", "p", "", "basic authentication password")
createSecretGitCmd.Flags().Var(&secretGitArgs.keyAlgorithm, "ssh-key-algorithm", secretGitArgs.keyAlgorithm.Description())
createSecretGitCmd.Flags().Var(&secretGitArgs.rsaBits, "ssh-rsa-bits", secretGitArgs.rsaBits.Description())
createSecretGitCmd.Flags().Var(&secretGitArgs.ecdsaCurve, "ssh-ecdsa-curve", secretGitArgs.ecdsaCurve.Description())
createSecretGitCmd.Flags().StringVar(&secretGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
createSecretGitCmd.Flags().StringVar(&secretGitArgs.caCrtFile, "ca-crt-file", "", "path to TLS CA certificate file used for validating self-signed certificates; takes precedence over --ca-file")
createSecretGitCmd.Flags().StringVar(&secretGitArgs.privateKeyFile, "private-key-file", "", "path to a passwordless private key file used for authenticating to the Git SSH server")
createSecretGitCmd.Flags().StringVar(&secretGitArgs.bearerToken, "bearer-token", "", "bearer authentication token")
createSecretCmd.AddCommand(createSecretGitCmd)
}
func NewSecretGitFlags() secretGitFlags {
return secretGitFlags{
keyAlgorithm: flags.PublicKeyAlgorithm(sourcesecret.ECDSAPrivateKeyAlgorithm),
rsaBits: 2048,
ecdsaCurve: flags.ECDSACurve{Curve: elliptic.P384()},
}
}
func createSecretGitCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
if secretGitArgs.url == "" {
return fmt.Errorf("url is required")
}
u, err := url.Parse(secretGitArgs.url)
if err != nil {
return fmt.Errorf("git URL parse failed: %w", err)
}
labels, err := parseLabels()
if err != nil {
return err
}
opts := sourcesecret.Options{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
switch u.Scheme {
case "ssh":
keypair, err := sourcesecret.LoadKeyPairFromPath(secretGitArgs.privateKeyFile, secretGitArgs.password)
if err != nil {
return err
}
opts.Keypair = keypair
opts.SSHHostname = u.Host
opts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(secretGitArgs.keyAlgorithm)
opts.RSAKeyBits = int(secretGitArgs.rsaBits)
opts.ECDSACurve = secretGitArgs.ecdsaCurve.Curve
opts.Password = secretGitArgs.password
case "http", "https":
if (secretGitArgs.username == "" || secretGitArgs.password == "") && secretGitArgs.bearerToken == "" {
return fmt.Errorf("for Git over HTTP/S the username and password, or a bearer token is required")
}
opts.Username = secretGitArgs.username
opts.Password = secretGitArgs.password
opts.BearerToken = secretGitArgs.bearerToken
if secretGitArgs.username != "" && secretGitArgs.password != "" && secretGitArgs.bearerToken != "" {
return fmt.Errorf("user credentials and bearer token cannot be used together")
}
// --ca-crt-file takes precedence over --ca-file.
if secretGitArgs.caCrtFile != "" {
opts.CACrt, err = os.ReadFile(secretGitArgs.caCrtFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
} else if secretGitArgs.caFile != "" {
opts.CAFile, err = os.ReadFile(secretGitArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
default:
return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme)
}
secret, err := sourcesecret.Generate(opts)
if err != nil {
return err
}
if createArgs.export {
rootCmd.Println(secret.Content)
return nil
}
var s corev1.Secret
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if ppk, ok := s.StringData[sourcesecret.PublicKeySecretKey]; ok {
logger.Generatef("deploy key: %s", ppk)
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
logger.Actionf("git secret '%s' created in '%s' namespace", name, *kubeconfigArgs.Namespace)
return nil
}

View File

@@ -0,0 +1,70 @@
package main
import (
"fmt"
"os"
"testing"
)
func TestCreateGitSecret(t *testing.T) {
file, err := os.CreateTemp(t.TempDir(), "ca-crt")
if err != nil {
t.Fatal("could not create CA certificate file")
}
_, err = file.Write([]byte("ca-data"))
if err != nil {
t.Fatal("could not write to CA certificate file")
}
tests := []struct {
name string
args string
assert assertFunc
}{
{
name: "no args",
args: "create secret git",
assert: assertError("name is required"),
},
{
name: "basic secret",
args: "create secret git podinfo-auth --url=https://github.com/stefanprodan/podinfo --username=my-username --password=my-password --namespace=my-namespace --export",
assert: assertGoldenFile("./testdata/create_secret/git/secret-git-basic.yaml"),
},
{
name: "ssh key",
args: "create secret git podinfo-auth --url=ssh://git@github.com/stefanprodan/podinfo --private-key-file=./testdata/create_secret/git/ecdsa.private --namespace=my-namespace --export",
assert: assertGoldenFile("testdata/create_secret/git/git-ssh-secret.yaml"),
},
{
name: "ssh key with password",
args: "create secret git podinfo-auth --url=ssh://git@github.com/stefanprodan/podinfo --private-key-file=./testdata/create_secret/git/ecdsa-password.private --password=password --namespace=my-namespace --export",
assert: assertGoldenFile("testdata/create_secret/git/git-ssh-secret-password.yaml"),
},
{
name: "git authentication with bearer token",
args: "create secret git bearer-token-auth --url=https://github.com/stefanprodan/podinfo --bearer-token=ghp_baR2qnFF0O41WlucePL3udt2N9vVZS4R0hAS --namespace=my-namespace --export",
assert: assertGoldenFile("testdata/create_secret/git/git-bearer-token.yaml"),
},
{
name: "git authentication with CA certificate",
args: fmt.Sprintf("create secret git ca-crt --url=https://github.com/stefanprodan/podinfo --password=my-password --username=my-username --ca-crt-file=%s --namespace=my-namespace --export", file.Name()),
assert: assertGoldenFile("testdata/create_secret/git/secret-ca-crt.yaml"),
},
{
name: "git authentication with basic auth and bearer token",
args: "create secret git podinfo-auth --url=https://github.com/stefanprodan/podinfo --username=aaa --password=zzzz --bearer-token=aaaa --namespace=my-namespace --export",
assert: assertError("user credentials and bearer token cannot be used together"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tt.args,
assert: tt.assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -0,0 +1,134 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"os"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/yaml"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
var createSecretHelmCmd = &cobra.Command{
Use: "helm [name]",
Short: "Create or update a Kubernetes secret for Helm repository authentication",
Long: withPreviewNote(`The create secret helm command generates a Kubernetes secret with basic authentication credentials.`),
Example: ` # Create a Helm authentication secret on disk and encrypt it with Mozilla SOPS
flux create secret helm repo-auth \
--namespace=my-namespace \
--username=my-username \
--password=my-password \
--export > repo-auth.yaml
sops --encrypt --encrypted-regex '^(data|stringData)$' \
--in-place repo-auth.yaml`,
RunE: createSecretHelmCmdRun,
}
type secretHelmFlags struct {
username string
password string
secretTLSFlags
}
var secretHelmArgs secretHelmFlags
func init() {
flags := createSecretHelmCmd.Flags()
flags.StringVarP(&secretHelmArgs.username, "username", "u", "", "basic authentication username")
flags.StringVarP(&secretHelmArgs.password, "password", "p", "", "basic authentication password")
initSecretDeprecatedTLSFlags(flags, &secretHelmArgs.secretTLSFlags)
deprecationMsg := "please use the command `flux create secret tls` to generate TLS secrets"
flags.MarkDeprecated("cert-file", deprecationMsg)
flags.MarkDeprecated("key-file", deprecationMsg)
flags.MarkDeprecated("ca-file", deprecationMsg)
createSecretCmd.AddCommand(createSecretHelmCmd)
}
func createSecretHelmCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
labels, err := parseLabels()
if err != nil {
return err
}
caBundle := []byte{}
if secretHelmArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(secretHelmArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
var certFile, keyFile []byte
if secretHelmArgs.certFile != "" && secretHelmArgs.keyFile != "" {
if certFile, err = os.ReadFile(secretHelmArgs.certFile); err != nil {
return fmt.Errorf("failed to read cert file: %w", err)
}
if keyFile, err = os.ReadFile(secretHelmArgs.keyFile); err != nil {
return fmt.Errorf("failed to read key file: %w", err)
}
}
opts := sourcesecret.Options{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
Username: secretHelmArgs.username,
Password: secretHelmArgs.password,
CAFile: caBundle,
CertFile: certFile,
KeyFile: keyFile,
}
secret, err := sourcesecret.Generate(opts)
if err != nil {
return err
}
if createArgs.export {
rootCmd.Println(secret.Content)
return nil
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
var s corev1.Secret
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
logger.Actionf("helm secret '%s' created in '%s' namespace", name, *kubeconfigArgs.Namespace)
return nil
}

View File

@@ -0,0 +1,47 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"testing"
)
func TestCreateHelmSecret(t *testing.T) {
tests := []struct {
name string
args string
assert assertFunc
}{
{
args: "create secret helm",
assert: assertError("name is required"),
},
{
args: "create secret helm helm-secret --username=my-username --password=my-password --namespace=my-namespace --export",
assert: assertGoldenFile("testdata/create_secret/helm/secret-helm.yaml"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tt.args,
assert: tt.assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -0,0 +1,121 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
"github.com/google/go-containerregistry/pkg/name"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/yaml"
)
var createSecretOCICmd = &cobra.Command{
Use: "oci [name]",
Short: "Create or update a Kubernetes image pull secret",
Long: withPreviewNote(`The create secret oci command generates a Kubernetes secret that can be used for OCIRepository authentication`),
Example: ` # Create an OCI authentication secret on disk and encrypt it with Mozilla SOPS
flux create secret oci podinfo-auth \
--url=ghcr.io \
--username=username \
--password=password \
--export > repo-auth.yaml
sops --encrypt --encrypted-regex '^(data|stringData)$' \
--in-place repo-auth.yaml
`,
RunE: createSecretOCICmdRun,
}
type secretOCIFlags struct {
url string
password string
username string
}
var secretOCIArgs = secretOCIFlags{}
func init() {
createSecretOCICmd.Flags().StringVar(&secretOCIArgs.url, "url", "", "oci repository address e.g ghcr.io/stefanprodan/charts")
createSecretOCICmd.Flags().StringVarP(&secretOCIArgs.username, "username", "u", "", "basic authentication username")
createSecretOCICmd.Flags().StringVarP(&secretOCIArgs.password, "password", "p", "", "basic authentication password")
createSecretCmd.AddCommand(createSecretOCICmd)
}
func createSecretOCICmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("name is required")
}
secretName := args[0]
if secretOCIArgs.url == "" {
return fmt.Errorf("--url is required")
}
if secretOCIArgs.username == "" {
return fmt.Errorf("--username is required")
}
if secretOCIArgs.password == "" {
return fmt.Errorf("--password is required")
}
if _, err := name.ParseReference(secretOCIArgs.url); err != nil {
return fmt.Errorf("error parsing url: '%s'", err)
}
opts := sourcesecret.Options{
Name: secretName,
Namespace: *kubeconfigArgs.Namespace,
Registry: secretOCIArgs.url,
Password: secretOCIArgs.password,
Username: secretOCIArgs.username,
}
secret, err := sourcesecret.Generate(opts)
if err != nil {
return err
}
if createArgs.export {
rootCmd.Println(secret.Content)
return nil
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
var s corev1.Secret
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
logger.Actionf("oci secret '%s' created in '%s' namespace", secretName, *kubeconfigArgs.Namespace)
return nil
}

View File

@@ -0,0 +1,51 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"testing"
)
func TestCreateSecretOCI(t *testing.T) {
tests := []struct {
name string
args string
assert assertFunc
}{
{
args: "create secret oci",
assert: assertError("name is required"),
},
{
args: "create secret oci ghcr",
assert: assertError("--url is required"),
},
{
args: "create secret oci ghcr --namespace=my-namespace --url ghcr.io --username stefanprodan --password=password --export",
assert: assertGoldenFile("testdata/create_secret/oci/create-secret.yaml"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tt.args,
assert: tt.assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -0,0 +1,154 @@
/*
Copyright 2020, 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/yaml"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
var createSecretTLSCmd = &cobra.Command{
Use: "tls [name]",
Short: "Create or update a Kubernetes secret with TLS certificates",
Long: withPreviewNote(`The create secret tls command generates a Kubernetes secret with certificates for use with TLS.`),
Example: ` # Create a TLS secret on disk and encrypt it with Mozilla SOPS.
# Files are expected to be PEM-encoded.
flux create secret tls certs \
--namespace=my-namespace \
--tls-crt-file=./client.crt \
--tls-key-file=./client.key \
--ca-crt-file=./ca.crt \
--export > certs.yaml
sops --encrypt --encrypted-regex '^(data|stringData)$' \
--in-place certs.yaml`,
RunE: createSecretTLSCmdRun,
}
type secretTLSFlags struct {
certFile string
keyFile string
caFile string
caCrtFile string
tlsKeyFile string
tlsCrtFile string
}
var secretTLSArgs secretTLSFlags
func initSecretDeprecatedTLSFlags(flags *pflag.FlagSet, args *secretTLSFlags) {
flags.StringVar(&args.certFile, "cert-file", "", "TLS authentication cert file path")
flags.StringVar(&args.keyFile, "key-file", "", "TLS authentication key file path")
flags.StringVar(&args.caFile, "ca-file", "", "TLS authentication CA file path")
}
func initSecretTLSFlags(flags *pflag.FlagSet, args *secretTLSFlags) {
flags.StringVar(&args.tlsCrtFile, "tls-crt-file", "", "TLS authentication cert file path")
flags.StringVar(&args.tlsKeyFile, "tls-key-file", "", "TLS authentication key file path")
flags.StringVar(&args.caCrtFile, "ca-crt-file", "", "TLS authentication CA file path")
}
func init() {
flags := createSecretTLSCmd.Flags()
initSecretDeprecatedTLSFlags(flags, &secretTLSArgs)
initSecretTLSFlags(flags, &secretTLSArgs)
flags.MarkDeprecated("cert-file", "please use --tls-crt-file instead")
flags.MarkDeprecated("key-file", "please use --tls-key-file instead")
flags.MarkDeprecated("ca-file", "please use --ca-crt-file instead")
createSecretCmd.AddCommand(createSecretTLSCmd)
}
func createSecretTLSCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
labels, err := parseLabels()
if err != nil {
return err
}
opts := sourcesecret.Options{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: labels,
}
if secretTLSArgs.caCrtFile != "" {
opts.CACrt, err = os.ReadFile(secretTLSArgs.caCrtFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
} else if secretTLSArgs.caFile != "" {
opts.CAFile, err = os.ReadFile(secretTLSArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
if secretTLSArgs.tlsCrtFile != "" && secretTLSArgs.tlsKeyFile != "" {
if opts.TLSCrt, err = os.ReadFile(secretTLSArgs.tlsCrtFile); err != nil {
return fmt.Errorf("failed to read cert file: %w", err)
}
if opts.TLSKey, err = os.ReadFile(secretTLSArgs.tlsKeyFile); err != nil {
return fmt.Errorf("failed to read key file: %w", err)
}
} else if secretTLSArgs.certFile != "" && secretTLSArgs.keyFile != "" {
if opts.CertFile, err = os.ReadFile(secretTLSArgs.certFile); err != nil {
return fmt.Errorf("failed to read cert file: %w", err)
}
if opts.KeyFile, err = os.ReadFile(secretTLSArgs.keyFile); err != nil {
return fmt.Errorf("failed to read key file: %w", err)
}
}
secret, err := sourcesecret.Generate(opts)
if err != nil {
return err
}
if createArgs.export {
rootCmd.Print(secret.Content)
return nil
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
var s corev1.Secret
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
logger.Actionf("tls secret '%s' created in '%s' namespace", name, *kubeconfigArgs.Namespace)
return nil
}

View File

@@ -0,0 +1,35 @@
package main
import (
"testing"
)
func TestCreateTlsSecret(t *testing.T) {
tests := []struct {
name string
args string
assert assertFunc
}{
{
args: "create secret tls",
assert: assertError("name is required"),
},
{
args: "create secret tls certs --namespace=my-namespace --tls-crt-file=./testdata/create_secret/tls/test-cert.pem --tls-key-file=./testdata/create_secret/tls/test-key.pem --ca-crt-file=./testdata/create_secret/tls/test-ca.pem --export",
assert: assertGoldenFile("testdata/create_secret/tls/secret-tls.yaml"),
},
{
args: "create secret tls certs --namespace=my-namespace --cert-file=./testdata/create_secret/tls/test-cert.pem --key-file=./testdata/create_secret/tls/test-key.pem --ca-file=./testdata/create_secret/tls/test-ca.pem --export",
assert: assertGoldenFile("testdata/create_secret/tls/deprecated-secret-tls.yaml"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tt.args,
assert: tt.assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -17,15 +17,25 @@ limitations under the License.
package main
import (
"time"
"github.com/spf13/cobra"
)
var createSourceCmd = &cobra.Command{
Use: "source",
Short: "Create or update sources",
Long: "The create source sub-commands generate sources.",
Long: `The create source sub-commands generate sources.`,
}
type createSourceFlags struct {
fetchTimeout time.Duration
}
var createSourceArgs createSourceFlags
func init() {
createSourceCmd.PersistentFlags().DurationVar(&createSourceArgs.fetchTimeout, "fetch-timeout", createSourceArgs.fetchTimeout,
"set a timeout for fetch operations performed by source-controller (e.g. 'git clone' or 'helm repo update')")
createCmd.AddCommand(createSourceCmd)
}

View File

@@ -19,8 +19,8 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
@@ -30,18 +30,20 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createSourceBucketCmd = &cobra.Command{
Use: "bucket [name]",
Short: "Create or update a Bucket source",
Long: `
The create source bucket command generates a Bucket resource and waits for it to be downloaded.
For Buckets with static authentication, the credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a Buckets using static authentication
Long: withPreviewNote(`The create source bucket command generates a Bucket resource and waits for it to be downloaded.
For Buckets with static authentication, the credentials are stored in a Kubernetes secret.`),
Example: ` # Create a source for a Bucket using static authentication
flux create source bucket podinfo \
--bucket-name=podinfo \
--endpoint=minio.minio.svc.cluster.local:9000 \
@@ -50,52 +52,58 @@ For Buckets with static authentication, the credentials are stored in a Kubernet
--secret-key=mysecretkey \
--interval=10m
# Create a source from an Amazon S3 Bucket using IAM authentication
# Create a source for an Amazon S3 Bucket using IAM authentication
flux create source bucket podinfo \
--bucket-name=podinfo \
--provider=aws \
--endpoint=s3.amazonaws.com \
--region=us-east-1 \
--interval=10m
`,
--interval=10m`,
RunE: createSourceBucketCmdRun,
}
var (
sourceBucketName string
sourceBucketProvider = flags.SourceBucketProvider(sourcev1.GenericBucketProvider)
sourceBucketEndpoint string
sourceBucketAccessKey string
sourceBucketSecretKey string
sourceBucketRegion string
sourceBucketInsecure bool
sourceBucketSecretRef string
)
type sourceBucketFlags struct {
name string
provider flags.SourceBucketProvider
endpoint string
accessKey string
secretKey string
region string
insecure bool
secretRef string
ignorePaths []string
}
var sourceBucketArgs = newSourceBucketFlags()
func init() {
createSourceBucketCmd.Flags().Var(&sourceBucketProvider, "provider", sourceBucketProvider.Description())
createSourceBucketCmd.Flags().StringVar(&sourceBucketName, "bucket-name", "", "the bucket name")
createSourceBucketCmd.Flags().StringVar(&sourceBucketEndpoint, "endpoint", "", "the bucket endpoint address")
createSourceBucketCmd.Flags().StringVar(&sourceBucketAccessKey, "access-key", "", "the bucket access key")
createSourceBucketCmd.Flags().StringVar(&sourceBucketSecretKey, "secret-key", "", "the bucket secret key")
createSourceBucketCmd.Flags().StringVar(&sourceBucketRegion, "region", "", "the bucket region")
createSourceBucketCmd.Flags().BoolVar(&sourceBucketInsecure, "insecure", false, "for when connecting to a non-TLS S3 HTTP endpoint")
createSourceBucketCmd.Flags().StringVar(&sourceBucketSecretRef, "secret-ref", "", "the name of an existing secret containing credentials")
createSourceBucketCmd.Flags().Var(&sourceBucketArgs.provider, "provider", sourceBucketArgs.provider.Description())
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.name, "bucket-name", "", "the bucket name")
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.endpoint, "endpoint", "", "the bucket endpoint address")
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.accessKey, "access-key", "", "the bucket access key")
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.secretKey, "secret-key", "", "the bucket secret key")
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.region, "region", "", "the bucket region")
createSourceBucketCmd.Flags().BoolVar(&sourceBucketArgs.insecure, "insecure", false, "for when connecting to a non-TLS S3 HTTP endpoint")
createSourceBucketCmd.Flags().StringVar(&sourceBucketArgs.secretRef, "secret-ref", "", "the name of an existing secret containing credentials")
createSourceBucketCmd.Flags().StringSliceVar(&sourceBucketArgs.ignorePaths, "ignore-paths", nil, "set paths to ignore in bucket resource (can specify multiple paths with commas: path1,path2)")
createSourceCmd.AddCommand(createSourceBucketCmd)
}
func createSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Bucket source name is required")
func newSourceBucketFlags() sourceBucketFlags {
return sourceBucketFlags{
provider: flags.SourceBucketProvider(sourcev1.GenericBucketProvider),
}
}
func createSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
if sourceBucketName == "" {
if sourceBucketArgs.name == "" {
return fmt.Errorf("bucket-name is required")
}
if sourceBucketEndpoint == "" {
if sourceBucketArgs.endpoint == "" {
return fmt.Errorf("endpoint is required")
}
@@ -104,63 +112,76 @@ func createSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
return err
}
tmpDir, err := ioutil.TempDir("", name)
tmpDir, err := os.MkdirTemp("", name)
if err != nil {
return err
}
defer os.RemoveAll(tmpDir)
var ignorePaths *string
if len(sourceBucketArgs.ignorePaths) > 0 {
ignorePathsStr := strings.Join(sourceBucketArgs.ignorePaths, "\n")
ignorePaths = &ignorePathsStr
}
bucket := &sourcev1.Bucket{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: sourcev1.BucketSpec{
BucketName: sourceBucketName,
Provider: sourceBucketProvider.String(),
Insecure: sourceBucketInsecure,
Endpoint: sourceBucketEndpoint,
Region: sourceBucketRegion,
BucketName: sourceBucketArgs.name,
Provider: sourceBucketArgs.provider.String(),
Insecure: sourceBucketArgs.insecure,
Endpoint: sourceBucketArgs.endpoint,
Region: sourceBucketArgs.region,
Interval: metav1.Duration{
Duration: interval,
Duration: createArgs.interval,
},
Ignore: ignorePaths,
},
}
if sourceHelmSecretRef != "" {
bucket.Spec.SecretRef = &corev1.LocalObjectReference{
Name: sourceBucketSecretRef,
if createSourceArgs.fetchTimeout > 0 {
bucket.Spec.Timeout = &metav1.Duration{Duration: createSourceArgs.fetchTimeout}
}
if sourceBucketArgs.secretRef != "" {
bucket.Spec.SecretRef = &meta.LocalObjectReference{
Name: sourceBucketArgs.secretRef,
}
}
if export {
return exportBucket(*bucket)
if createArgs.export {
return printExport(exportBucket(bucket))
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
logger.Generatef("generating Bucket source")
if sourceBucketSecretRef == "" {
if sourceBucketArgs.secretRef == "" {
secretName := fmt.Sprintf("bucket-%s", name)
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
StringData: map[string]string{},
}
if sourceBucketAccessKey != "" && sourceBucketSecretKey != "" {
secret.StringData["accesskey"] = sourceBucketAccessKey
secret.StringData["secretkey"] = sourceBucketSecretKey
if sourceBucketArgs.accessKey != "" && sourceBucketArgs.secretKey != "" {
secret.StringData["accesskey"] = sourceBucketArgs.accessKey
secret.StringData["secretkey"] = sourceBucketArgs.secretKey
}
if len(secret.StringData) > 0 {
@@ -168,7 +189,7 @@ func createSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return err
}
bucket.Spec.SecretRef = &corev1.LocalObjectReference{
bucket.Spec.SecretRef = &meta.LocalObjectReference{
Name: secretName,
}
logger.Successf("authentication configured")
@@ -182,8 +203,8 @@ func createSourceBucketCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for Bucket source reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isBucketReady(ctx, kubeClient, namespacedName, bucket)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, bucket)); err != nil {
return err
}
logger.Successf("Bucket source reconciliation completed")

View File

@@ -20,34 +20,53 @@ import (
"context"
"crypto/elliptic"
"fmt"
"io/ioutil"
"net/url"
"os"
"time"
"strings"
"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
"github.com/fluxcd/pkg/ssh"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
type sourceGitFlags struct {
url string
branch string
tag string
semver string
refName string
commit string
username string
password string
keyAlgorithm flags.PublicKeyAlgorithm
keyRSABits flags.RSAKeyBits
keyECDSACurve flags.ECDSACurve
secretRef string
caFile string
privateKeyFile string
recurseSubmodules bool
silent bool
ignorePaths []string
}
var createSourceGitCmd = &cobra.Command{
Use: "git [name]",
Short: "Create or update a GitRepository source",
Long: `
The create source git command generates a GitRepository resource and waits for it to sync.
Long: `The create source git command generates a GitRepository resource and waits for it to sync.
For Git over SSH, host and SSH keys are automatically generated and stored in a Kubernetes secret.
For private Git repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a public Git repository master branch
@@ -55,7 +74,7 @@ For private Git repositories, the basic authentication credentials are stored in
--url=https://github.com/stefanprodan/podinfo \
--branch=master
# Create a source from a Git repository pinned to specific git tag
# Create a source for a Git repository pinned to specific git tag
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--tag="3.2.3"
@@ -65,12 +84,12 @@ For private Git repositories, the basic authentication credentials are stored in
--url=https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.0 <3.3.0"
# Create a source from a Git repository using SSH authentication
# Create a source for a Git repository using SSH authentication
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master
# Create a source from a Git repository using SSH authentication and an
# Create a source for a Git repository using SSH authentication and an
# ECDSA P-521 curve public key
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
@@ -78,185 +97,223 @@ For private Git repositories, the basic authentication credentials are stored in
--ssh-key-algorithm=ecdsa \
--ssh-ecdsa-curve=p521
# Create a source from a Git repository using basic authentication
# Create a source for a Git repository using SSH authentication and a
# passwordless private key from file
# The public SSH host key will still be gathered from the host
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master \
--private-key-file=./private.key
# Create a source for a Git repository using SSH authentication and a
# private key with a password from file
# The public SSH host key will still be gathered from the host
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master \
--private-key-file=./private.key \
--password=<password>
# Create a source for a Git repository using basic authentication
flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \
--branch=master \
--username=username \
--password=password
`,
--password=password`,
RunE: createSourceGitCmdRun,
}
var (
sourceGitURL string
sourceGitBranch string
sourceGitTag string
sourceGitSemver string
sourceGitUsername string
sourceGitPassword string
sourceGitKeyAlgorithm flags.PublicKeyAlgorithm = "rsa"
sourceGitRSABits flags.RSAKeyBits = 2048
sourceGitECDSACurve = flags.ECDSACurve{Curve: elliptic.P384()}
sourceGitSecretRef string
)
var sourceGitArgs = newSourceGitFlags()
func init() {
createSourceGitCmd.Flags().StringVar(&sourceGitURL, "url", "", "git address, e.g. ssh://git@host/org/repository")
createSourceGitCmd.Flags().StringVar(&sourceGitBranch, "branch", "master", "git branch")
createSourceGitCmd.Flags().StringVar(&sourceGitTag, "tag", "", "git tag")
createSourceGitCmd.Flags().StringVar(&sourceGitSemver, "tag-semver", "", "git tag semver range")
createSourceGitCmd.Flags().StringVarP(&sourceGitUsername, "username", "u", "", "basic authentication username")
createSourceGitCmd.Flags().StringVarP(&sourceGitPassword, "password", "p", "", "basic authentication password")
createSourceGitCmd.Flags().Var(&sourceGitKeyAlgorithm, "ssh-key-algorithm", sourceGitKeyAlgorithm.Description())
createSourceGitCmd.Flags().Var(&sourceGitRSABits, "ssh-rsa-bits", sourceGitRSABits.Description())
createSourceGitCmd.Flags().Var(&sourceGitECDSACurve, "ssh-ecdsa-curve", sourceGitECDSACurve.Description())
createSourceGitCmd.Flags().StringVarP(&sourceGitSecretRef, "secret-ref", "", "", "the name of an existing secret containing SSH or basic credentials")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "", "git branch")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.refName, "ref-name", "", " git reference name")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.commit, "commit", "", "git commit")
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username")
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.password, "password", "p", "", "basic authentication password")
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyAlgorithm, "ssh-key-algorithm", sourceGitArgs.keyAlgorithm.Description())
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyRSABits, "ssh-rsa-bits", sourceGitArgs.keyRSABits.Description())
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyECDSACurve, "ssh-ecdsa-curve", sourceGitArgs.keyECDSACurve.Description())
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.privateKeyFile, "private-key-file", "", "path to a passwordless private key file used for authenticating to the Git SSH server")
createSourceGitCmd.Flags().BoolVar(&sourceGitArgs.recurseSubmodules, "recurse-submodules", false,
"when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces")
createSourceGitCmd.Flags().BoolVarP(&sourceGitArgs.silent, "silent", "s", false, "assumes the deploy key is already setup, skips confirmation")
createSourceGitCmd.Flags().StringSliceVar(&sourceGitArgs.ignorePaths, "ignore-paths", nil, "set paths to ignore in git resource (can specify multiple paths with commas: path1,path2)")
createSourceCmd.AddCommand(createSourceGitCmd)
}
func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("GitRepository source name is required")
func newSourceGitFlags() sourceGitFlags {
return sourceGitFlags{
keyAlgorithm: flags.PublicKeyAlgorithm(sourcesecret.ECDSAPrivateKeyAlgorithm),
keyRSABits: 2048,
keyECDSACurve: flags.ECDSACurve{Curve: elliptic.P384()},
}
}
func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
if sourceGitURL == "" {
if sourceGitArgs.url == "" {
return fmt.Errorf("url is required")
}
tmpDir, err := ioutil.TempDir("", name)
u, err := url.Parse(sourceGitArgs.url)
if err != nil {
return fmt.Errorf("git URL parse failed: %w", err)
}
if u.Scheme != "ssh" && u.Scheme != "http" && u.Scheme != "https" {
return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme)
}
if sourceGitArgs.branch == "" && sourceGitArgs.tag == "" && sourceGitArgs.semver == "" && sourceGitArgs.commit == "" && sourceGitArgs.refName == "" {
return fmt.Errorf("a Git ref is required, use one of the following: --branch, --tag, --commit, --ref-name or --tag-semver")
}
if sourceGitArgs.caFile != "" && u.Scheme == "ssh" {
return fmt.Errorf("specifying a CA file is not supported for Git over SSH")
}
tmpDir, err := os.MkdirTemp("", name)
if err != nil {
return err
}
defer os.RemoveAll(tmpDir)
u, err := url.Parse(sourceGitURL)
if err != nil {
return fmt.Errorf("git URL parse failed: %w", err)
}
sourceLabels, err := parseLabels()
if err != nil {
return err
}
var ignorePaths *string
if len(sourceGitArgs.ignorePaths) > 0 {
ignorePathsStr := strings.Join(sourceGitArgs.ignorePaths, "\n")
ignorePaths = &ignorePathsStr
}
gitRepository := sourcev1.GitRepository{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: sourcev1.GitRepositorySpec{
URL: sourceGitURL,
URL: sourceGitArgs.url,
Interval: metav1.Duration{
Duration: interval,
Duration: createArgs.interval,
},
Reference: &sourcev1.GitRepositoryRef{},
RecurseSubmodules: sourceGitArgs.recurseSubmodules,
Reference: &sourcev1.GitRepositoryRef{},
Ignore: ignorePaths,
},
}
if sourceGitSemver != "" {
gitRepository.Spec.Reference.SemVer = sourceGitSemver
} else if sourceGitTag != "" {
gitRepository.Spec.Reference.Tag = sourceGitTag
if createSourceArgs.fetchTimeout > 0 {
gitRepository.Spec.Timeout = &metav1.Duration{Duration: createSourceArgs.fetchTimeout}
}
if sourceGitArgs.commit != "" {
gitRepository.Spec.Reference.Commit = sourceGitArgs.commit
gitRepository.Spec.Reference.Branch = sourceGitArgs.branch
} else if sourceGitArgs.refName != "" {
gitRepository.Spec.Reference.Name = sourceGitArgs.refName
} else if sourceGitArgs.semver != "" {
gitRepository.Spec.Reference.SemVer = sourceGitArgs.semver
} else if sourceGitArgs.tag != "" {
gitRepository.Spec.Reference.Tag = sourceGitArgs.tag
} else {
gitRepository.Spec.Reference.Branch = sourceGitBranch
gitRepository.Spec.Reference.Branch = sourceGitArgs.branch
}
if export {
if sourceGitSecretRef != "" {
gitRepository.Spec.SecretRef = &corev1.LocalObjectReference{
Name: sourceGitSecretRef,
}
if sourceGitArgs.secretRef != "" {
gitRepository.Spec.SecretRef = &meta.LocalObjectReference{
Name: sourceGitArgs.secretRef,
}
return exportGit(gitRepository)
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
if createArgs.export {
return printExport(exportGit(&gitRepository))
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
withAuth := false
// TODO(hidde): move all auth prep to separate func?
if sourceGitSecretRef != "" {
withAuth = true
} else if u.Scheme == "ssh" {
logger.Actionf("generating deploy key pair")
pair, err := generateKeyPair(ctx)
if err != nil {
return err
}
fmt.Printf("%s", pair.PublicKey)
prompt := promptui.Prompt{
Label: "Have you added the deploy key to your repository",
IsConfirm: true,
}
if _, err := prompt.Run(); err != nil {
return fmt.Errorf("aborting")
}
logger.Actionf("collecting preferred public key from SSH server")
hostKey, err := scanHostKey(ctx, u)
if err != nil {
return err
}
logger.Successf("collected public key from SSH server:")
fmt.Printf("%s", hostKey)
logger.Actionf("applying secret with keys")
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
StringData: map[string]string{
"identity": string(pair.PrivateKey),
"identity.pub": string(pair.PublicKey),
"known_hosts": string(hostKey),
},
}
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return err
}
withAuth = true
} else if sourceGitUsername != "" && sourceGitPassword != "" {
logger.Actionf("applying secret with basic auth credentials")
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
StringData: map[string]string{
"username": sourceGitUsername,
"password": sourceGitPassword,
},
}
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
return err
}
withAuth = true
}
if withAuth {
logger.Successf("authentication configured")
}
logger.Generatef("generating GitRepository source")
if withAuth {
secretName := name
if sourceGitSecretRef != "" {
secretName = sourceGitSecretRef
if sourceGitArgs.secretRef == "" {
secretOpts := sourcesecret.Options{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
gitRepository.Spec.SecretRef = &corev1.LocalObjectReference{
Name: secretName,
switch u.Scheme {
case "ssh":
keypair, err := sourcesecret.LoadKeyPairFromPath(sourceGitArgs.privateKeyFile, sourceGitArgs.password)
if err != nil {
return err
}
secretOpts.Keypair = keypair
secretOpts.SSHHostname = u.Host
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(sourceGitArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(sourceGitArgs.keyRSABits)
secretOpts.ECDSACurve = sourceGitArgs.keyECDSACurve.Curve
secretOpts.Password = sourceGitArgs.password
case "https":
if sourceGitArgs.caFile != "" {
caBundle, err := os.ReadFile(sourceGitArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
secretOpts.CAFile = caBundle
}
secretOpts.Username = sourceGitArgs.username
secretOpts.Password = sourceGitArgs.password
case "http":
logger.Warningf("insecure configuration: credentials configured for an HTTP URL")
secretOpts.Username = sourceGitArgs.username
secretOpts.Password = sourceGitArgs.password
}
secret, err := sourcesecret.Generate(secretOpts)
if err != nil {
return err
}
var s corev1.Secret
if err = yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if len(s.StringData) > 0 {
if hk, ok := s.StringData[sourcesecret.KnownHostsSecretKey]; ok {
logger.Successf("collected public key from SSH server:\n%s", hk)
}
if ppk, ok := s.StringData[sourcesecret.PublicKeySecretKey]; ok {
logger.Generatef("deploy key: %s", ppk)
if !sourceGitArgs.silent {
prompt := promptui.Prompt{
Label: "Have you added the deploy key to your repository",
IsConfirm: true,
}
if _, err := prompt.Run(); err != nil {
return fmt.Errorf("aborting")
}
}
}
logger.Actionf("applying secret with repository credentials")
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
gitRepository.Spec.SecretRef = &meta.LocalObjectReference{
Name: s.Name,
}
logger.Successf("authentication configured")
}
}
@@ -267,8 +324,8 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for GitRepository source reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isGitRepositoryReady(ctx, kubeClient, namespacedName, &gitRepository)); err != nil {
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, &gitRepository)); err != nil {
return err
}
logger.Successf("GitRepository source reconciliation completed")
@@ -280,63 +337,6 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
return nil
}
func generateKeyPair(ctx context.Context) (*ssh.KeyPair, error) {
var keyGen ssh.KeyPairGenerator
switch algorithm := sourceGitKeyAlgorithm.String(); algorithm {
case "rsa":
keyGen = ssh.NewRSAGenerator(int(sourceGitRSABits))
case "ecdsa":
keyGen = ssh.NewECDSAGenerator(sourceGitECDSACurve.Curve)
case "ed25519":
keyGen = ssh.NewEd25519Generator()
default:
return nil, fmt.Errorf("unsupported public key algorithm: %s", algorithm)
}
pair, err := keyGen.Generate()
if err != nil {
return nil, fmt.Errorf("key pair generation failed, error: %w", err)
}
return pair, nil
}
func scanHostKey(ctx context.Context, url *url.URL) ([]byte, error) {
host := url.Host
if url.Port() == "" {
host = host + ":22"
}
hostKey, err := ssh.ScanHostKey(host, 30*time.Second)
if err != nil {
return nil, fmt.Errorf("SSH key scan for host %s failed, error: %w", host, err)
}
return hostKey, nil
}
func upsertSecret(ctx context.Context, kubeClient client.Client, secret corev1.Secret) error {
namespacedName := types.NamespacedName{
Namespace: secret.GetNamespace(),
Name: secret.GetName(),
}
var existing corev1.Secret
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
if err := kubeClient.Create(ctx, &secret); err != nil {
return err
} else {
return nil
}
}
return err
}
existing.StringData = secret.StringData
if err := kubeClient.Update(ctx, &existing); err != nil {
return err
}
return nil
}
func upsertGitRepository(ctx context.Context, kubeClient client.Client,
gitRepository *sourcev1.GitRepository) (types.NamespacedName, error) {
namespacedName := types.NamespacedName{
@@ -367,23 +367,3 @@ func upsertGitRepository(ctx context.Context, kubeClient client.Client,
logger.Successf("GitRepository source updated")
return namespacedName, nil
}
func isGitRepositoryReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, gitRepository *sourcev1.GitRepository) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, gitRepository)
if err != nil {
return false, err
}
if c := apimeta.FindStatusCondition(gitRepository.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

View File

@@ -0,0 +1,246 @@
//go:build unit
// +build unit
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"testing"
"time"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var pollInterval = 50 * time.Millisecond
var testTimeout = 10 * time.Second
// Update the GitRepository once created to exercise test specific behavior
type reconcileFunc func(repo *sourcev1.GitRepository)
// reconciler waits for an object to be created, then invokes a test supplied
// function to mutate that object, simulating a controller.
// Test should invoke run() to run the background reconciler task which
// polls to wait for the object to exist before applying the update function.
// Any errors from the reconciler are asserted on test completion.
type reconciler struct {
client client.Client
name types.NamespacedName
reconcile reconcileFunc
}
// Start the background task that waits for the object to exist then applies
// the update function.
func (r *reconciler) run(t *testing.T) {
result := make(chan error)
go func() {
defer close(result)
err := wait.PollImmediate(
pollInterval,
testTimeout,
r.conditionFunc)
result <- err
}()
t.Cleanup(func() {
if err := <-result; err != nil {
t.Errorf("Failure from test reconciler: '%v':", err.Error())
}
})
}
// A ConditionFunction that waits for the named GitRepository to be created,
// then sets the ready condition to true.
func (r *reconciler) conditionFunc() (bool, error) {
var repo sourcev1.GitRepository
if err := r.client.Get(context.Background(), r.name, &repo); err != nil {
if errors.IsNotFound(err) {
return false, nil // Keep polling until object is created
}
return true, err
}
r.reconcile(&repo)
err := r.client.Status().Update(context.Background(), &repo)
return true, err
}
func TestCreateSourceGitExport(t *testing.T) {
var command = "create source git podinfo --url=https://github.com/stefanprodan/podinfo --branch=master --ignore-paths .cosign,non-existent-dir/ -n default --interval 1m --export --timeout=" + testTimeout.String()
cases := []struct {
name string
args string
assert assertFunc
}{
{
"ExportSucceeded",
command,
assertGoldenFile("testdata/create_source_git/export.golden"),
},
{
name: "no args",
args: "create secret git",
assert: assertError("name is required"),
},
{
name: "source with commit",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --commit=c88a2f41 --interval=1m0s --export",
assert: assertGoldenFile("./testdata/create_source_git/source-git-commit.yaml"),
},
{
name: "source with ref name",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --ref-name=refs/heads/main --interval=1m0s --export",
assert: assertGoldenFile("testdata/create_source_git/source-git-refname.yaml"),
},
{
name: "source with branch name and commit",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --branch=main --commit=c88a2f41 --interval=1m0s --export",
assert: assertGoldenFile("testdata/create_source_git/source-git-branch-commit.yaml"),
},
{
name: "source with semver",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --tag-semver=v1.01 --interval=1m0s --export",
assert: assertGoldenFile("testdata/create_source_git/source-git-semver.yaml"),
},
{
name: "source with git tag",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --tag=test --interval=1m0s --export",
assert: assertGoldenFile("testdata/create_source_git/source-git-tag.yaml"),
},
{
name: "source with git branch",
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --branch=test --interval=1m0s --export",
assert: assertGoldenFile("testdata/create_source_git/source-git-branch.yaml"),
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tc.args,
assert: tc.assert,
}
cmd.runTestCmd(t)
})
}
}
func TestCreateSourceGit(t *testing.T) {
// Default command used for multiple tests
var command = "create source git podinfo --url=https://github.com/stefanprodan/podinfo --branch=master --timeout=" + testTimeout.String()
cases := []struct {
name string
args string
assert assertFunc
reconcile reconcileFunc
}{
{
"NoArgs",
"create source git",
assertError("name is required"),
nil,
}, {
"Succeeded",
command,
assertGoldenFile("testdata/create_source_git/success.golden"),
func(repo *sourcev1.GitRepository) {
newCondition := metav1.Condition{
Type: meta.ReadyCondition,
Status: metav1.ConditionTrue,
Reason: sourcev1.GitOperationSucceedReason,
Message: "succeeded message",
ObservedGeneration: repo.GetGeneration(),
}
apimeta.SetStatusCondition(&repo.Status.Conditions, newCondition)
repo.Status.Artifact = &sourcev1.Artifact{
Path: "some-path",
Revision: "v1",
LastUpdateTime: metav1.Time{
Time: time.Now(),
},
}
repo.Status.ObservedGeneration = repo.GetGeneration()
},
}, {
"Failed",
command,
assertError("failed message"),
func(repo *sourcev1.GitRepository) {
stalledCondition := metav1.Condition{
Type: meta.StalledCondition,
Status: metav1.ConditionTrue,
Reason: sourcev1.URLInvalidReason,
Message: "failed message",
ObservedGeneration: repo.GetGeneration(),
}
apimeta.SetStatusCondition(&repo.Status.Conditions, stalledCondition)
newCondition := metav1.Condition{
Type: meta.ReadyCondition,
Status: metav1.ConditionFalse,
Reason: sourcev1.URLInvalidReason,
Message: "failed message",
ObservedGeneration: repo.GetGeneration(),
}
apimeta.SetStatusCondition(&repo.Status.Conditions, newCondition)
repo.Status.ObservedGeneration = repo.GetGeneration()
},
}, {
"NoArtifact",
command,
assertError("GitRepository source reconciliation completed but no artifact was found"),
func(repo *sourcev1.GitRepository) {
// Updated with no artifact
newCondition := metav1.Condition{
Type: meta.ReadyCondition,
Status: metav1.ConditionTrue,
Reason: sourcev1.GitOperationSucceedReason,
Message: "succeeded message",
ObservedGeneration: repo.GetGeneration(),
}
apimeta.SetStatusCondition(&repo.Status.Conditions, newCondition)
repo.Status.ObservedGeneration = repo.GetGeneration()
},
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
ns := allocateNamespace("podinfo")
setupTestNamespace(ns, t)
if tc.reconcile != nil {
r := reconciler{
client: testEnv.client,
name: types.NamespacedName{Namespace: ns, Name: "podinfo"},
reconcile: tc.reconcile,
}
r.run(t)
}
cmd := cmdTestCase{
args: tc.args + " -n=" + ns,
assert: tc.assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -19,7 +19,6 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
@@ -27,72 +26,86 @@ import (
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
"github.com/fluxcd/flux2/internal/utils"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
)
var createSourceHelmCmd = &cobra.Command{
Use: "helm [name]",
Short: "Create or update a HelmRepository source",
Long: `
The create source helm command generates a HelmRepository resource and waits for it to fetch the index.
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.`,
Example: ` # Create a source from a public Helm repository
Long: withPreviewNote(`The create source helm command generates a HelmRepository resource and waits for it to fetch the index.
For private Helm repositories, the basic authentication credentials are stored in a Kubernetes secret.`),
Example: ` # Create a source for an HTTPS public Helm repository
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--interval=10m
# Create a source from a Helm repository using basic authentication
# Create a source for an HTTPS Helm repository using basic authentication
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--username=username \
--password=password
# Create a source from a Helm repository using TLS authentication
# Create a source for an HTTPS Helm repository using TLS authentication
flux create source helm podinfo \
--url=https://stefanprodan.github.io/podinfo \
--cert-file=./cert.crt \
--key-file=./key.crt \
--ca-file=./ca.crt
`,
# Create a source for an OCI Helm repository
flux create source helm podinfo \
--url=oci://ghcr.io/stefanprodan/charts/podinfo \
--username=username \
--password=password
# Create a source for an OCI Helm repository using an existing secret with basic auth or dockerconfig credentials
flux create source helm podinfo \
--url=oci://ghcr.io/stefanprodan/charts/podinfo \
--secret-ref=docker-config`,
RunE: createSourceHelmCmdRun,
}
var (
sourceHelmURL string
sourceHelmUsername string
sourceHelmPassword string
sourceHelmCertFile string
sourceHelmKeyFile string
sourceHelmCAFile string
sourceHelmSecretRef string
)
type sourceHelmFlags struct {
url string
username string
password string
certFile string
keyFile string
caFile string
secretRef string
ociProvider string
passCredentials bool
}
var sourceHelmArgs sourceHelmFlags
func init() {
createSourceHelmCmd.Flags().StringVar(&sourceHelmURL, "url", "", "Helm repository address")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmUsername, "username", "u", "", "basic authentication username")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmPassword, "password", "p", "", "basic authentication password")
createSourceHelmCmd.Flags().StringVar(&sourceHelmCertFile, "cert-file", "", "TLS authentication cert file path")
createSourceHelmCmd.Flags().StringVar(&sourceHelmKeyFile, "key-file", "", "TLS authentication key file path")
createSourceHelmCmd.Flags().StringVar(&sourceHelmCAFile, "ca-file", "", "TLS authentication CA file path")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmSecretRef, "secret-ref", "", "", "the name of an existing secret containing TLS or basic auth credentials")
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.url, "url", "", "Helm repository address")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmArgs.username, "username", "u", "", "basic authentication username")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmArgs.password, "password", "p", "", "basic authentication password")
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.certFile, "cert-file", "", "TLS authentication cert file path")
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.keyFile, "key-file", "", "TLS authentication key file path")
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.caFile, "ca-file", "", "TLS authentication CA file path")
createSourceHelmCmd.Flags().StringVarP(&sourceHelmArgs.secretRef, "secret-ref", "", "", "the name of an existing secret containing TLS, basic auth or docker-config credentials")
createSourceHelmCmd.Flags().StringVar(&sourceHelmArgs.ociProvider, "oci-provider", "", "OCI provider for authentication")
createSourceHelmCmd.Flags().BoolVarP(&sourceHelmArgs.passCredentials, "pass-credentials", "", false, "pass credentials to all domains")
createSourceCmd.AddCommand(createSourceHelmCmd)
}
func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("HelmRepository source name is required")
}
name := args[0]
if sourceHelmURL == "" {
if sourceHelmArgs.url == "" {
return fmt.Errorf("url is required")
}
@@ -101,95 +114,111 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
return err
}
tmpDir, err := ioutil.TempDir("", name)
tmpDir, err := os.MkdirTemp("", name)
if err != nil {
return err
}
defer os.RemoveAll(tmpDir)
if _, err := url.Parse(sourceHelmURL); err != nil {
if _, err := url.Parse(sourceHelmArgs.url); err != nil {
return fmt.Errorf("url parse failed: %w", err)
}
helmRepository := &sourcev1.HelmRepository{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: sourcev1.HelmRepositorySpec{
URL: sourceHelmURL,
URL: sourceHelmArgs.url,
Interval: metav1.Duration{
Duration: interval,
Duration: createArgs.interval,
},
},
}
if sourceHelmSecretRef != "" {
helmRepository.Spec.SecretRef = &corev1.LocalObjectReference{
Name: sourceHelmSecretRef,
url, err := url.Parse(sourceHelmArgs.url)
if err != nil {
return fmt.Errorf("failed to parse URL: %w", err)
}
if url.Scheme == sourcev1.HelmRepositoryTypeOCI {
helmRepository.Spec.Type = sourcev1.HelmRepositoryTypeOCI
helmRepository.Spec.Provider = sourceHelmArgs.ociProvider
}
if createSourceArgs.fetchTimeout > 0 {
helmRepository.Spec.Timeout = &metav1.Duration{Duration: createSourceArgs.fetchTimeout}
}
if sourceHelmArgs.secretRef != "" {
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
Name: sourceHelmArgs.secretRef,
}
helmRepository.Spec.PassCredentials = sourceHelmArgs.passCredentials
}
if export {
return exportHelmRepository(*helmRepository)
if createArgs.export {
return printExport(exportHelmRepository(helmRepository))
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
caBundle := []byte{}
if sourceHelmArgs.caFile != "" {
var err error
caBundle, err = os.ReadFile(sourceHelmArgs.caFile)
if err != nil {
return fmt.Errorf("unable to read TLS CA file: %w", err)
}
}
var certFile, keyFile []byte
if sourceHelmArgs.certFile != "" && sourceHelmArgs.keyFile != "" {
if certFile, err = os.ReadFile(sourceHelmArgs.certFile); err != nil {
return fmt.Errorf("failed to read cert file: %w", err)
}
if keyFile, err = os.ReadFile(sourceHelmArgs.keyFile); err != nil {
return fmt.Errorf("failed to read key file: %w", err)
}
}
logger.Generatef("generating HelmRepository source")
if sourceHelmSecretRef == "" {
if sourceHelmArgs.secretRef == "" {
secretName := fmt.Sprintf("helm-%s", name)
secret := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
Namespace: namespace,
},
StringData: map[string]string{},
secretOpts := sourcesecret.Options{
Name: secretName,
Namespace: *kubeconfigArgs.Namespace,
Username: sourceHelmArgs.username,
Password: sourceHelmArgs.password,
CAFile: caBundle,
CertFile: certFile,
KeyFile: keyFile,
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
if sourceHelmUsername != "" && sourceHelmPassword != "" {
secret.StringData["username"] = sourceHelmUsername
secret.StringData["password"] = sourceHelmPassword
secret, err := sourcesecret.Generate(secretOpts)
if err != nil {
return err
}
if sourceHelmCertFile != "" && sourceHelmKeyFile != "" {
cert, err := ioutil.ReadFile(sourceHelmCertFile)
if err != nil {
return fmt.Errorf("failed to read repository cert file '%s': %w", sourceHelmCertFile, err)
}
secret.StringData["certFile"] = string(cert)
key, err := ioutil.ReadFile(sourceHelmKeyFile)
if err != nil {
return fmt.Errorf("failed to read repository key file '%s': %w", sourceHelmKeyFile, err)
}
secret.StringData["keyFile"] = string(key)
var s corev1.Secret
if err = yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
return err
}
if sourceHelmCAFile != "" {
ca, err := ioutil.ReadFile(sourceHelmCAFile)
if err != nil {
return fmt.Errorf("failed to read repository CA file '%s': %w", sourceHelmCAFile, err)
}
secret.StringData["caFile"] = string(ca)
}
if len(secret.StringData) > 0 {
if len(s.StringData) > 0 {
logger.Actionf("applying secret with repository credentials")
if err := upsertSecret(ctx, kubeClient, secret); err != nil {
if err := upsertSecret(ctx, kubeClient, s); err != nil {
return err
}
helmRepository.Spec.SecretRef = &corev1.LocalObjectReference{
helmRepository.Spec.SecretRef = &meta.LocalObjectReference{
Name: secretName,
}
helmRepository.Spec.PassCredentials = sourceHelmArgs.passCredentials
logger.Successf("authentication configured")
}
}
@@ -201,12 +230,21 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
}
logger.Waitingf("waiting for HelmRepository source reconciliation")
if err := wait.PollImmediate(pollInterval, timeout,
isHelmRepositoryReady(ctx, kubeClient, namespacedName, helmRepository)); err != nil {
readyConditionFunc := isObjectReadyConditionFunc(kubeClient, namespacedName, helmRepository)
if helmRepository.Spec.Type == sourcev1.HelmRepositoryTypeOCI {
// HelmRepository type OCI is a static object.
readyConditionFunc = isStaticObjectReadyConditionFunc(kubeClient, namespacedName, helmRepository)
}
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true, readyConditionFunc); err != nil {
return err
}
logger.Successf("HelmRepository source reconciliation completed")
if helmRepository.Spec.Type == sourcev1.HelmRepositoryTypeOCI {
// OCI repos don't expose any artifact so we just return early here
return nil
}
if helmRepository.Status.Artifact == nil {
return fmt.Errorf("HelmRepository source reconciliation completed but no artifact was found")
}
@@ -244,28 +282,3 @@ func upsertHelmRepository(ctx context.Context, kubeClient client.Client,
logger.Successf("source updated")
return namespacedName, nil
}
func isHelmRepositoryReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, helmRepository *sourcev1.HelmRepository) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, helmRepository)
if err != nil {
return false, err
}
// Confirm the state we are observing is for the current generation
if helmRepository.Generation != helmRepository.Status.ObservedGeneration {
return false, nil
}
if c := apimeta.FindStatusCondition(helmRepository.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case metav1.ConditionTrue:
return true, nil
case metav1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}

View File

@@ -0,0 +1,81 @@
//go:build unit
// +build unit
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"testing"
)
func TestCreateSourceHelm(t *testing.T) {
tests := []struct {
name string
args string
resultFile string
assertFunc string
}{
{
name: "no args",
args: "create source helm",
resultFile: "name is required",
assertFunc: "assertError",
},
{
name: "OCI repo",
args: "create source helm podinfo --url=oci://ghcr.io/stefanprodan/charts/podinfo --interval 5m --export",
resultFile: "./testdata/create_source_helm/oci.golden",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "OCI repo with Secret ref",
args: "create source helm podinfo --url=oci://ghcr.io/stefanprodan/charts/podinfo --interval 5m --secret-ref=creds --export",
resultFile: "./testdata/create_source_helm/oci-with-secret.golden",
assertFunc: "assertGoldenTemplateFile",
},
{
name: "HTTPS repo",
args: "create source helm podinfo --url=https://stefanprodan.github.io/charts/podinfo --interval 5m --export",
resultFile: "./testdata/create_source_helm/https.golden",
assertFunc: "assertGoldenTemplateFile",
},
}
tmpl := map[string]string{
"fluxns": allocateNamespace("flux-system"),
}
setup(t, tmpl)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var assert assertFunc
switch tt.assertFunc {
case "assertGoldenTemplateFile":
assert = assertGoldenTemplateFile(tt.resultFile, tmpl)
case "assertError":
assert = assertError(tt.resultFile)
}
cmd := cmdTestCase{
args: tt.args + " -n " + tmpl["fluxns"],
assert: assert,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -0,0 +1,236 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"context"
"fmt"
"strings"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/v2/internal/flags"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var createSourceOCIRepositoryCmd = &cobra.Command{
Use: "oci [name]",
Short: "Create or update an OCIRepository",
Long: withPreviewNote(`The create source oci command generates an OCIRepository resource and waits for it to be ready.`),
Example: ` # Create an OCIRepository for a public container image
flux create source oci podinfo \
--url=oci://ghcr.io/stefanprodan/manifests/podinfo \
--tag=6.1.6 \
--interval=10m
`,
RunE: createSourceOCIRepositoryCmdRun,
}
type sourceOCIRepositoryFlags struct {
url string
tag string
semver string
digest string
secretRef string
serviceAccount string
certSecretRef string
verifyProvider flags.SourceOCIVerifyProvider
verifySecretRef string
ignorePaths []string
provider flags.SourceOCIProvider
insecure bool
}
var sourceOCIRepositoryArgs = newSourceOCIFlags()
func newSourceOCIFlags() sourceOCIRepositoryFlags {
return sourceOCIRepositoryFlags{
provider: flags.SourceOCIProvider(sourcev1.GenericOCIProvider),
}
}
func init() {
createSourceOCIRepositoryCmd.Flags().Var(&sourceOCIRepositoryArgs.provider, "provider", sourceOCIRepositoryArgs.provider.Description())
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.url, "url", "", "the OCI repository URL")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.tag, "tag", "", "the OCI artifact tag")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.semver, "tag-semver", "", "the OCI artifact tag semver range")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.digest, "digest", "", "the OCI artifact digest")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.secretRef, "secret-ref", "", "the name of the Kubernetes image pull secret (type 'kubernetes.io/dockerconfigjson')")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.serviceAccount, "service-account", "", "the name of the Kubernetes service account that refers to an image pull secret")
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.certSecretRef, "cert-ref", "", "the name of a secret to use for TLS certificates")
createSourceOCIRepositoryCmd.Flags().Var(&sourceOCIRepositoryArgs.verifyProvider, "verify-provider", sourceOCIRepositoryArgs.verifyProvider.Description())
createSourceOCIRepositoryCmd.Flags().StringVar(&sourceOCIRepositoryArgs.verifySecretRef, "verify-secret-ref", "", "the name of a secret to use for signature verification")
createSourceOCIRepositoryCmd.Flags().StringSliceVar(&sourceOCIRepositoryArgs.ignorePaths, "ignore-paths", nil, "set paths to ignore resources (can specify multiple paths with commas: path1,path2)")
createSourceOCIRepositoryCmd.Flags().BoolVar(&sourceOCIRepositoryArgs.insecure, "insecure", false, "for when connecting to a non-TLS registries over plain HTTP")
createSourceCmd.AddCommand(createSourceOCIRepositoryCmd)
}
func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
name := args[0]
if sourceOCIRepositoryArgs.url == "" {
return fmt.Errorf("url is required")
}
if sourceOCIRepositoryArgs.semver == "" && sourceOCIRepositoryArgs.tag == "" && sourceOCIRepositoryArgs.digest == "" {
return fmt.Errorf("--tag, --tag-semver or --digest is required")
}
sourceLabels, err := parseLabels()
if err != nil {
return err
}
var ignorePaths *string
if len(sourceOCIRepositoryArgs.ignorePaths) > 0 {
ignorePathsStr := strings.Join(sourceOCIRepositoryArgs.ignorePaths, "\n")
ignorePaths = &ignorePathsStr
}
repository := &sourcev1.OCIRepository{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: sourcev1.OCIRepositorySpec{
Provider: sourceOCIRepositoryArgs.provider.String(),
URL: sourceOCIRepositoryArgs.url,
Insecure: sourceOCIRepositoryArgs.insecure,
Interval: metav1.Duration{
Duration: createArgs.interval,
},
Reference: &sourcev1.OCIRepositoryRef{},
Ignore: ignorePaths,
},
}
if digest := sourceOCIRepositoryArgs.digest; digest != "" {
repository.Spec.Reference.Digest = digest
}
if semver := sourceOCIRepositoryArgs.semver; semver != "" {
repository.Spec.Reference.SemVer = semver
}
if tag := sourceOCIRepositoryArgs.tag; tag != "" {
repository.Spec.Reference.Tag = tag
}
if createSourceArgs.fetchTimeout > 0 {
repository.Spec.Timeout = &metav1.Duration{Duration: createSourceArgs.fetchTimeout}
}
if saName := sourceOCIRepositoryArgs.serviceAccount; saName != "" {
repository.Spec.ServiceAccountName = saName
}
if secretName := sourceOCIRepositoryArgs.secretRef; secretName != "" {
repository.Spec.SecretRef = &meta.LocalObjectReference{
Name: secretName,
}
}
if secretName := sourceOCIRepositoryArgs.certSecretRef; secretName != "" {
repository.Spec.CertSecretRef = &meta.LocalObjectReference{
Name: secretName,
}
}
if provider := sourceOCIRepositoryArgs.verifyProvider.String(); provider != "" {
repository.Spec.Verify = &sourcev1.OCIRepositoryVerification{
Provider: provider,
}
if secretName := sourceOCIRepositoryArgs.verifySecretRef; secretName != "" {
repository.Spec.Verify.SecretRef = &meta.LocalObjectReference{
Name: secretName,
}
}
} else if sourceOCIRepositoryArgs.verifySecretRef != "" {
return fmt.Errorf("a verification provider must be specified when a secret is specified")
}
if createArgs.export {
return printExport(exportOCIRepository(repository))
}
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
logger.Actionf("applying OCIRepository")
namespacedName, err := upsertOCIRepository(ctx, kubeClient, repository)
if err != nil {
return err
}
logger.Waitingf("waiting for OCIRepository reconciliation")
if err := wait.PollUntilContextTimeout(ctx, rootArgs.pollInterval, rootArgs.timeout, true,
isObjectReadyConditionFunc(kubeClient, namespacedName, repository)); err != nil {
return err
}
logger.Successf("OCIRepository reconciliation completed")
if repository.Status.Artifact == nil {
return fmt.Errorf("no artifact was found")
}
logger.Successf("fetched revision: %s", repository.Status.Artifact.Revision)
return nil
}
func upsertOCIRepository(ctx context.Context, kubeClient client.Client,
ociRepository *sourcev1.OCIRepository) (types.NamespacedName, error) {
namespacedName := types.NamespacedName{
Namespace: ociRepository.GetNamespace(),
Name: ociRepository.GetName(),
}
var existing sourcev1.OCIRepository
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
if err := kubeClient.Create(ctx, ociRepository); err != nil {
return namespacedName, err
} else {
logger.Successf("OCIRepository created")
return namespacedName, nil
}
}
return namespacedName, err
}
existing.Labels = ociRepository.Labels
existing.Spec = ociRepository.Spec
if err := kubeClient.Update(ctx, &existing); err != nil {
return namespacedName, err
}
ociRepository = &existing
logger.Successf("OCIRepository updated")
return namespacedName, nil
}

View File

@@ -0,0 +1,71 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"testing"
)
func TestCreateSourceOCI(t *testing.T) {
tests := []struct {
name string
args string
assertFunc assertFunc
}{
{
name: "NoArgs",
args: "create source oci",
assertFunc: assertError("name is required"),
},
{
name: "NoURL",
args: "create source oci podinfo",
assertFunc: assertError("url is required"),
},
{
name: "verify provider not specified",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --verify-secret-ref=cosign-pub",
assertFunc: assertError("a verification provider must be specified when a secret is specified"),
},
{
name: "export manifest",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --interval 10m --export",
assertFunc: assertGoldenFile("./testdata/oci/export.golden"),
},
{
name: "export manifest with secret",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --interval 10m --secret-ref=creds --export",
assertFunc: assertGoldenFile("./testdata/oci/export_with_secret.golden"),
},
{
name: "export manifest with verify secret",
args: "create source oci podinfo --url=oci://ghcr.io/stefanprodan/manifests/podinfo --tag=6.3.5 --interval 10m --verify-provider=cosign --verify-secret-ref=cosign-pub --export",
assertFunc: assertGoldenFile("./testdata/oci/export_with_verify_secret.golden"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := cmdTestCase{
args: tt.args,
assert: tt.assertFunc,
}
cmd.runTestCmd(t)
})
}
}

View File

@@ -21,7 +21,7 @@ import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/v2/internal/utils"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
@@ -37,9 +37,8 @@ import (
var createTenantCmd = &cobra.Command{
Use: "tenant",
Short: "Create or update a tenant",
Long: `
The create tenant command generates namespaces, service accounts and role bindings to limit the
reconcilers scope to the tenant namespaces.`,
Long: withPreviewNote(`The create tenant command generates namespaces, service accounts and role bindings to limit the
reconcilers scope to the tenant namespaces.`),
Example: ` # Create a tenant with access to a namespace
flux create tenant dev-team \
--with-namespace=frontend \
@@ -49,41 +48,38 @@ reconcilers scope to the tenant namespaces.`,
flux create tenant dev-team \
--with-namespace=frontend \
--with-namespace=backend \
--export > dev-team.yaml
`,
--export > dev-team.yaml`,
RunE: createTenantCmdRun,
}
const (
tenantLabel = "toolkit.fluxcd.io/tenant"
tenantRoleBinding = "gotk-reconciler"
tenantLabel = "toolkit.fluxcd.io/tenant"
)
var (
tenantNamespaces []string
tenantClusterRole string
)
type tenantFlags struct {
namespaces []string
clusterRole string
}
var tenantArgs tenantFlags
func init() {
createTenantCmd.Flags().StringSliceVar(&tenantNamespaces, "with-namespace", nil, "namespace belonging to this tenant")
createTenantCmd.Flags().StringVar(&tenantClusterRole, "cluster-role", "cluster-admin", "cluster role of the tenant role binding")
createTenantCmd.Flags().StringSliceVar(&tenantArgs.namespaces, "with-namespace", nil, "namespace belonging to this tenant")
createTenantCmd.Flags().StringVar(&tenantArgs.clusterRole, "cluster-role", "cluster-admin", "cluster role of the tenant role binding")
createCmd.AddCommand(createTenantCmd)
}
func createTenantCmdRun(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("tenant name is required")
}
tenant := args[0]
if err := validation.IsQualifiedName(tenant); len(err) > 0 {
return fmt.Errorf("invalid tenant name '%s': %v", tenant, err)
}
if tenantClusterRole == "" {
if tenantArgs.clusterRole == "" {
return fmt.Errorf("cluster-role is required")
}
if tenantNamespaces == nil {
if tenantArgs.namespaces == nil {
return fmt.Errorf("with-namespace is required")
}
@@ -91,7 +87,7 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
var accounts []corev1.ServiceAccount
var roleBindings []rbacv1.RoleBinding
for _, ns := range tenantNamespaces {
for _, ns := range tenantArgs.namespaces {
if err := validation.IsQualifiedName(ns); len(err) > 0 {
return fmt.Errorf("invalid namespace '%s': %v", ns, err)
}
@@ -123,31 +119,33 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
roleBinding := rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{
Name: tenantRoleBinding,
Name: fmt.Sprintf("%s-reconciler", tenant),
Namespace: ns,
Labels: objLabels,
},
Subjects: []rbacv1.Subject{
{
Kind: "User",
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
APIGroup: "rbac.authorization.k8s.io",
Kind: "User",
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
},
{
Kind: "ServiceAccount",
Name: tenant,
Kind: "ServiceAccount",
Name: tenant,
Namespace: ns,
},
},
RoleRef: rbacv1.RoleRef{
APIGroup: "rbac.authorization.k8s.io",
Kind: "ClusterRole",
Name: tenantClusterRole,
Name: tenantArgs.clusterRole,
},
}
roleBindings = append(roleBindings, roleBinding)
}
if export {
for i, _ := range tenantNamespaces {
if createArgs.export {
for i := range tenantArgs.namespaces {
if err := exportTenant(namespaces[i], accounts[i], roleBindings[i]); err != nil {
return err
}
@@ -155,15 +153,15 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
return nil
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(kubeconfig, kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
if err != nil {
return err
}
for i, _ := range tenantNamespaces {
for i := range tenantArgs.namespaces {
logger.Actionf("applying namespace %s", namespaces[i].Name)
if err := upsertNamespace(ctx, kubeClient, namespaces[i]); err != nil {
return err
@@ -290,7 +288,7 @@ func exportTenant(namespace corev1.Namespace, account corev1.ServiceAccount, rol
fmt.Println(resourceToString(data))
account.TypeMeta = metav1.TypeMeta{
APIVersion: "",
APIVersion: "v1",
Kind: "ServiceAccount",
}
data, err = yaml.Marshal(account)

55
cmd/flux/create_test.go Normal file
View File

@@ -0,0 +1,55 @@
package main
import (
"testing"
"k8s.io/apimachinery/pkg/util/rand"
)
func Test_validateObjectName(t *testing.T) {
tests := []struct {
name string
valid bool
}{
{
name: "flux-system",
valid: true,
},
{
name: "-flux-system",
valid: false,
},
{
name: "-flux-system-",
valid: false,
},
{
name: "third.first",
valid: false,
},
{
name: "THirdfirst",
valid: false,
},
{
name: "THirdfirst",
valid: false,
},
{
name: rand.String(63),
valid: true,
},
{
name: rand.String(64),
valid: false,
},
}
for _, tt := range tests {
valid := validateObjectName(tt.name)
if valid != tt.valid {
t.Errorf("expected name %q to return %t for validateObjectName func but got %t",
tt.name, tt.valid, valid)
}
}
}

Some files were not shown because too many files have changed in this diff Show More