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

Compare commits

..

45 Commits

Author SHA1 Message Date
Stefan Prodan
06ed49dcd3 Merge pull request #5642 from fluxcd/backport-5597-to-release/v2.7.x
[release/v2.7.x] Allow option to skip tenant namespace creation
2025-11-21 18:21:05 +02:00
Anshuman Singh
6021981de3 Allow option to skip tenant namespace creation
Add --skip-namespace flag to the 'create tenant' command to skip automatic
namespace creation when the namespace already exists.

Signed-off-by: Anshuman Singh <anshumanchauhan9@gmail.com>
(cherry picked from commit 0ba28f3f91)
2025-11-21 15:16:59 +00:00
Matheus Pimenta
4b7d46e511 Merge pull request #5640 from fluxcd/backport-5639-to-release/v2.7.x
[release/v2.7.x] Update toolkit components
2025-11-20 07:27:48 +00:00
fluxcdbot
e8c87047ba Update toolkit components
- helm-controller to v1.4.4
  https://github.com/fluxcd/helm-controller/blob/v1.4.4/CHANGELOG.md
- kustomize-controller to v1.7.3
  https://github.com/fluxcd/kustomize-controller/blob/v1.7.3/CHANGELOG.md
- source-controller to v1.7.4
  https://github.com/fluxcd/source-controller/blob/v1.7.4/CHANGELOG.md
- notification-controller to v1.7.5
  https://github.com/fluxcd/notification-controller/blob/v1.7.5/CHANGELOG.md
- image-reflector-controller to v1.0.4
  https://github.com/fluxcd/image-reflector-controller/blob/v1.0.4/CHANGELOG.md
- image-automation-controller to v1.0.4
  https://github.com/fluxcd/image-automation-controller/blob/v1.0.4/CHANGELOG.md
- source-watcher to v2.0.3
  https://github.com/fluxcd/source-watcher/blob/v2.0.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
(cherry picked from commit 6ecad4783f)
2025-11-20 07:17:31 +00:00
Matheus Pimenta
abd603eca7 Merge pull request #5635 from fluxcd/backport-5625-to-release/v2.7.x
[release/v2.7.x] diff: report if object is skipped
2025-11-19 08:32:34 +00:00
Lukas Hoehl
83d426c3c0 diff: report if object is skipped
Signed-off-by: Lukas Hoehl <lukas.hoehl@stackit.cloud>
(cherry picked from commit 5048de80f0)
2025-11-19 08:31:54 +00:00
Matheus Pimenta
48e77c820e Merge pull request #5634 from fluxcd/backport-5633-to-release/v2.7.x
[release/v2.7.x] Upgrade k8s to 1.34.2, c-r to 0.22.4 and helm to 3.19.2
2025-11-18 15:13:25 +00:00
Matheus Pimenta
01fbe37639 Upgrade k8s to 1.34.2, c-r to 0.22.4 and helm to 3.19.2
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit cfb28ffdc0)
2025-11-18 15:02:34 +00:00
Matheus Pimenta
532c121a26 Merge pull request #5631 from fluxcd/backport-5630-to-release/v2.7.x
[release/v2.7.x] Fix panic on reconcile with source of ExternalArtifact kind
2025-11-17 14:43:27 +00:00
Matheus Pimenta
4387e30d1f Fix panic on reconcile with source of ExternalArtifact kind
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 69feb7214a)
2025-11-17 14:32:51 +00:00
Matheus Pimenta
0f30cfb8b0 Merge pull request #5628 from fluxcd/backport-5627-to-release/v2.7.x
[release/v2.7.x] Add source.extensions.fluxcd.io group to aggregated RBAC roles
2025-11-13 12:58:07 +01:00
Matheus Pimenta
c69a5c5850 Add source.extensions.fluxcd.io group to aggregated RBAC roles
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 7c5f9befb4)
2025-11-13 11:57:03 +00:00
Stefan Prodan
0b51c7443e Merge pull request #5615 from fluxcd/backport-5614-to-release/v2.7.x
[release/v2.7.x] ci: Include source-watcher in the e2e test suite
2025-11-01 12:19:21 +02:00
Stefan Prodan
5aa89ab42b ci: Include source-watcher in the e2e test suite
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 833815c71d)
2025-11-01 09:46:46 +00:00
Matheus Pimenta
b6e76ca253 Merge pull request #5606 from fluxcd/backport-5602-to-release/v2.7.x
[release/v2.7.x] fix: return accepted values for flags when calling Values.Type()
2025-10-28 14:19:28 +00:00
Jesper Axelsen
e084250147 fix: return supported values for flags when calling Values.Type()
Signed-off-by: Jesper Axelsen <jesperbaxelsen@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 28f5b553a2)
2025-10-28 14:09:35 +00:00
Matheus Pimenta
c3bc3d59b3 Merge pull request #5605 from fluxcd/backport-5603-to-release/v2.7.x
[release/v2.7.x] Update toolkit components
2025-10-28 13:29:26 +00:00
Matheus Pimenta
1295ba285e Fix bootstrap e2e test for image policy
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit d8c6ee167c)
2025-10-28 13:17:20 +00:00
fluxcdbot
41ebc0e0f9 Update toolkit components
- helm-controller to v1.4.3
  https://github.com/fluxcd/helm-controller/blob/v1.4.3/CHANGELOG.md
