diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 0b41c1a4..3bd248f3 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -31,7 +31,7 @@ jobs: run: sudo go build -o ./bin/gotk ./cmd/gotk - name: bootstrap init run: | - ./bin/gotk bootstrap github \ + ./bin/gotk bootstrap github --manifests ./manifests/install/ \ --owner=fluxcd-testing \ --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ --path=test-cluster @@ -39,7 +39,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} - name: bootstrap no-op run: | - ./bin/gotk bootstrap github \ + ./bin/gotk bootstrap github --manifests ./manifests/install/ \ --owner=fluxcd-testing \ --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ --path=test-cluster @@ -51,7 +51,7 @@ jobs: ./bin/gotk uninstall --resources --crds -s - name: bootstrap reinstall run: | - ./bin/gotk bootstrap github \ + ./bin/gotk bootstrap github --manifests ./manifests/install/ \ --owner=fluxcd-testing \ --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ --path=test-cluster @@ -59,7 +59,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} - name: delete repository run: | - ./bin/gotk bootstrap github \ + ./bin/gotk bootstrap github --manifests ./manifests/install/ \ --owner=fluxcd-testing \ --repository=gotk-test-${{ steps.vars.outputs.sha_short }} \ --path=test-cluster \ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d0bac8f5..7d5f97f1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -23,34 +23,34 @@ jobs: # source-controller CRDs SOURCE_VER=$(controller_version source-controller) curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/gitrepositories.md" > docs/components/source/gitrepositories.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/helmrepositories.md" > docs/components/source/helmrepositories.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/helmcharts.md" > docs/components/source/helmcharts.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1alpha1/buckets.md" > docs/components/source/buckets.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/gitrepositories.md" > docs/components/source/gitrepositories.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmrepositories.md" > docs/components/source/helmrepositories.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmcharts.md" > docs/components/source/helmcharts.md + curl -# -f "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 -# -f "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/api/kustomize.md" > docs/components/kustomize/api.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/spec/v1alpha1/kustomization.md" > docs/components/kustomize/kustomization.md + curl -# -f "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 -# -f "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/api/helmrelease.md" > docs/components/helm/api.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/spec/v2alpha1/helmreleases.md" > docs/components/helm/helmreleases.md + curl -# -f "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 -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/api/notification.md" > docs/components/notification/api.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/event.md" > docs/components/notification/event.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/alert.md" > docs/components/notification/alert.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/provider.md" > docs/components/notification/provider.md - curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1alpha1/receiver.md" > docs/components/notification/receiver.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/event.md" > docs/components/notification/event.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/alert.md" > docs/components/notification/alert.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/provider.md" > docs/components/notification/provider.md + curl -# -f "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/receiver.md" > docs/components/notification/receiver.md } { diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index cb100bd5..cdbdebb5 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -41,15 +41,9 @@ jobs: - name: gotk check --pre run: | ./bin/gotk check --pre - - name: gotk install --version - run: | - ./bin/gotk install --version=master --namespace=test --verbose --components="source-controller,kustomize-controller" - - name: gotk uninstall - run: | - ./bin/gotk uninstall --namespace=test --crds --silent - name: gotk install --manifests run: | - ./bin/gotk install --manifests ./manifests/install/ --version="" + ./bin/gotk install --manifests ./manifests/install/ - name: gotk create source git run: | ./bin/gotk create source git podinfo \ @@ -126,6 +120,9 @@ jobs: - name: gotk check run: | ./bin/gotk check + - name: gotk uninstall + run: | + ./bin/gotk uninstall --crds --silent - name: Debug failure if: failure() run: | diff --git a/cmd/gotk/bootstrap.go b/cmd/gotk/bootstrap.go index 95e36aff..fb9616f2 100644 --- a/cmd/gotk/bootstrap.go +++ b/cmd/gotk/bootstrap.go @@ -34,8 +34,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var bootstrapCmd = &cobra.Command{ @@ -53,6 +53,7 @@ var ( bootstrapBranch string bootstrapWatchAllNamespaces bool bootstrapLogLevel string + bootstrapManifestsPath string bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"} ) @@ -80,6 +81,8 @@ func init() { 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().StringVar(&bootstrapLogLevel, "log-level", "info", "set the controllers log level") + bootstrapCmd.PersistentFlags().StringVar(&bootstrapManifestsPath, "manifests", "", "path to the manifest directory") + bootstrapCmd.PersistentFlags().MarkHidden("manifests") } func bootstrapValidate() error { @@ -100,7 +103,21 @@ func bootstrapValidate() error { return nil } -func generateInstallManifests(targetPath, namespace, tmpDir string) (string, error) { +func generateInstallManifests(targetPath, namespace, tmpDir string, localManifests string) (string, error) { + manifestsDir := path.Join(tmpDir, targetPath, namespace) + if err := os.MkdirAll(manifestsDir, os.ModePerm); err != nil { + return "", fmt.Errorf("creating manifests dir failed: %w", err) + } + manifest := path.Join(manifestsDir, bootstrapInstallManifest) + + if localManifests != "" { + if err := buildKustomization(localManifests, manifest); err != nil { + return "", fmt.Errorf("build kustomization failed: %w", err) + } + + return manifest, nil + } + gotkDir := path.Join(tmpDir, ".gotk") defer os.RemoveAll(gotkDir) @@ -114,12 +131,6 @@ func generateInstallManifests(targetPath, namespace, tmpDir string) (string, err return "", fmt.Errorf("generating manifests failed: %w", err) } - manifestsDir := path.Join(tmpDir, targetPath, namespace) - if err := os.MkdirAll(manifestsDir, os.ModePerm); err != nil { - return "", fmt.Errorf("generating manifests failed: %w", err) - } - - manifest := path.Join(manifestsDir, bootstrapInstallManifest) if err := buildKustomization(gotkDir, manifest); err != nil { return "", fmt.Errorf("build kustomization failed: %w", err) } diff --git a/cmd/gotk/bootstrap_github.go b/cmd/gotk/bootstrap_github.go index 254b3312..eca646ea 100644 --- a/cmd/gotk/bootstrap_github.go +++ b/cmd/gotk/bootstrap_github.go @@ -162,7 +162,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error { // generate install manifests logger.Generatef("generating manifests") - manifest, err := generateInstallManifests(ghPath, namespace, tmpDir) + manifest, err := generateInstallManifests(ghPath, namespace, tmpDir, bootstrapManifestsPath) if err != nil { return err } diff --git a/cmd/gotk/bootstrap_gitlab.go b/cmd/gotk/bootstrap_gitlab.go index e51df900..f94824d7 100644 --- a/cmd/gotk/bootstrap_gitlab.go +++ b/cmd/gotk/bootstrap_gitlab.go @@ -139,7 +139,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error { // generate install manifests logger.Generatef("generating manifests") - manifest, err := generateInstallManifests(glPath, namespace, tmpDir) + manifest, err := generateInstallManifests(glPath, namespace, tmpDir, bootstrapManifestsPath) if err != nil { return err } diff --git a/cmd/gotk/create_helmrelease.go b/cmd/gotk/create_helmrelease.go index 780c469b..81d6a834 100644 --- a/cmd/gotk/create_helmrelease.go +++ b/cmd/gotk/create_helmrelease.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "io/ioutil" "github.com/spf13/cobra" @@ -32,8 +33,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var createHelmReleaseCmd = &cobra.Command{ @@ -275,7 +276,7 @@ func isHelmChartReady(ctx context.Context, kubeClient client.Client, name, names } for _, condition := range helmChart.Status.Conditions { - if condition.Type == helmv2.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { diff --git a/cmd/gotk/create_kustomization.go b/cmd/gotk/create_kustomization.go index 5dca097b..da575c54 100644 --- a/cmd/gotk/create_kustomization.go +++ b/cmd/gotk/create_kustomization.go @@ -30,9 +30,10 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" + "github.com/fluxcd/pkg/apis/meta" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var createKsCmd = &cobra.Command{ @@ -306,7 +307,7 @@ func isKustomizationReady(ctx context.Context, kubeClient client.Client, name, n } for _, condition := range kustomization.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { diff --git a/cmd/gotk/create_source_bucket.go b/cmd/gotk/create_source_bucket.go index c7f072cb..254bd584 100644 --- a/cmd/gotk/create_source_bucket.go +++ b/cmd/gotk/create_source_bucket.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var createSourceBucketCmd = &cobra.Command{ diff --git a/cmd/gotk/create_source_git.go b/cmd/gotk/create_source_git.go index 7db210fe..5597393d 100644 --- a/cmd/gotk/create_source_git.go +++ b/cmd/gotk/create_source_git.go @@ -20,12 +20,13 @@ import ( "context" "crypto/elliptic" "fmt" + "github.com/fluxcd/pkg/apis/meta" "io/ioutil" "net/url" "os" "time" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/manifoldco/promptui" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" @@ -373,7 +374,7 @@ func isGitRepositoryReady(ctx context.Context, kubeClient client.Client, name, n } for _, condition := range gitRepository.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { diff --git a/cmd/gotk/create_source_helm.go b/cmd/gotk/create_source_helm.go index 2c4bbfd3..4ebf81bf 100644 --- a/cmd/gotk/create_source_helm.go +++ b/cmd/gotk/create_source_helm.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var createSourceHelmCmd = &cobra.Command{ diff --git a/cmd/gotk/create_tenant.go b/cmd/gotk/create_tenant.go index a970bab1..8119c7fa 100644 --- a/cmd/gotk/create_tenant.go +++ b/cmd/gotk/create_tenant.go @@ -64,6 +64,7 @@ var ( ) func init() { + createTenantCmd.Hidden = true 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") createCmd.AddCommand(createTenantCmd) diff --git a/cmd/gotk/delete_helmrelease.go b/cmd/gotk/delete_helmrelease.go index 87e208ed..86ec663c 100644 --- a/cmd/gotk/delete_helmrelease.go +++ b/cmd/gotk/delete_helmrelease.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" ) var deleteHelmReleaseCmd = &cobra.Command{ diff --git a/cmd/gotk/delete_kustomization.go b/cmd/gotk/delete_kustomization.go index a3a49c6f..743827a2 100644 --- a/cmd/gotk/delete_kustomization.go +++ b/cmd/gotk/delete_kustomization.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" "github.com/manifoldco/promptui" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" diff --git a/cmd/gotk/delete_source_bucket.go b/cmd/gotk/delete_source_bucket.go index c1d8c94c..7614e483 100644 --- a/cmd/gotk/delete_source_bucket.go +++ b/cmd/gotk/delete_source_bucket.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/manifoldco/promptui" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" diff --git a/cmd/gotk/delete_source_git.go b/cmd/gotk/delete_source_git.go index 3deaf417..73000fbf 100644 --- a/cmd/gotk/delete_source_git.go +++ b/cmd/gotk/delete_source_git.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/manifoldco/promptui" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" diff --git a/cmd/gotk/delete_source_helm.go b/cmd/gotk/delete_source_helm.go index 100921c1..5a9427ca 100644 --- a/cmd/gotk/delete_source_helm.go +++ b/cmd/gotk/delete_source_helm.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/manifoldco/promptui" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" diff --git a/cmd/gotk/export_helmrelease.go b/cmd/gotk/export_helmrelease.go index 12bfc021..8911c52e 100644 --- a/cmd/gotk/export_helmrelease.go +++ b/cmd/gotk/export_helmrelease.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" ) var exportHelmReleaseCmd = &cobra.Command{ diff --git a/cmd/gotk/export_kustomization.go b/cmd/gotk/export_kustomization.go index e901012d..b47a7076 100644 --- a/cmd/gotk/export_kustomization.go +++ b/cmd/gotk/export_kustomization.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" ) var exportKsCmd = &cobra.Command{ diff --git a/cmd/gotk/export_source_bucket.go b/cmd/gotk/export_source_bucket.go index 904ddc55..af9f78d0 100644 --- a/cmd/gotk/export_source_bucket.go +++ b/cmd/gotk/export_source_bucket.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var exportSourceBucketCmd = &cobra.Command{ diff --git a/cmd/gotk/export_source_git.go b/cmd/gotk/export_source_git.go index 5b9eb6a6..1aeff810 100644 --- a/cmd/gotk/export_source_git.go +++ b/cmd/gotk/export_source_git.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var exportSourceGitCmd = &cobra.Command{ diff --git a/cmd/gotk/export_source_helm.go b/cmd/gotk/export_source_helm.go index 061b16a9..53df16e4 100644 --- a/cmd/gotk/export_source_helm.go +++ b/cmd/gotk/export_source_helm.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var exportSourceHelmCmd = &cobra.Command{ diff --git a/cmd/gotk/get_helmrelease.go b/cmd/gotk/get_helmrelease.go index 4fdf3e75..4d2a89ae 100644 --- a/cmd/gotk/get_helmrelease.go +++ b/cmd/gotk/get_helmrelease.go @@ -18,12 +18,13 @@ package main import ( "context" + "github.com/fluxcd/pkg/apis/meta" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" ) var getHelmReleaseCmd = &cobra.Command{ @@ -68,7 +69,7 @@ func getHelmReleaseCmdRun(cmd *cobra.Command, args []string) error { } isInitialized := false for _, condition := range helmRelease.Status.Conditions { - if condition.Type == helmv2.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status != corev1.ConditionFalse { if helmRelease.Status.LastAppliedRevision != "" { logger.Successf("%s last applied revision %s", helmRelease.GetName(), helmRelease.Status.LastAppliedRevision) diff --git a/cmd/gotk/get_kustomization.go b/cmd/gotk/get_kustomization.go index 32c2d5e4..9bc225fc 100644 --- a/cmd/gotk/get_kustomization.go +++ b/cmd/gotk/get_kustomization.go @@ -18,8 +18,9 @@ package main import ( "context" + "github.com/fluxcd/pkg/apis/meta" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -67,7 +68,7 @@ func getKsCmdRun(cmd *cobra.Command, args []string) error { } isInitialized := false for _, condition := range kustomization.Status.Conditions { - if condition.Type == kustomizev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status != corev1.ConditionFalse { if kustomization.Status.LastAppliedRevision != "" { logger.Successf("%s last applied revision %s", kustomization.GetName(), kustomization.Status.LastAppliedRevision) diff --git a/cmd/gotk/get_source_bucket.go b/cmd/gotk/get_source_bucket.go index 6174de49..e6324dd5 100644 --- a/cmd/gotk/get_source_bucket.go +++ b/cmd/gotk/get_source_bucket.go @@ -18,8 +18,9 @@ package main import ( "context" + "github.com/fluxcd/pkg/apis/meta" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -62,7 +63,7 @@ func getSourceBucketCmdRun(cmd *cobra.Command, args []string) error { for _, source := range list.Items { isInitialized := false for _, condition := range source.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status != corev1.ConditionFalse { logger.Successf("%s last fetched revision: %s", source.GetName(), source.Status.Artifact.Revision) } else { diff --git a/cmd/gotk/get_source_git.go b/cmd/gotk/get_source_git.go index 73a9aff2..25a93afc 100644 --- a/cmd/gotk/get_source_git.go +++ b/cmd/gotk/get_source_git.go @@ -18,8 +18,9 @@ package main import ( "context" + "github.com/fluxcd/pkg/apis/meta" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -62,7 +63,7 @@ func getSourceGitCmdRun(cmd *cobra.Command, args []string) error { for _, source := range list.Items { isInitialized := false for _, condition := range source.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status != corev1.ConditionFalse { logger.Successf("%s last fetched revision: %s", source.GetName(), source.Status.Artifact.Revision) } else { diff --git a/cmd/gotk/get_source_helm.go b/cmd/gotk/get_source_helm.go index 0ca4abcf..80b14a5b 100644 --- a/cmd/gotk/get_source_helm.go +++ b/cmd/gotk/get_source_helm.go @@ -18,8 +18,9 @@ package main import ( "context" + "github.com/fluxcd/pkg/apis/meta" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -62,7 +63,7 @@ func getSourceHelmCmdRun(cmd *cobra.Command, args []string) error { for _, source := range list.Items { isInitialized := false for _, condition := range source.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status != corev1.ConditionFalse { logger.Successf("%s last fetched revision: %s", source.GetName(), source.Status.Artifact.Revision) } else { diff --git a/cmd/gotk/install.go b/cmd/gotk/install.go index 62a4b9a9..2df82885 100644 --- a/cmd/gotk/install.go +++ b/cmd/gotk/install.go @@ -76,8 +76,8 @@ func init() { "toolkit version") installCmd.Flags().StringSliceVar(&installComponents, "components", defaultComponents, "list of components, accepts comma-separated values") - installCmd.Flags().StringVar(&installManifestsPath, "manifests", "", - "path to the manifest directory, dev only") + installCmd.Flags().StringVar(&installManifestsPath, "manifests", "", "path to the manifest directory") + installCmd.Flags().MarkHidden("manifests") installCmd.Flags().StringVar(&installRegistry, "registry", "ghcr.io/fluxcd", "container registry where the toolkit images are published") installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "", @@ -102,14 +102,6 @@ func installCmdRun(cmd *cobra.Command, args []string) error { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - var kustomizePath string - if installVersion == "" && !strings.HasPrefix(installManifestsPath, "github.com/") { - if _, err := os.Stat(installManifestsPath); err != nil { - return fmt.Errorf("manifests not found: %w", err) - } - kustomizePath = installManifestsPath - } - tmpDir, err := ioutil.TempDir("", namespace) if err != nil { return err @@ -119,18 +111,18 @@ func installCmdRun(cmd *cobra.Command, args []string) error { if !installExport { logger.Generatef("generating manifests") } - if kustomizePath == "" { + if installManifestsPath == "" { err = genInstallManifests(installVersion, namespace, installComponents, installWatchAllNamespaces, installRegistry, installImagePullSecret, installArch, installLogLevel, tmpDir) if err != nil { return fmt.Errorf("install failed: %w", err) } - kustomizePath = tmpDir + installManifestsPath = tmpDir } manifest := path.Join(tmpDir, fmt.Sprintf("%s.yaml", namespace)) - if err := buildKustomization(kustomizePath, manifest); err != nil { + if err := buildKustomization(installManifestsPath, manifest); err != nil { return fmt.Errorf("install failed: %w", err) } diff --git a/cmd/gotk/main.go b/cmd/gotk/main.go index 1e24926d..6446596b 100644 --- a/cmd/gotk/main.go +++ b/cmd/gotk/main.go @@ -26,7 +26,7 @@ import ( "github.com/spf13/cobra/doc" _ "k8s.io/client-go/plugin/pkg/client/auth" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" gotklog "github.com/fluxcd/toolkit/pkg/log" ) diff --git a/cmd/gotk/reconcile_helmrelease.go b/cmd/gotk/reconcile_helmrelease.go index 06083b0b..e62849b8 100644 --- a/cmd/gotk/reconcile_helmrelease.go +++ b/cmd/gotk/reconcile_helmrelease.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "time" "github.com/spf13/cobra" @@ -27,9 +28,8 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" - consts "github.com/fluxcd/pkg/runtime" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var reconcileHrCmd = &cobra.Command{ @@ -98,10 +98,10 @@ func reconcileHrCmdRun(cmd *cobra.Command, args []string) error { logger.Actionf("annotating HelmRelease %s in %s namespace", name, namespace) if helmRelease.Annotations == nil { helmRelease.Annotations = map[string]string{ - consts.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), + meta.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), } } else { - helmRelease.Annotations[consts.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) + helmRelease.Annotations[meta.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) } if err := kubeClient.Update(ctx, &helmRelease); err != nil { return err @@ -144,7 +144,7 @@ func isHelmReleaseReady(ctx context.Context, kubeClient client.Client, name, nam } for _, condition := range helmRelease.Status.Conditions { - if condition.Type == helmv2.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse && helmRelease.Status.LastAttemptedRevision != "" { diff --git a/cmd/gotk/reconcile_kustomization.go b/cmd/gotk/reconcile_kustomization.go index 07ff6a04..7ca0d5d1 100644 --- a/cmd/gotk/reconcile_kustomization.go +++ b/cmd/gotk/reconcile_kustomization.go @@ -19,15 +19,15 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "time" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" - consts "github.com/fluxcd/pkg/runtime" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var reconcileKsCmd = &cobra.Command{ @@ -94,10 +94,10 @@ func reconcileKsCmdRun(cmd *cobra.Command, args []string) error { logger.Actionf("annotating kustomization %s in %s namespace", name, namespace) if kustomization.Annotations == nil { kustomization.Annotations = map[string]string{ - consts.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), + meta.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), } } else { - kustomization.Annotations[consts.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) + kustomization.Annotations[meta.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) } if err := kubeClient.Update(ctx, &kustomization); err != nil { return err diff --git a/cmd/gotk/reconcile_source_bucket.go b/cmd/gotk/reconcile_source_bucket.go index 15b33e2a..1b20f112 100644 --- a/cmd/gotk/reconcile_source_bucket.go +++ b/cmd/gotk/reconcile_source_bucket.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "time" "github.com/spf13/cobra" @@ -27,8 +28,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - consts "github.com/fluxcd/pkg/runtime" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var reconcileSourceBucketCmd = &cobra.Command{ @@ -73,10 +73,10 @@ func reconcileSourceBucketCmdRun(cmd *cobra.Command, args []string) error { if bucket.Annotations == nil { bucket.Annotations = map[string]string{ - consts.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), + meta.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), } } else { - bucket.Annotations[consts.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) + bucket.Annotations[meta.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) } if err := kubeClient.Update(ctx, &bucket); err != nil { return err @@ -118,7 +118,7 @@ func isBucketReady(ctx context.Context, kubeClient client.Client, name, namespac } for _, condition := range bucket.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { diff --git a/cmd/gotk/reconcile_source_git.go b/cmd/gotk/reconcile_source_git.go index 7f2af513..5a79f2bd 100644 --- a/cmd/gotk/reconcile_source_git.go +++ b/cmd/gotk/reconcile_source_git.go @@ -19,14 +19,14 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "time" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" - consts "github.com/fluxcd/pkg/runtime" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var reconcileSourceGitCmd = &cobra.Command{ @@ -71,10 +71,10 @@ func reconcileSourceGitCmdRun(cmd *cobra.Command, args []string) error { if gitRepository.Annotations == nil { gitRepository.Annotations = map[string]string{ - consts.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), + meta.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), } } else { - gitRepository.Annotations[consts.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) + gitRepository.Annotations[meta.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) } if err := kubeClient.Update(ctx, &gitRepository); err != nil { return err diff --git a/cmd/gotk/reconcile_source_helm.go b/cmd/gotk/reconcile_source_helm.go index 4e6fdac7..10aa07e0 100644 --- a/cmd/gotk/reconcile_source_helm.go +++ b/cmd/gotk/reconcile_source_helm.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "time" "github.com/spf13/cobra" @@ -27,8 +28,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - consts "github.com/fluxcd/pkg/runtime" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var reconcileSourceHelmCmd = &cobra.Command{ @@ -73,10 +73,10 @@ func reconcileSourceHelmCmdRun(cmd *cobra.Command, args []string) error { if helmRepository.Annotations == nil { helmRepository.Annotations = map[string]string{ - consts.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), + meta.ReconcileAtAnnotation: time.Now().Format(time.RFC3339Nano), } } else { - helmRepository.Annotations[consts.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) + helmRepository.Annotations[meta.ReconcileAtAnnotation] = time.Now().Format(time.RFC3339Nano) } if err := kubeClient.Update(ctx, &helmRepository); err != nil { return err @@ -118,7 +118,7 @@ func isHelmRepositoryReady(ctx context.Context, kubeClient client.Client, name, } for _, condition := range helmRepository.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { diff --git a/cmd/gotk/resume_helmrelease.go b/cmd/gotk/resume_helmrelease.go index 21b1615d..a192c1e1 100644 --- a/cmd/gotk/resume_helmrelease.go +++ b/cmd/gotk/resume_helmrelease.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" @@ -26,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" ) var resumeHrCmd = &cobra.Command{ @@ -112,11 +113,11 @@ func isHelmReleaseResumed(ctx context.Context, kubeClient client.Client, name, n } for _, condition := range helmRelease.Status.Conditions { - if condition.Type == helmv2.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { - if condition.Reason == helmv2.SuspendedReason { + if condition.Reason == meta.SuspendedReason { return false, nil } diff --git a/cmd/gotk/resume_kustomization.go b/cmd/gotk/resume_kustomization.go index e6550c2f..cc9b9451 100644 --- a/cmd/gotk/resume_kustomization.go +++ b/cmd/gotk/resume_kustomization.go @@ -19,9 +19,9 @@ package main import ( "context" "fmt" + "github.com/fluxcd/pkg/apis/meta" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -112,11 +112,11 @@ func isKustomizationResumed(ctx context.Context, kubeClient client.Client, name, } for _, condition := range kustomization.Status.Conditions { - if condition.Type == sourcev1.ReadyCondition { + if condition.Type == meta.ReadyCondition { if condition.Status == corev1.ConditionTrue { return true, nil } else if condition.Status == corev1.ConditionFalse { - if condition.Reason == kustomizev1.SuspendedReason { + if condition.Reason == meta.SuspendedReason { return false, nil } diff --git a/cmd/gotk/suspend_helmrelease.go b/cmd/gotk/suspend_helmrelease.go index cd42e311..0763b74d 100644 --- a/cmd/gotk/suspend_helmrelease.go +++ b/cmd/gotk/suspend_helmrelease.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" ) var suspendHrCmd = &cobra.Command{ diff --git a/cmd/gotk/suspend_kustomization.go b/cmd/gotk/suspend_kustomization.go index 1d6d23ad..3b0c0d9a 100644 --- a/cmd/gotk/suspend_kustomization.go +++ b/cmd/gotk/suspend_kustomization.go @@ -19,7 +19,7 @@ package main import ( "context" "fmt" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" ) diff --git a/cmd/gotk/uninstall.go b/cmd/gotk/uninstall.go index 4df40c8f..20e6340e 100644 --- a/cmd/gotk/uninstall.go +++ b/cmd/gotk/uninstall.go @@ -24,8 +24,8 @@ import ( "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) var uninstallCmd = &cobra.Command{ diff --git a/cmd/gotk/utils.go b/cmd/gotk/utils.go index 0712bde8..e6a2ef2f 100644 --- a/cmd/gotk/utils.go +++ b/cmd/gotk/utils.go @@ -40,10 +40,10 @@ import ( kustypes "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/yaml" - helmv2 "github.com/fluxcd/helm-controller/api/v2alpha1" - kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1" + helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" + kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" "github.com/fluxcd/pkg/runtime/dependency" - sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" + sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" ) type Utils struct { diff --git a/docs/cmd/gotk_create.md b/docs/cmd/gotk_create.md index b9a0bda1..30b55ac1 100644 --- a/docs/cmd/gotk_create.md +++ b/docs/cmd/gotk_create.md @@ -30,5 +30,4 @@ The create sub-commands generate sources and resources. * [gotk create helmrelease](gotk_create_helmrelease.md) - Create or update a HelmRelease resource * [gotk create kustomization](gotk_create_kustomization.md) - Create or update a Kustomization resource * [gotk create source](gotk_create_source.md) - Create or update sources -* [gotk create tenant](gotk_create_tenant.md) - Create or update a tenant diff --git a/docs/cmd/gotk_create_tenant.md b/docs/cmd/gotk_create_tenant.md deleted file mode 100644 index d15bc773..00000000 --- a/docs/cmd/gotk_create_tenant.md +++ /dev/null @@ -1,54 +0,0 @@ -## gotk create tenant - -Create or update a tenant - -### Synopsis - - -The create tenant command generates namespaces and role bindings to limit the -reconcilers scope to the tenant namespaces. - -``` -gotk create tenant [flags] -``` - -### Examples - -``` - # Create a tenant with access to a namespace - gotk create tenant dev-team \ - --with-namespace=frontend \ - --label=environment=dev - - # Generate tenant namespaces and role bindings in YAML format - gotk create tenant dev-team \ - --with-namespace=frontend \ - --with-namespace=backend \ - --export > dev-team.yaml - -``` - -### Options - -``` - --cluster-role string cluster role of the tenant role binding (default "cluster-admin") - -h, --help help for tenant - --with-namespace strings namespace belonging to this tenant -``` - -### Options inherited from parent commands - -``` - --export export in YAML format to stdout - --interval duration source sync interval (default 1m0s) - --kubeconfig string path to the kubeconfig file (default "~/.kube/config") - --label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2) - -n, --namespace string the namespace scope for this operation (default "gitops-system") - --timeout duration timeout for this operation (default 5m0s) - --verbose print generated objects -``` - -### SEE ALSO - -* [gotk create](gotk_create.md) - Create or update sources and resources - diff --git a/docs/cmd/gotk_install.md b/docs/cmd/gotk_install.md index dcf10cfd..35aec08d 100644 --- a/docs/cmd/gotk_install.md +++ b/docs/cmd/gotk_install.md @@ -38,7 +38,6 @@ gotk install [flags] -h, --help help for install --image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry --log-level string set the controllers log level (default "info") - --manifests string path to the manifest directory, dev only --registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd") -v, --version string toolkit version (default "latest") --watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true) diff --git a/docs/dev-guides/source-watcher.md b/docs/dev-guides/source-watcher.md index 7e84b9ce..aaced8d5 100644 --- a/docs/dev-guides/source-watcher.md +++ b/docs/dev-guides/source-watcher.md @@ -192,7 +192,7 @@ To add the watcher to an existing project, copy the controller and the revision In your `main.go` init function, register the Source API schema: ```go -import sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1" +import sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" func init() { _ = clientgoscheme.AddToScheme(scheme) diff --git a/go.mod b/go.mod index 1b9ee25e..c7586e43 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,16 @@ module github.com/fluxcd/toolkit go 1.14 require ( - github.com/blang/semver v3.5.1+incompatible - github.com/fluxcd/helm-controller/api v0.0.10 - github.com/fluxcd/kustomize-controller/api v0.0.13 + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver v3.5.0+incompatible + github.com/fluxcd/helm-controller/api v0.1.0 + github.com/fluxcd/kustomize-controller/api v0.1.0 + github.com/fluxcd/pkg/apis/meta v0.0.2 github.com/fluxcd/pkg/git v0.0.7 - github.com/fluxcd/pkg/runtime v0.0.3 + github.com/fluxcd/pkg/runtime v0.0.6 github.com/fluxcd/pkg/ssh v0.0.5 github.com/fluxcd/pkg/untar v0.0.5 - github.com/fluxcd/source-controller/api v0.0.18 + github.com/fluxcd/source-controller/api v0.1.0 github.com/manifoldco/promptui v0.7.0 github.com/spf13/cobra v1.0.0 golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect @@ -18,11 +20,11 @@ require ( golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect google.golang.org/appengine v1.6.6 // indirect google.golang.org/protobuf v1.24.0 // indirect - k8s.io/api v0.18.8 - k8s.io/apiextensions-apiserver v0.18.8 - k8s.io/apimachinery v0.18.8 - k8s.io/client-go v0.18.8 - sigs.k8s.io/controller-runtime v0.6.2 + k8s.io/api v0.18.9 + k8s.io/apiextensions-apiserver v0.18.9 + k8s.io/apimachinery v0.18.9 + k8s.io/client-go v0.18.9 + sigs.k8s.io/controller-runtime v0.6.3 sigs.k8s.io/kustomize/api v0.6.2 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index 198872a3..0b68fb97 100644 --- a/go.sum +++ b/go.sum @@ -51,9 +51,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bombsimon/wsl v1.2.5/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -106,25 +105,28 @@ github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fluxcd/helm-controller/api v0.0.10 h1:VWguG8loIrfbECgpXfnfl4wMwH/dJ/NzZUS8TYL2bF4= -github.com/fluxcd/helm-controller/api v0.0.10/go.mod h1:m6f9E3SniPQhdBJj5f1uUTGSDimERl3fHhTouTfBAq4= -github.com/fluxcd/kustomize-controller/api v0.0.13 h1:5ktXXMzsNEoQtSdC7OF606JLV2k/+SzJrgWZ8kx05pg= -github.com/fluxcd/kustomize-controller/api v0.0.13/go.mod h1:zr/JbKgyikeFnWM2eE5h+zMxZ7Ey3JITEAuH5OjGDIo= +github.com/fluxcd/helm-controller/api v0.1.0 h1:hci9/dLlej6W+rZVkAGVi1MjLVaHWsq/luOYX9DtzJo= +github.com/fluxcd/helm-controller/api v0.1.0/go.mod h1:orwdS+iYGcM8BReUQfIb5CJ+jiFdlKmnLnzp6K3FK2U= +github.com/fluxcd/kustomize-controller/api v0.1.0 h1:dPowX408q0jO7wnWBj5Dglc22euAQBLxDhPS8XHlLM0= +github.com/fluxcd/kustomize-controller/api v0.1.0/go.mod h1:upR7/OzX/wXJlKgiBLUn7ez4XG4Lo5edep2WKSx0u7c= +github.com/fluxcd/pkg/apis/meta v0.0.2 h1:kyA4Y0IzNjf1joBOnFqpWG7aNDHvtLExZcaHQM7qhRI= +github.com/fluxcd/pkg/apis/meta v0.0.2/go.mod h1:nCNps5JJOcEQr3MNDmZqI4o0chjePSUYL6Q2ktDtotU= github.com/fluxcd/pkg/git v0.0.7 h1:tFSYPy7tcIYfOt8H5EUERXIRz7fk0id302oQZde1NtU= github.com/fluxcd/pkg/git v0.0.7/go.mod h1:5Vu92x6Q3CpxDUllmB69kAkVY5jAtPpXcY2TSZ/oCJI= -github.com/fluxcd/pkg/runtime v0.0.3 h1:x9rOThl1qh5srIUpW0YHEj1I84swMj5m76UqrR1QknY= -github.com/fluxcd/pkg/runtime v0.0.3/go.mod h1:ECBTeplxhgbCJYIjmtwn3ZS0A91/+6YtOS4w2G0LeK4= +github.com/fluxcd/pkg/runtime v0.0.6 h1:m7qwr2wRePs1vzVlM0Y88vitXSsv1lb3QCJflRpa3qQ= +github.com/fluxcd/pkg/runtime v0.0.6/go.mod h1:iLjncjktQVpqpb1NsY2fW+UYDFOtVyt+yJrxqrrK8A0= github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A= github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs= github.com/fluxcd/pkg/untar v0.0.5 h1:UGI3Ch1UIEIaqQvMicmImL1s9npQa64DJ/ozqHKB7gk= github.com/fluxcd/pkg/untar v0.0.5/go.mod h1:O6V9+rtl8c1mHBafgqFlJN6zkF1HS5SSYn7RpQJ/nfw= -github.com/fluxcd/source-controller/api v0.0.18 h1:9goqqsW3vhwO6Nxr8SNxIUW/5t1JL9cgIs4UctlaJVk= -github.com/fluxcd/source-controller/api v0.0.18/go.mod h1:PUe+EYQ/s+KPnz2iOCgdf+L6clM0SWkyvdXIpbfpkQE= +github.com/fluxcd/source-controller/api v0.1.0 h1:ky3gMs3mnkDl6ClX+7uT2BNxU+sLzW/6a8B/M1KfySw= +github.com/fluxcd/source-controller/api v0.1.0/go.mod h1:1ac/vj49YVPKF+xBHTo/9pfFj64TcLc1RLaxi4MwVEM= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -732,25 +734,25 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= -k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4= -k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= +k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ= +k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= -k8s.io/apiextensions-apiserver v0.18.8 h1:pkqYPKTHa0/3lYwH7201RpF9eFm0lmZDFBNzhN+k/sA= -k8s.io/apiextensions-apiserver v0.18.8/go.mod h1:7f4ySEkkvifIr4+BRrRWriKKIJjPyg9mb/p63dJKnlM= +k8s.io/apiextensions-apiserver v0.18.9 h1:tVEf8rVKh5BnXORnYYCztjbf6CSyGNMt/rAIEyfU00Q= +k8s.io/apiextensions-apiserver v0.18.9/go.mod h1:JagmAhU0TVENzgUZqHJsjCSDh7YuV5o6g01G1Fwh7zI= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0= -k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= +k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY= +k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= -k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM= +k8s.io/apiserver v0.18.9/go.mod h1:vXQzMtUCLsGg1Bh+7Jo2mZKHpHZFCZn8eTNSepcIA1M= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= -k8s.io/client-go v0.18.8 h1:SdbLpIxk5j5YbFr1b7fq8S7mDgDjYmUxSbszyoesoDM= -k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= +k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= -k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= +k8s.io/component-base v0.18.9/go.mod h1:tUo4qZtV8m7t/U+0DgY+fcnn4BFZ480fZdzxOkWH4zk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -770,8 +772,8 @@ mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIa mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= -sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= +sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE= +sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/kustomize/api v0.6.2 h1:qZzMiyllvwBv6KQ8V3VsF452INpDW4eWEHOfyeKvkHw= sigs.k8s.io/kustomize/api v0.6.2/go.mod h1:OL467fU5FuolXnIPUqhBLSXUUD00/IBjHs+dBdAS75E= sigs.k8s.io/kustomize/kyaml v0.8.1 h1:5GRanVGU6+iq3ERTiQD9VIfyGByFVB4z4GthP8NkRYE= diff --git a/manifests/bases/helm-controller/kustomization.yaml b/manifests/bases/helm-controller/kustomization.yaml index d2626ae3..a5f587c6 100644 --- a/manifests/bases/helm-controller/kustomization.yaml +++ b/manifests/bases/helm-controller/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/helm-controller/archive/v0.0.10.zip//helm-controller-0.0.10/config/crd -- https://github.com/fluxcd/helm-controller/archive/v0.0.10.zip//helm-controller-0.0.10/config/manager +- https://github.com/fluxcd/helm-controller/archive/v0.1.0.zip//helm-controller-0.1.0/config/crd +- https://github.com/fluxcd/helm-controller/archive/v0.1.0.zip//helm-controller-0.1.0/config/manager patchesJson6902: - target: group: apps diff --git a/manifests/bases/kustomize-controller/kustomization.yaml b/manifests/bases/kustomize-controller/kustomization.yaml index 2a5c8395..ed058f66 100644 --- a/manifests/bases/kustomize-controller/kustomization.yaml +++ b/manifests/bases/kustomize-controller/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/kustomize-controller/archive/v0.0.13.zip//kustomize-controller-0.0.13/config/crd -- https://github.com/fluxcd/kustomize-controller/archive/v0.0.13.zip//kustomize-controller-0.0.13/config/manager +- https://github.com/fluxcd/kustomize-controller/archive/v0.1.0.zip//kustomize-controller-0.1.0/config/crd +- https://github.com/fluxcd/kustomize-controller/archive/v0.1.0.zip//kustomize-controller-0.1.0/config/manager patchesJson6902: - target: group: apps diff --git a/manifests/bases/notification-controller/kustomization.yaml b/manifests/bases/notification-controller/kustomization.yaml index e5d81701..ec1d551c 100644 --- a/manifests/bases/notification-controller/kustomization.yaml +++ b/manifests/bases/notification-controller/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/notification-controller/archive/v0.0.11.zip//notification-controller-0.0.11/config/crd -- https://github.com/fluxcd/notification-controller/archive/v0.0.11.zip//notification-controller-0.0.11/config/manager +- https://github.com/fluxcd/notification-controller/archive/v0.1.0.zip//notification-controller-0.1.0/config/crd +- https://github.com/fluxcd/notification-controller/archive/v0.1.0.zip//notification-controller-0.1.0/config/manager diff --git a/manifests/bases/source-controller/kustomization.yaml b/manifests/bases/source-controller/kustomization.yaml index bd18bf59..95bbfc74 100644 --- a/manifests/bases/source-controller/kustomization.yaml +++ b/manifests/bases/source-controller/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/fluxcd/source-controller/archive/v0.0.18.zip//source-controller-0.0.18/config/crd -- https://github.com/fluxcd/source-controller/archive/v0.0.18.zip//source-controller-0.0.18/config/manager +- https://github.com/fluxcd/source-controller/archive/v0.1.0.zip//source-controller-0.1.0/config/crd +- https://github.com/fluxcd/source-controller/archive/v0.1.0.zip//source-controller-0.1.0/config/manager patchesJson6902: - target: group: apps diff --git a/mkdocs.yml b/mkdocs.yml index ec6e27a4..742fcfb1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -87,7 +87,7 @@ nav: - Create source git: cmd/gotk_create_source_git.md - Create source helm: cmd/gotk_create_source_helm.md - Create source bucket: cmd/gotk_create_source_bucket.md - - Create tenant: cmd/gotk_create_tenant.md + #- Create tenant: cmd/gotk_create_tenant.md - Delete: cmd/gotk_delete.md - Delete kustomization: cmd/gotk_delete_kustomization.md - Delete helmrelease: cmd/gotk_delete_helmrelease.md