Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Flux v2.0.0-rc.1 #3758

Merged
merged 11 commits into from
Apr 6, 2023
2 changes: 1 addition & 1 deletion .github/workflows/e2e-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: e2e-arm64
on:
workflow_dispatch:
push:
branches: [ main, update-components, e2e-arm64* ]
branches: [ main, update-components, release-* ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: e2e-bootstrap
on:
workflow_dispatch:
push:
branches: [ main ]
branches: [ main, release-* ]
pull_request:
branches: [ main ]
branches: [ main, release-* ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: e2e
on:
workflow_dispatch:
push:
branches: [ main ]
branches: [ main, release-* ]
pull_request:
branches: [ main, oci ]
branches: [ main, release-* ]

permissions:
contents: read
Expand Down
8 changes: 4 additions & 4 deletions cmd/flux/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

"github.com/spf13/cobra"

"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
"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{
Expand Down
16 changes: 8 additions & 8 deletions cmd/flux/bootstrap_bitbucket_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"

"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/bootstrap"
"github.com/fluxcd/flux2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
"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/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{
Expand Down
14 changes: 7 additions & 7 deletions cmd/flux/bootstrap_git.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import (
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"

"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/bootstrap"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
"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/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"
)
Expand Down
16 changes: 8 additions & 8 deletions cmd/flux/bootstrap_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"

"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/bootstrap"
"github.com/fluxcd/flux2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
"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/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{
Expand Down
16 changes: 8 additions & 8 deletions cmd/flux/bootstrap_gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import (
"github.com/fluxcd/pkg/git/gogit"
"github.com/spf13/cobra"

"github.com/fluxcd/flux2/internal/flags"
"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/bootstrap"
"github.com/fluxcd/flux2/pkg/bootstrap/provider"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
"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/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{
Expand Down
2 changes: 1 addition & 1 deletion cmd/flux/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
var buildCmd = &cobra.Command{
Use: "build",
Short: "Build a flux resource",
Long: "The build command is used to build flux resources.",
Long: `The build command is used to build flux resources.`,
}

func init() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/flux/build_artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import (
var buildArtifactCmd = &cobra.Command{
Use: "artifact",
Short: "Build artifact",
Long: `The build artifact command creates a tgz file with the manifests from the given directory or a single manifest file.`,
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

Expand Down
15 changes: 11 additions & 4 deletions cmd/flux/build_kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import (
"os"
"os/signal"

"github.com/fluxcd/pkg/ssa"
"github.com/spf13/cobra"

"github.com/fluxcd/flux2/internal/build"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

"github.com/fluxcd/flux2/v2/internal/build"
)

var buildKsCmd = &cobra.Command{
Expand Down Expand Up @@ -114,12 +116,17 @@ func buildKsCmdRun(cmd *cobra.Command, args []string) (err error) {

errChan := make(chan error)
go func() {
manifests, err := builder.Build()
objects, err := builder.Build()
if err != nil {
errChan <- err
}

manifests, err := ssa.ObjectsToYAML(objects)
if err != nil {
errChan <- err
}

cmd.Print(string(manifests))
cmd.Print(manifests)
errChan <- nil
}()

Expand Down
2 changes: 1 addition & 1 deletion cmd/flux/build_kustomization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestBuildKustomization(t *testing.T) {
}

func TestBuildLocalKustomization(t *testing.T) {
podinfo := `apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
podinfo := `apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
Expand Down
12 changes: 6 additions & 6 deletions cmd/flux/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ import (

"github.com/fluxcd/pkg/version"

"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/pkg/manifestgen"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
"github.com/fluxcd/flux2/pkg/status"
"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

Expand Down
2 changes: 1 addition & 1 deletion cmd/flux/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"testing"

"github.com/fluxcd/flux2/internal/utils"
"github.com/fluxcd/flux2/v2/internal/utils"
)

func TestCheckPre(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/flux/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"strings"

"github.com/fluxcd/flux2/internal/utils"
"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"
Expand All @@ -31,7 +31,7 @@ import (
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() {
Expand Down
1 change: 1 addition & 0 deletions cmd/flux/completion_bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmd/flux/completion_fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
var completionFishCmd = &cobra.Command{
Use: "fish",
Short: "Generates fish completion scripts",
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 > ~/.config/fish/completions/flux.fish
Expand Down
1 change: 1 addition & 0 deletions cmd/flux/completion_powershell.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmd/flux/completion_zsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ 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)
Expand Down
4 changes: 2 additions & 2 deletions cmd/flux/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

"github.com/fluxcd/flux2/internal/utils"
"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.`,
}

type createFlags struct {
Expand Down
17 changes: 9 additions & 8 deletions cmd/flux/create_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"

notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b2 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"

"github.com/fluxcd/flux2/internal/utils"
"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 \
Expand Down Expand Up @@ -96,13 +97,13 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
logger.Generatef("generating Alert")
}

alert := notificationv1.Alert{
alert := notificationv1b2.Alert{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: notificationv1.AlertSpec{
Spec: notificationv1b2.AlertSpec{
ProviderRef: meta.LocalObjectReference{
Name: alertArgs.providerRef,
},
Expand Down Expand Up @@ -140,13 +141,13 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
}

func upsertAlert(ctx context.Context, kubeClient client.Client,
alert *notificationv1.Alert) (types.NamespacedName, error) {
alert *notificationv1b2.Alert) (types.NamespacedName, error) {
namespacedName := types.NamespacedName{
Namespace: alert.GetNamespace(),
Name: alert.GetName(),
}

var existing notificationv1.Alert
var existing notificationv1b2.Alert
err := kubeClient.Get(ctx, namespacedName, &existing)
if err != nil {
if errors.IsNotFound(err) {
Expand All @@ -171,7 +172,7 @@ func upsertAlert(ctx context.Context, kubeClient client.Client,
}

func isAlertReady(ctx context.Context, kubeClient client.Client,
namespacedName types.NamespacedName, alert *notificationv1.Alert) wait.ConditionFunc {
namespacedName types.NamespacedName, alert *notificationv1b2.Alert) wait.ConditionFunc {
return func() (bool, error) {
err := kubeClient.Get(ctx, namespacedName, alert)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/flux/create_alertprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import (
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
"github.com/fluxcd/pkg/apis/meta"

"github.com/fluxcd/flux2/internal/utils"
"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 \
Expand Down
6 changes: 3 additions & 3 deletions cmd/flux/create_helmrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"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"

Expand All @@ -46,7 +46,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 \
Expand Down
Loading