- kustomize-controller to v1.7.2
  https://github.com/fluxcd/kustomize-controller/blob/v1.7.2/CHANGELOG.md
- source-controller to v1.7.3
  https://github.com/fluxcd/source-controller/blob/v1.7.3/CHANGELOG.md
- notification-controller to v1.7.4
  https://github.com/fluxcd/notification-controller/blob/v1.7.4/CHANGELOG.md
- image-reflector-controller to v1.0.3
  https://github.com/fluxcd/image-reflector-controller/blob/v1.0.3/CHANGELOG.md
- image-automation-controller to v1.0.3
  https://github.com/fluxcd/image-automation-controller/blob/v1.0.3/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
(cherry picked from commit e288cb2771)
2025-10-28 13:17:20 +00:00
Matheus Pimenta
67d2fb09a4 Merge pull request #5595 from fluxcd/backport-5594-to-release/v2.7.x
[release/v2.7.x] Pin cosign to v2.6.1
2025-10-20 15:55:37 +01:00
Matheus Pimenta
888e8a9aff Pin cosign to v2.6.1
xref: https://github.com/fluxcd/source-controller/issues/1923
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 8229ffb674)
2025-10-20 14:54:57 +00:00
Matheus Pimenta
4a15fa6a02 Merge pull request #5579 from fluxcd/backport-5578-to-release/v2.7.x
[release/v2.7.x] Update toolkit components
2025-10-08 18:59:52 +01:00
fluxcdbot
6adffe74c4 Update toolkit components
- helm-controller to v1.4.2
  https://github.com/fluxcd/helm-controller/blob/v1.4.2/CHANGELOG.md
- kustomize-controller to v1.7.1
  https://github.com/fluxcd/kustomize-controller/blob/v1.7.1/CHANGELOG.md
- source-controller to v1.7.2
  https://github.com/fluxcd/source-controller/blob/v1.7.2/CHANGELOG.md
- notification-controller to v1.7.3
  https://github.com/fluxcd/notification-controller/blob/v1.7.3/CHANGELOG.md
- image-reflector-controller to v1.0.2
  https://github.com/fluxcd/image-reflector-controller/blob/v1.0.2/CHANGELOG.md
- image-automation-controller to v1.0.2
  https://github.com/fluxcd/image-automation-controller/blob/v1.0.2/CHANGELOG.md
- source-watcher to v2.0.2
  https://github.com/fluxcd/source-watcher/blob/v2.0.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
(cherry picked from commit 058525fe37)
2025-10-08 17:53:43 +00:00
Matheus Pimenta
e8213d75a6 Merge pull request #5577 from fluxcd/backport-5576-to-release/v2.7.x
[release/v2.7.x] Update dependencies to Kubernetes v1.34.1 and Go 1.25.2
2025-10-08 17:41:42 +01:00
Stefan Prodan
ddd9ef9d13 Update dependencies to Kubernetes v1.34.1 and Go 1.25.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 767f235f94)
2025-10-08 16:26:27 +00:00
Stefan Prodan
f3cc58037a Merge pull request #5575 from fluxcd/backport-5574-to-release/v2.7.x
[release/v2.7.x] Fix manifest generation for `--storage-adv-addr` and `--events-addr` flags
2025-10-08 11:43:13 +03:00
Stefan Prodan
bb9b4e8533 Use RUNTIME_NAMESPACE when setting --events-addr
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit f2ff083b8e)
2025-10-08 07:59:54 +00:00
Stefan Prodan
6bb4aeff95 Fix --storage-adv-addr for source-watcher
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 8c45f25f33)
2025-10-08 07:59:54 +00:00
Stefan Prodan
ca29bb1a41 Merge pull request #5571 from fluxcd/backport-5570-to-release/v2.7.x
[release/v2.7.x] Disable AUR publishing
2025-10-06 18:47:00 +03:00
Stefan Prodan
c707c3ae7b Disable AUR publishing
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 71a3dad213)
2025-10-06 15:46:17 +00:00
Matheus Pimenta
53552c8816 Merge pull request #5569 from fluxcd/backport-5568-to-release/v2.7.x
[release/v2.7.x] Update toolkit components
2025-10-06 12:56:14 +01:00
fluxcdbot
fb8f2508d1 Update toolkit components
- helm-controller to v1.4.1
  https://github.com/fluxcd/helm-controller/blob/v1.4.1/CHANGELOG.md
- source-controller to v1.7.1
  https://github.com/fluxcd/source-controller/blob/v1.7.1/CHANGELOG.md
- notification-controller to v1.7.2
  https://github.com/fluxcd/notification-controller/blob/v1.7.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
(cherry picked from commit 4f2d1c3a2a)
2025-10-06 11:55:26 +00:00
Matheus Pimenta
de92e95a50 Merge pull request #5564 from fluxcd/backport-5563-to-release/v2.7.x
[release/v2.7.x] Fix `flux migrate -f` not considering kind comments
2025-10-04 16:34:21 +01:00
Matheus Pimenta
b398208c7e Fix flux migrate -f not considering kind comments
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 7c5fb2297c)
2025-10-04 15:33:47 +00:00
Matheus Pimenta
8d0001f5b6 Merge pull request #5561 from fluxcd/backport-5560-to-release/v2.7.x
[release/v2.7.x] Fix `flux migrate -f` command to work with comments
2025-10-03 15:46:16 +01:00
Matheus Pimenta
a2ff6c601e Fix migrate -f command to work with comments
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 83213ce83f)
2025-10-03 14:45:24 +00:00
Stefan Prodan
4accd37c1a Merge pull request #5559 from fluxcd/backport-5558-to-release/v2.7.x
[release/v2.7.x] Improve `flux migrate` for live cluster migrations
2025-10-03 16:53:50 +03:00
Stefan Prodan
742baa62d1 Improve flux migrate for live cluster migrations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit 0255957dd7)
2025-10-03 13:52:54 +00:00
Stefan Prodan
784a62c6a5 Merge pull request #5557 from fluxcd/backport-5554-to-release/v2.7.x
[release/v2.7.x] Extend `flux migrate` to work with local files
2025-10-03 11:56:56 +03:00
Matheus Pimenta
0bcccb2482 Extend flux migrate to work with local files
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit a9b5be7ff4)
2025-10-03 08:50:00 +00:00
Matheus Pimenta
17dae751a2 Merge pull request #5553 from fluxcd/backport-5551-to-release/v2.7.x
[release/v2.7.x] Fix `flux push artifact` not working with `--provider`
2025-10-01 10:51:22 +01:00
Matheus Pimenta
93a87240b0 Fix flux push artifact not working with --provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 039d79b3c2)
2025-10-01 09:39:54 +00:00
Stefan Prodan
9c66b0d752 Merge pull request #5552 from fluxcd/backport-ci-prs
Backport CI fixes and updates
2025-10-01 11:47:26 +03:00
dependabot[bot]
9fc6853024 build(deps): bump the ci group across 1 directory with 3 updates
Bumps the ci group with 3 updates in the / directory: [docker/login-action](https://github.com/docker/login-action), [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `docker/login-action` from 3.5.0 to 3.6.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](184bdaa072...5e57cd1181)

Updates `ossf/scorecard-action` from 2.4.2 to 2.4.3
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](05b42c6244...4eaacf0543)

Updates `github/codeql-action` from 3.30.3 to 3.30.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](192325c861...3599b3baa1)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
- dependency-name: github/codeql-action
  dependency-version: 3.30.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ci
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:35:06 +01:00
Stefan Prodan
22a8310b0a ci: Set GITHUB_TOKEN in the release-flux-manifests workflow
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-10-01 09:34:46 +01:00
17 changed files with 38 additions and 304 deletions

6
.github/labels.yaml vendored
View File

@@ -44,12 +44,12 @@
description: Feature request proposals in the RFC format
color: '#D621C3'
aliases: ['area/RFC']
- name: backport:release/v2.4.x
description: To be backported to release/v2.4.x
color: '#ffd700'
- name: backport:release/v2.5.x
description: To be backported to release/v2.5.x
color: '#ffd700'
- name: backport:release/v2.6.x
description: To be backported to release/v2.6.x
color: '#ffd700'
- name: backport:release/v2.7.x
description: To be backported to release/v2.7.x
color: '#ffd700'

View File

@@ -10,4 +10,4 @@ jobs:
pull-requests: write # for creating pull requests against release branches.
uses: fluxcd/gha-workflows/.github/workflows/backport.yaml@v0.4.0
secrets:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -49,8 +49,7 @@ you might want to take a look at the [introductory talk and demo](https://www.yo
This project is composed of:
- [flux2](https://github.com/fluxcd/flux2): The Flux CLI
- [source-controller](https://github.com/fluxcd/source-controller): Kubernetes operator for managing sources (Git, OCI and Helm repositories, S3-compatible Buckets)
- [source-watcher](https://github.com/fluxcd/source-watcher): Kubernetes operator for advanced source composition and decomposition patterns
- [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
@@ -68,9 +67,10 @@ for source changes.
Prerequisites:
* go >= 1.25
* go >= 1.24
* kubectl >= 1.30
* 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:

View File

@@ -52,14 +52,12 @@ guides](https://fluxcd.io/flux/gitops-toolkit/source-watcher/).
### Components
- [Source Controllers](https://fluxcd.io/flux/components/source/)
- [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/)
- [ExternalArtifact CRD](https://fluxcd.io/flux/components/source/externalartifacts/)
- [ArtifactGenerator CRD](https://fluxcd.io/flux/components/source/artifactgenerators/)
- [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/)

View File

@@ -1,84 +0,0 @@
/*
Copyright 2025 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"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)
var exportSourceExternalCmd = &cobra.Command{
Use: "external [name]",
Short: "Export ExternalArtifact sources in YAML format",
Long: "The export source external command exports one or all ExternalArtifact sources in YAML format.",
Example: ` # Export all ExternalArtifact sources
flux export source external --all > sources.yaml
# Export a specific ExternalArtifact
flux export source external my-artifact > source.yaml`,
ValidArgsFunction: resourceNamesCompletionFunc(sourcev1.GroupVersion.WithKind(sourcev1.ExternalArtifactKind)),
RunE: exportWithSecretCommand{
list: externalArtifactListAdapter{&sourcev1.ExternalArtifactList{}},
object: externalArtifactAdapter{&sourcev1.ExternalArtifact{}},
}.run,
}
func init() {
exportSourceCmd.AddCommand(exportSourceExternalCmd)
}
func exportExternalArtifact(source *sourcev1.ExternalArtifact) any {
gvk := sourcev1.GroupVersion.WithKind(sourcev1.ExternalArtifactKind)
export := sourcev1.ExternalArtifact{
TypeMeta: metav1.TypeMeta{
Kind: gvk.Kind,
APIVersion: gvk.GroupVersion().String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: source.Name,
Namespace: source.Namespace,
Labels: source.Labels,
Annotations: source.Annotations,
},
Spec: source.Spec,
}
return export
}
func getExternalArtifactSecret(source *sourcev1.ExternalArtifact) *types.NamespacedName {
// ExternalArtifact does not have a secretRef in its spec, this satisfies the interface
return nil
}
func (ex externalArtifactAdapter) secret() *types.NamespacedName {
return getExternalArtifactSecret(ex.ExternalArtifact)
}
func (ex externalArtifactListAdapter) secretItem(i int) *types.NamespacedName {
return getExternalArtifactSecret(&ex.ExternalArtifactList.Items[i])
}
func (ex externalArtifactAdapter) export() any {
return exportExternalArtifact(ex.ExternalArtifact)
}
func (ex externalArtifactListAdapter) exportItem(i int) any {
return exportExternalArtifact(&ex.ExternalArtifactList.Items[i])
}

View File

@@ -110,12 +110,6 @@ func TestExport(t *testing.T) {
"testdata/export/bucket.yaml",
tmpl,
},
{
"source external",
"export source external flux-system",
"testdata/export/external-artifact.yaml",
tmpl,
},
}
for _, tt := range cases {

View File

@@ -59,10 +59,6 @@ var getSourceAllCmd = &cobra.Command{
apiType: helmChartType,
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
},
{
apiType: externalArtifactType,
list: &externalArtifactListAdapter{&sourcev1.ExternalArtifactList{}},
},
}
for _, c := range allSourceCmd {

View File

@@ -1,108 +0,0 @@
/*
Copyright 2025 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"
"k8s.io/apimachinery/pkg/runtime"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/fluxcd/flux2/v2/internal/utils"
)
var getSourceExternalCmd = &cobra.Command{
Use: "external",
Short: "Get ExternalArtifact source statuses",
Long: `The get sources external command prints the status of the ExternalArtifact sources.`,
Example: ` # List all ExternalArtifacts and their status
flux get sources external
# List ExternalArtifacts from all namespaces
flux get sources external --all-namespaces`,
ValidArgsFunction: resourceNamesCompletionFunc(sourcev1.GroupVersion.WithKind(sourcev1.ExternalArtifactKind)),
RunE: func(cmd *cobra.Command, args []string) error {
get := getCommand{
apiType: externalArtifactType,
list: &externalArtifactListAdapter{&sourcev1.ExternalArtifactList{}},
funcMap: make(typeMap),
}
err := get.funcMap.registerCommand(get.apiType.kind, func(obj runtime.Object) (summarisable, error) {
o, ok := obj.(*sourcev1.ExternalArtifact)
if !ok {
return nil, fmt.Errorf("impossible to cast type %#v to ExternalArtifact", obj)
}
sink := &externalArtifactListAdapter{&sourcev1.ExternalArtifactList{
Items: []sourcev1.ExternalArtifact{
*o,
}}}
return sink, nil
})
if err != nil {
return err
}
if err := get.run(cmd, args); err != nil {
return err
}
return nil
},
}
func init() {
getSourceCmd.AddCommand(getSourceExternalCmd)
}
func (a *externalArtifactListAdapter) summariseItem(i int, includeNamespace bool, includeKind bool) []string {
item := a.Items[i]
var revision string
if item.Status.Artifact != nil {
revision = item.Status.Artifact.Revision
}
status, msg := statusAndMessage(item.Status.Conditions)
revision = utils.TruncateHex(revision)
msg = utils.TruncateHex(msg)
var source string
if item.Spec.SourceRef != nil {
source = fmt.Sprintf("%s/%s/%s",
item.Spec.SourceRef.Kind,
item.Spec.SourceRef.Namespace,
item.Spec.SourceRef.Name)
}
return append(nameColumns(&item, includeNamespace, includeKind),
revision, source, status, msg)
}
func (a externalArtifactListAdapter) headers(includeNamespace bool) []string {
headers := []string{"Name", "Revision", "Source", "Ready", "Message"}
if includeNamespace {
headers = append([]string{"Namespace"}, headers...)
}
return headers
}
func (a externalArtifactListAdapter) statusSelectorMatches(i int, conditionType, conditionStatus string) bool {
item := a.Items[i]
return statusMatches(conditionType, conditionStatus, item.Status.Conditions)
}

View File

@@ -180,7 +180,7 @@ func main() {
// This is required because controller-runtime expects its consumers to
// set a logger through log.SetLogger within 30 seconds of the program's
// initialization. If not set, the entire debug stack is printed as an
// initalization. If not set, the entire debug stack is printed as an
// error, see: 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.
@@ -225,9 +225,7 @@ func configureDefaultNamespace() {
func readPasswordFromStdin(prompt string) (string, error) {
var out string
var err error
if _, err := fmt.Fprint(os.Stdout, prompt); err != nil {
return "", fmt.Errorf("failed to write prompt: %w", err)
}
fmt.Fprint(os.Stdout, prompt)
stdinFD := int(os.Stdin.Fd())
if term.IsTerminal(stdinFD) {
var inBytes []byte

View File

@@ -195,37 +195,3 @@ func (a helmRepositoryListAdapter) asClientList() client.ObjectList {
func (a helmRepositoryListAdapter) len() int {
return len(a.HelmRepositoryList.Items)
}
// sourcev1.ExternalArtifact
var externalArtifactType = apiType{
kind: sourcev1.ExternalArtifactKind,
humanKind: "source external-artifact",
groupVersion: sourcev1.GroupVersion,
}
type externalArtifactAdapter struct {
*sourcev1.ExternalArtifact
}
func (a externalArtifactAdapter) asClientObject() client.Object {
return a.ExternalArtifact
}
func (a externalArtifactAdapter) deepCopyClientObject() client.Object {
return a.ExternalArtifact.DeepCopy()
}
// sourcev1.ExternalArtifactList
type externalArtifactListAdapter struct {
*sourcev1.ExternalArtifactList
}
func (a externalArtifactListAdapter) asClientList() client.ObjectList {
return a.ExternalArtifactList
}
func (a externalArtifactListAdapter) len() int {
return len(a.ExternalArtifactList.Items)
}

View File

@@ -1,12 +0,0 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: ExternalArtifact
metadata:
name: flux-system
namespace: {{ .fluxns }}
spec:
sourceRef:
apiVersion: source.example.com/v1alpha1
kind: GitHubRelease
name: flux-system
namespace: {{ .fluxns }}

View File

@@ -165,15 +165,3 @@ spec:
endpoint: s3.amazonaws.com
region: us-east-1
timeout: 30s
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: ExternalArtifact
metadata:
name: flux-system
namespace: {{ .fluxns }}
spec:
sourceRef:
apiVersion: source.example.com/v1alpha1
kind: GitHubRelease
name: flux-system
namespace: {{ .fluxns }}

4
go.mod
View File

@@ -12,7 +12,7 @@ require (
github.com/distribution/distribution/v3 v3.0.0
github.com/fluxcd/cli-utils v0.36.0-flux.15
github.com/fluxcd/go-git-providers v0.25.0
github.com/fluxcd/helm-controller/api v1.4.5
github.com/fluxcd/helm-controller/api v1.4.4
github.com/fluxcd/image-automation-controller/api v1.0.4
github.com/fluxcd/image-reflector-controller/api v1.0.4
github.com/fluxcd/kustomize-controller/api v1.7.3
@@ -51,7 +51,7 @@ require (
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/spf13/cobra v1.10.1
github.com/theckman/yacspin v0.13.12
golang.org/x/crypto v0.45.0
golang.org/x/crypto v0.44.0
golang.org/x/term v0.37.0
golang.org/x/text v0.31.0
k8s.io/api v0.34.2

8
go.sum
View File

@@ -174,8 +174,8 @@ github.com/fluxcd/gitkit v0.6.0 h1:iNg5LTx6ePo+Pl0ZwqHTAkhbUHxGVSY3YCxCdw7VIFg=
github.com/fluxcd/gitkit v0.6.0/go.mod h1:svOHuKi0fO9HoawdK4HfHAJJseZDHHjk7I3ihnCIqNo=
github.com/fluxcd/go-git-providers v0.25.0 h1:zkVgujjo2VjKXbucrlTyNhHd9x+27oqyghJX9uLwQv4=
github.com/fluxcd/go-git-providers v0.25.0/go.mod h1:8Mx5WRYb61FIjOA26DAi4Ls2rZUHSxP8Nl9qkQHDch8=
github.com/fluxcd/helm-controller/api v1.4.5 h1:hMEBtgXUbJjp+ah0jPI3OOQNVngoToOQvTgFgVpAjNg=
github.com/fluxcd/helm-controller/api v1.4.5/go.mod h1:rCgx3qhjjtoIH+1EbzFC2vN71/pp0PgMDrZnGCZX5XY=
github.com/fluxcd/helm-controller/api v1.4.4 h1:3IFAvJxOBaF2xXItUynqlbgw/2YzTjkL/iBiubxqcHk=
github.com/fluxcd/helm-controller/api v1.4.4/go.mod h1:rCgx3qhjjtoIH+1EbzFC2vN71/pp0PgMDrZnGCZX5XY=
github.com/fluxcd/image-automation-controller/api v1.0.4 h1:Fgdy97hXkyh/JFjxLIyq4ZDHsKsa49aumtrvIyjVd08=
github.com/fluxcd/image-automation-controller/api v1.0.4/go.mod h1:LLBf4XQJAgnpIMlZUwfpVIkCdUtBOi31B6fDbPwBCq4=
github.com/fluxcd/image-reflector-controller/api v1.0.4 h1:/JGpTZf4eMcKG2FpWfP5H7SneSrD5P8EvwGnHiH/WLY=
@@ -645,8 +645,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=

View File

@@ -520,32 +520,30 @@ func (b *Builder) do(ctx context.Context, kustomization kustomizev1.Kustomizatio
return nil, fmt.Errorf("kustomize build failed: %w", err)
}
if kustomization.Spec.PostBuild == nil {
return m, nil
}
data, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&kustomization)
if err != nil {
return nil, err
}
for _, res := range m.Resources() {
// run variable substitutions
outRes, err := kustomize.SubstituteVariables(ctx,
b.client,
unstructured.Unstructured{Object: data},
res,
kustomize.SubstituteWithDryRun(b.dryRun),
kustomize.SubstituteWithStrict(b.strictSubst),
)
if err != nil {
return nil, fmt.Errorf("var substitution failed for '%s': %w", res.GetName(), err)
}
if outRes != nil {
_, err = m.Replace(res)
if kustomization.Spec.PostBuild != nil {
data, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&kustomization)
if err != nil {
return nil, err
}
outRes, err := kustomize.SubstituteVariables(ctx,
b.client,
unstructured.Unstructured{Object: data},
res,
kustomize.SubstituteWithDryRun(b.dryRun),
kustomize.SubstituteWithStrict(b.strictSubst),
)
if err != nil {
return nil, fmt.Errorf("var substitution failed for '%s': %w", res.GetName(), err)
}
if outRes != nil {
_, err = m.Replace(res)
if err != nil {
return nil, err
}
}
}
}

View File

@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.5/helm-controller.crds.yaml
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.5/helm-controller.deployment.yaml
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.4/helm-controller.crds.yaml
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.4/helm-controller.deployment.yaml
- account.yaml
transformers:
- labels.yaml

View File

@@ -3,7 +3,7 @@ kind: Kustomization
resources:
- https://github.com/fluxcd/source-controller/releases/download/v1.7.4/source-controller.crds.yaml
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.7.3/kustomize-controller.crds.yaml
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.5/helm-controller.crds.yaml
- https://github.com/fluxcd/helm-controller/releases/download/v1.4.4/helm-controller.crds.yaml
- https://github.com/fluxcd/notification-controller/releases/download/v1.7.5/notification-controller.crds.yaml
- https://github.com/fluxcd/image-reflector-controller/releases/download/v1.0.4/image-reflector-controller.crds.yaml
- https://github.com/fluxcd/image-automation-controller/releases/download/v1.0.4/image-automation-controller.crds.yaml