From 0ffe826aabe6d55eb963fe1a5fde10be776f8201 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Tue, 27 Feb 2024 15:01:59 +0100 Subject: [PATCH 01/42] image registry to flux-iac in helm values --- charts/tf-controller/README.md.gotmpl | 4 ++-- charts/tf-controller/values.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/tf-controller/README.md.gotmpl b/charts/tf-controller/README.md.gotmpl index c6d8f52c7..67e9b779d 100644 --- a/charts/tf-controller/README.md.gotmpl +++ b/charts/tf-controller/README.md.gotmpl @@ -11,10 +11,10 @@ After that you can install TF-controller manually with Helm by: ```shell # Add tf-controller helm repository -helm repo add tf-controller https://weaveworks.github.io/tf-controller/ +helm repo add tf-controller https://flux-iac.github.io/tofu-controller/ # Install tf-controller -helm upgrade -i tf-controller tf-controller/tf-controller \ +helm upgrade -i tofu-controller tofu-controller/tf-controller \ --namespace flux-system ``` diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index c9add0112..871d01988 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -24,7 +24,7 @@ podLabels: {} replicaCount: 1 image: # -- Controller image repository - repository: ghcr.io/weaveworks/tf-controller + repository: ghcr.io/flux-iac/tf-controller # -- Controller image pull policy pullPolicy: IfNotPresent # -- Overrides the image tag whose default is the chart appVersion. @@ -111,12 +111,12 @@ usePodSubdomainResolution: false awsPackage: install: true tag: v4.38.0-v1alpha11 - repository: ghcr.io/tf-controller/aws-primitive-modules + repository: ghcr.io/flux-iac/aws-primitive-modules # -- Runner-specific configurations runner: image: # -- Runner image repository - repository: ghcr.io/weaveworks/tf-runner + repository: ghcr.io/flux-iac/tf-runner # -- Runner image tag # @default -- `.Chart.AppVersion` tag: "v0.16.0-rc.3" @@ -177,7 +177,7 @@ metrics: branchPlanner: enabled: false image: - repository: ghcr.io/weaveworks/branch-planner + repository: ghcr.io/flux-iac/branch-planner pullPolicy: IfNotPresent tag: "" configMap: branch-planner From 7b75830de8b8ba160c9318bc6f31113706ad6517 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Tue, 27 Feb 2024 15:06:46 +0100 Subject: [PATCH 02/42] change link in chart metadata to docs to flux-iac --- charts/tf-controller/templates/packages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tf-controller/templates/packages.yaml b/charts/tf-controller/templates/packages.yaml index ca9fa2750..3fed2d1fc 100644 --- a/charts/tf-controller/templates/packages.yaml +++ b/charts/tf-controller/templates/packages.yaml @@ -5,7 +5,7 @@ metadata: name: aws-package annotations: metadata.weave.works/description: "This is the AWS package containing primitive modules for Weave TF-controller." - metadata.weave.works/docs-url: "https://github.com/tf-controller/aws-primitive-modules" + metadata.weave.works/docs-url: "https://github.com/flux-iac/aws-primitive-modules" spec: interval: 1h0m0s ref: From 5779ab07b6a0cf923eaee3d0c3158035020cf434 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Tue, 27 Feb 2024 15:11:13 +0100 Subject: [PATCH 03/42] chart readme generated with helm-docs --- charts/tf-controller/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index a699e3f95..04a1bf817 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -11,10 +11,10 @@ After that you can install TF-controller manually with Helm by: ```shell # Add tf-controller helm repository -helm repo add tf-controller https://flux-iac.github.io/tofu-controller +helm repo add tf-controller https://flux-iac.github.io/tofu-controller/ # Install tf-controller -helm upgrade -i tf-controller tf-controller/tf-controller \ +helm upgrade -i tofu-controller tofu-controller/tf-controller \ --namespace flux-system ``` @@ -34,9 +34,9 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | allowBreakTheGlass | bool | `false` | Argument for `--allow-break-the-glass` (Controller). AllowBreakTheGlass allows the controller to break the glass and modify Terraform states when the sync loop is broken. | | allowCrossNamespaceRefs | bool | `false` | If `true`, enable cross-namespace references for controller and branch-planner | | awsPackage.install | bool | `true` | | -| awsPackage.repository | string | `"ghcr.io/tf-controller/aws-primitive-modules"` | | +| awsPackage.repository | string | `"ghcr.io/flux-iac/aws-primitive-modules"` | | | awsPackage.tag | string | `"v4.38.0-v1alpha11"` | | -| branchPlanner | object | `{"configMap":"branch-planner","enabled":false,"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/weaveworks/branch-planner","tag":""},"podSecurityContext":{"fsGroup":1337},"pollingInterval":"30s","resources":{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"64Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}},"sourceInterval":"30s"}` | Branch Planner-specific configurations | +| branchPlanner | object | `{"configMap":"branch-planner","enabled":false,"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/flux-iac/branch-planner","tag":""},"podSecurityContext":{"fsGroup":1337},"pollingInterval":"30s","resources":{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"64Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}},"sourceInterval":"30s"}` | Branch Planner-specific configurations | | caCertValidityDuration | string | `"168h0m"` | Argument for `--ca-cert-validity-duration` (Controller) | | certRotationCheckFrequency | string | `"30m0s"` | Argument for `--cert-rotation-check-frequency` (Controller) | | certValidityDuration | string | `"6h0m"` | Argument for `--cert-validity-duration` (Controller) | @@ -49,7 +49,7 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | extraEnv | object | `{}` | Additional container environment variables. | | fullnameOverride | string | `""` | Provide a fullname | | image.pullPolicy | string | `"IfNotPresent"` | Controller image pull policy | -| image.repository | string | `"ghcr.io/weaveworks/tf-controller"` | Controller image repository | +| image.repository | string | `"ghcr.io/flux-iac/tf-controller"` | Controller image repository | | image.tag | string | `.Chart.AppVersion` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | Controller image pull secret | | installCRDs | bool | `true` | If `true`, install CRDs as part of the helm installation | @@ -77,10 +77,10 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | rbac.create | bool | `true` | If `true`, create and use RBAC resources | | replicaCount | int | `1` | Number of TF-Controller pods to deploy | | resources | object | `{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"64Mi"}}` | Resource limits and requests | -| runner | object | `{"creationTimeout":"5m0s","grpc":{"maxMessageSize":4},"image":{"repository":"ghcr.io/weaveworks/tf-runner","tag":"v0.16.0-rc.3"},"serviceAccount":{"allowedNamespaces":[],"annotations":{},"create":true,"name":""}}` | Runner-specific configurations | +| runner | object | `{"creationTimeout":"5m0s","grpc":{"maxMessageSize":4},"image":{"repository":"ghcr.io/flux-iac/tf-runner","tag":"v0.16.0-rc.3"},"serviceAccount":{"allowedNamespaces":[],"annotations":{},"create":true,"name":""}}` | Runner-specific configurations | | runner.creationTimeout | string | `"5m0s"` | Timeout for runner-creation (Controller) | | runner.grpc.maxMessageSize | int | `4` | Maximum GRPC message size (Controller) | -| runner.image.repository | string | `"ghcr.io/weaveworks/tf-runner"` | Runner image repository | +| runner.image.repository | string | `"ghcr.io/flux-iac/tf-runner"` | Runner image repository | | runner.image.tag | string | `.Chart.AppVersion` | Runner image tag | | runner.serviceAccount.allowedNamespaces | list | `[]` | List of namespaces that the runner may run within | | runner.serviceAccount.annotations | object | `{}` | Additional runner service Account annotations | @@ -96,4 +96,4 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | volumes | list | `[]` | Volumes properties for the TF-Controller deployment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) \ No newline at end of file +Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0) \ No newline at end of file From d3ff233f11193f74e44b8e2d4c49c6031edad970 Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Tue, 27 Feb 2024 18:17:56 +0100 Subject: [PATCH 04/42] rename github.com/weaveworks/tf-controller to github.com/flux-iac/tofu-controller --- DEVELOPMENT.md | 2 +- Dockerfile | 2 +- PROJECT | 6 +++--- SECURITY.md | 2 +- api/go.mod | 2 +- api/v1alpha2/terraform_types.go | 2 +- cmd/branch-planner/flags.go | 2 +- cmd/branch-planner/informer.go | 8 ++++---- cmd/branch-planner/main.go | 2 +- cmd/branch-planner/polling.go | 2 +- cmd/manager/main.go | 8 ++++---- cmd/runner/main.go | 2 +- cmd/tfctl/main.go | 2 +- controllers/cleaner_test.go | 4 ++-- controllers/get_runner_pod_object_key_test.go | 5 +++-- controllers/object_encode_test.go | 5 +++-- controllers/suite_test.go | 6 +++--- controllers/tc000010_no_outputs_test.go | 2 +- controllers/tc000011_bad_tar_gz_no_outputs_test.go | 2 +- controllers/tc000011_workspace_no_outputs_test.go | 2 +- controllers/tc000012_src_bucket_no_outputs_test.go | 2 +- controllers/tc000013_source_not_found_test.go | 2 +- controllers/tc000014_artifact_not_found_test.go | 2 +- ...c000015_cliconfigsecret_cross_ns_denied_test.go | 2 +- .../tc000015_depends_on_cross_ns_denied_test.go | 2 +- .../tc000015_source_cross_ns_denied_test.go | 2 +- .../tc000016_default_observed_generation_test.go | 2 +- controllers/tc000016_finilize_status_test.go | 2 +- .../tc000020_with_backend_no_outputs_test.go | 2 +- .../tc000020_with_workspace_no_outputs_test.go | 2 +- controllers/tc000030_plan_only_no_outputs_test.go | 2 +- ...lan_only_with_showplan_as_cm_no_outputs_test.go | 2 +- controllers/tc000040_controlled_outputs_test.go | 2 +- controllers/tc000041_all_outputs_test.go | 2 +- .../tc000042_output_name_contains_dot_test.go | 5 +++-- ...controlled_outputs_should_be_reconciled_test.go | 5 +++-- controllers/tc000044_plan_only_mode_test.go | 2 +- ...0050_plan_and_manual_approve_no_outputs_test.go | 2 +- ...nd_manual_approve_and_replan_no_outputs_test.go | 2 +- ...0052_plan_and_manual_approve_with_files_test.go | 4 ++-- .../tc000060_vars_and_controlled_outputs_test.go | 2 +- controllers/tc000061_vars_hcl_input_test.go | 2 +- controllers/tc000062_vars_hcl_test.go | 4 ++-- controllers/tc000063_values_hcl_test.go | 2 +- controllers/tc000064_values_template_hcl_test.go | 2 +- ..._varsfrom_secret_and_controlled_outputs_test.go | 2 +- ...ret_with_varkeys_and_controlled_outputs_test.go | 2 +- ...from_optional_secret_controlled_outputs_test.go | 2 +- ...3_varsfrom_accepts_many_secrets_outputs_test.go | 2 +- ...crets_with_last_supplied_key_precedence_test.go | 4 ++-- ...h_varkeys_rename_and_controlled_outputs_test.go | 2 +- ...rsfrom_configmap_and_controlled_outputs_test.go | 2 +- ...cepts_many_configmap_controlled_outputs_test.go | 2 +- ...gmaps_with_last_supplied_key_precedence_test.go | 4 ++-- ...arsfrom_override_and_controlled_outputs_test.go | 2 +- ...d_should_tx_to_plan_when_source_changed_test.go | 2 +- ..._to_plan_then_apply_when_source_changed_test.go | 2 +- .../tc000111_with_backend_s3_no_outputs_test.go | 2 +- controllers/tc000120_delete_test.go | 2 +- controllers/tc000121_destroy_on_delete_test.go | 4 ++-- controllers/tc000130_destroy_no_outputs_test.go | 4 ++-- controllers/tc000131_destroy_no_changes_test.go | 4 ++-- ..._to_plan_then_apply_when_drift_detected_test.go | 4 ++-- ...uld_report_and_loop_when_drift_detected_test.go | 4 ++-- ...x_to_plan_when_unrelated_source_changed_test.go | 4 ++-- ...e_should_delete_the_plan_and_start_over_test.go | 4 ++-- controllers/tc000180_should_detect_drift_test.go | 2 +- ...c000190_unsupported_source_should_error_test.go | 2 +- .../tc000191_missing_source_should_error_test.go | 2 +- .../tc000200_disable_drift_detection_test.go | 2 +- ...o_approve_with_disabled_drift_detection_test.go | 2 +- controllers/tc000210_plan_encode_decode_test.go | 3 ++- ...tc000220_support_config_file_via_secret_test.go | 2 +- .../tc000230_drift_detection_only_mode_test.go | 4 ++-- ...c000241_auto_approve_with_health_checks_test.go | 2 +- controllers/tc000242_bad_health_checks_test.go | 2 +- controllers/tc000243_remediation_retry_test.go | 2 +- controllers/tc000260_runner_pod_test.go | 2 +- controllers/tc000280_inventory_test.go | 4 ++-- controllers/tc000290_force_unlock_test.go | 4 ++-- controllers/tc000300_targets_test.go | 4 ++-- ...0310_node_selector_affinity_tolerations_test.go | 2 +- controllers/tc000311_init_container_test.go | 2 +- controllers/tc000320_vol_and_vol_mounts_test.go | 2 +- .../tc000330_file_mapping_no_outputs_test.go | 2 +- .../tc000340_webhooks_for_post_planning_test.go | 4 ++-- controllers/tc000350_depends_on_test.go | 2 +- controllers/tc000360_tfvars_files_test.go | 2 +- controllers/tc009990_mtls_generate_creds_test.go | 4 ++-- controllers/tf_controller.go | 4 ++-- controllers/tf_controller_apply.go | 4 ++-- controllers/tf_controller_backend.go | 4 ++-- controllers/tf_controller_drift_detect.go | 4 ++-- controllers/tf_controller_filemapping.go | 4 ++-- controllers/tf_controller_finalizer.go | 4 ++-- controllers/tf_controller_health_checks.go | 4 ++-- controllers/tf_controller_outputs.go | 6 +++--- controllers/tf_controller_plan.go | 6 +++--- controllers/tf_controller_reconcile.go | 4 ++-- controllers/tf_controller_runner.go | 6 +++--- controllers/tf_controller_webhooks.go | 4 ++-- docs/getting_started.md | 8 ++++---- docs/tfctl.md | 2 +- .../build-and-use-a-custom-runner-image.md | 2 +- docs/use-tf-controller/flux-receiver-and-alert.md | 2 +- ...vision-resources-with-customized-runner-pods.md | 2 +- docs/use-tf-controller/with-azure.md | 2 +- go.mod | 10 +++++----- internal/config/config_test.go | 2 +- internal/config/naming_test.go | 2 +- internal/git/provider/provider_test.go | 8 ++++---- .../git/provider/providerfakes/fake_provider.go | 2 +- internal/informer/branch-planner/informer.go | 6 +++--- internal/informer/branch-planner/informer_test.go | 6 +++--- internal/informer/branch-planner/main_test.go | 2 +- internal/informer/branch-planner/options.go | 2 +- internal/server/polling/config.go | 2 +- internal/server/polling/fake_git_provider_test.go | 2 +- internal/server/polling/main_test.go | 2 +- internal/server/polling/option.go | 4 ++-- internal/server/polling/poll_test.go | 14 +++++++------- internal/server/polling/server.go | 6 +++--- internal/server/polling/server_test.go | 10 +++++----- internal/server/polling/terraform.go | 6 +++--- mkdocs.yml | 2 +- mtls/grpc.go | 5 +++-- mtls/rotator.go | 2 +- mtls/runner_serve.go | 4 ++-- planner.Dockerfile | 2 +- rfcs/README.md | 2 +- runner-base.Dockerfile | 2 +- runner/read_inputs_test.go | 7 ++++--- runner/server.go | 4 ++-- runner/server_generate_tf_vars.go | 10 +++++----- runner/server_load_tfplan.go | 7 ++++--- runner/server_load_tfplan_test.go | 4 ++-- runner/server_outputs.go | 2 +- runner/server_save_tfplan.go | 8 ++++---- runner/server_workspace_blob.go | 2 +- runner/server_workspace_blob_test.go | 2 +- runner/suite_test.go | 6 +++--- tfctl/approve_plan.go | 2 +- tfctl/break_glass.go | 2 +- tfctl/create.go | 2 +- tfctl/delete_terraform.go | 2 +- tfctl/forceUnlock.go | 2 +- tfctl/get.go | 2 +- tfctl/get_terraform.go | 2 +- tfctl/go.mod | 6 +++--- tfctl/main.go | 2 +- tfctl/reconcile.go | 2 +- tfctl/replan.go | 7 ++++--- tfctl/resume.go | 2 +- tfctl/show_plan.go | 2 +- tfctl/show_plan_test.go | 2 +- tfctl/suspend.go | 2 +- 156 files changed, 262 insertions(+), 253 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3722786a4..73586e86b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -150,7 +150,7 @@ Running the above will also deploy `source-controller` and its CRDs to the clust For realtime communications we use Slack: To join the conversation, simply join the [Weave Users](https://weave-community.slack.com/) Slack workspace and use the [#tf-controller](https://weave-community.slack.com/messages/tf-controller/) channel. -To discuss ideas and specifications we use [Github Discussions](https://github.com/weaveworks/tf-controller/discussions). +To discuss ideas and specifications we use [Github Discussions](https://github.com/flux-iac/tofu-controller/discussions). ## Acceptance policy diff --git a/Dockerfile b/Dockerfile index 160264723..e31f273f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller" +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" ARG LIBCRYPTO_VERSION diff --git a/PROJECT b/PROJECT index f0d0055e4..30e8832bc 100644 --- a/PROJECT +++ b/PROJECT @@ -2,7 +2,7 @@ domain: contrib.fluxcd.io layout: - go.kubebuilder.io/v3 projectName: test-terraform-controller -repo: github.com/weaveworks/tf-controller +repo: github.com/flux-iac/tofu-controller resources: - api: crdVersion: v1 @@ -11,7 +11,7 @@ resources: domain: contrib.fluxcd.io group: infra kind: Terraform - path: github.com/weaveworks/tf-controller/api/v1alpha1 + path: github.com/flux-iac/tofu-controller/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 @@ -20,6 +20,6 @@ resources: domain: contrib.fluxcd.io group: infra kind: Terraform - path: github.com/weaveworks/tf-controller/api/v1alpha2 + path: github.com/flux-iac/tofu-controller/api/v1alpha2 version: v1alpha2 version: "3" diff --git a/SECURITY.md b/SECURITY.md index eb0fa42f2..beeaffc5b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -28,7 +28,7 @@ Our Security Team consists of project maintainers and Weaveworks employees. ### Disclosures -Vulnerability disclosures are announced publicly through our [security advisories](https://github.com/weaveworks/tf-controller/security/advisories). +Vulnerability disclosures are announced publicly through our [security advisories](https://github.com/flux-iac/tofu-controller/security/advisories). Disclosures will contain an overview, details about the vulnerability, a fix that will typically be an update, and optionally a workaround if one is available. We will coordinate publishing disclosures and security releases in a way that is realistic and necessary for end users. diff --git a/api/go.mod b/api/go.mod index 46862f5c4..3b6e46569 100644 --- a/api/go.mod +++ b/api/go.mod @@ -1,4 +1,4 @@ -module github.com/weaveworks/tf-controller/api +module github.com/flux-iac/tofu-controller/api go 1.19 diff --git a/api/v1alpha2/terraform_types.go b/api/v1alpha2/terraform_types.go index 56db60a05..9998bda2b 100644 --- a/api/v1alpha2/terraform_types.go +++ b/api/v1alpha2/terraform_types.go @@ -24,9 +24,9 @@ import ( "time" "unicode/utf8" + "github.com/flux-iac/tofu-controller/api/planid" "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - "github.com/weaveworks/tf-controller/api/planid" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apimeta "k8s.io/apimachinery/pkg/api/meta" diff --git a/cmd/branch-planner/flags.go b/cmd/branch-planner/flags.go index af2d6503c..5185014ca 100644 --- a/cmd/branch-planner/flags.go +++ b/cmd/branch-planner/flags.go @@ -8,7 +8,7 @@ import ( "github.com/fluxcd/pkg/runtime/logger" flag "github.com/spf13/pflag" - "github.com/weaveworks/tf-controller/internal/server/polling" + "github.com/flux-iac/tofu-controller/internal/server/polling" ) type applicationOptions struct { diff --git a/cmd/branch-planner/informer.go b/cmd/branch-planner/informer.go index 850cfc65d..c2f2ebc13 100644 --- a/cmd/branch-planner/informer.go +++ b/cmd/branch-planner/informer.go @@ -5,11 +5,11 @@ import ( "fmt" "time" + tfv1alpha2 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider" + planner "github.com/flux-iac/tofu-controller/internal/informer/branch-planner" "github.com/go-logr/logr" - tfv1alpha2 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider" - planner "github.com/weaveworks/tf-controller/internal/informer/branch-planner" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/dynamic" diff --git a/cmd/branch-planner/main.go b/cmd/branch-planner/main.go index a45b98315..55e1d6727 100644 --- a/cmd/branch-planner/main.go +++ b/cmd/branch-planner/main.go @@ -5,11 +5,11 @@ import ( "os" "os/signal" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/runtime/logger" sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" "github.com/go-logr/logr" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" cgoscheme "k8s.io/client-go/kubernetes/scheme" diff --git a/cmd/branch-planner/polling.go b/cmd/branch-planner/polling.go index bd9646757..d6d8fa5b8 100644 --- a/cmd/branch-planner/polling.go +++ b/cmd/branch-planner/polling.go @@ -4,8 +4,8 @@ import ( "context" "fmt" + "github.com/flux-iac/tofu-controller/internal/server/polling" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/internal/server/polling" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 117a90b70..2e29716cc 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -20,9 +20,11 @@ import ( "os" "time" - "github.com/weaveworks/tf-controller/mtls" - "github.com/weaveworks/tf-controller/runner" + "github.com/flux-iac/tofu-controller/mtls" + "github.com/flux-iac/tofu-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/controllers" "github.com/fluxcd/pkg/runtime/acl" "github.com/fluxcd/pkg/runtime/client" runtimeCtrl "github.com/fluxcd/pkg/runtime/controller" @@ -34,8 +36,6 @@ import ( sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" flag "github.com/spf13/pflag" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/controllers" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" diff --git a/cmd/runner/main.go b/cmd/runner/main.go index 0916f9b75..15bcde577 100644 --- a/cmd/runner/main.go +++ b/cmd/runner/main.go @@ -23,9 +23,9 @@ import ( "os/signal" "syscall" + "github.com/flux-iac/tofu-controller/mtls" "github.com/fluxcd/pkg/runtime/logger" flag "github.com/spf13/pflag" - "github.com/weaveworks/tf-controller/mtls" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/cmd/tfctl/main.go b/cmd/tfctl/main.go index bb96a9f38..b698a9c2a 100644 --- a/cmd/tfctl/main.go +++ b/cmd/tfctl/main.go @@ -5,9 +5,9 @@ import ( "os" "strings" + "github.com/flux-iac/tofu-controller/tfctl" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/weaveworks/tf-controller/tfctl" "k8s.io/cli-runtime/pkg/genericclioptions" ) diff --git a/controllers/cleaner_test.go b/controllers/cleaner_test.go index 36982450a..9a29a2de4 100644 --- a/controllers/cleaner_test.go +++ b/controllers/cleaner_test.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.cgithub.com/flux-iac/tofu-controller corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/get_runner_pod_object_key_test.go b/controllers/get_runner_pod_object_key_test.go index 4875f2cd2..4cc94542c 100644 --- a/controllers/get_runner_pod_object_key_test.go +++ b/controllers/get_runner_pod_object_key_test.go @@ -1,10 +1,11 @@ package controllers import ( - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + "testing" + + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "testing" . "github.com/onsi/gomega" ) diff --git a/controllers/object_encode_test.go b/controllers/object_encode_test.go index f631432d9..aceee6f19 100644 --- a/controllers/object_encode_test.go +++ b/controllers/object_encode_test.go @@ -1,10 +1,11 @@ package controllers import ( + "testing" + + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" ) func TestObjectEncode(t *testing.T) { diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 5a8405998..a3c877ac6 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -29,8 +29,8 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/mtls" - "github.com/weaveworks/tf-controller/runner" + "github.com/flux-iac/tofu-controller/mtls" + "github.com/flux-iac/tofu-controller/runner" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" @@ -39,9 +39,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/cli-utils/pkg/kstatus/polling" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/tc000010_no_outputs_test.go b/controllers/tc000010_no_outputs_test.go index c80cd588f..d2de7b2fb 100644 --- a/controllers/tc000010_no_outputs_test.go +++ b/controllers/tc000010_no_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000011_bad_tar_gz_no_outputs_test.go b/controllers/tc000011_bad_tar_gz_no_outputs_test.go index 9c8fdf305..a3891adfe 100644 --- a/controllers/tc000011_bad_tar_gz_no_outputs_test.go +++ b/controllers/tc000011_bad_tar_gz_no_outputs_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000011_workspace_no_outputs_test.go b/controllers/tc000011_workspace_no_outputs_test.go index be321686c..603c47d15 100644 --- a/controllers/tc000011_workspace_no_outputs_test.go +++ b/controllers/tc000011_workspace_no_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000012_src_bucket_no_outputs_test.go b/controllers/tc000012_src_bucket_no_outputs_test.go index 3b8e2d2b3..258507e5f 100644 --- a/controllers/tc000012_src_bucket_no_outputs_test.go +++ b/controllers/tc000012_src_bucket_no_outputs_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" diff --git a/controllers/tc000013_source_not_found_test.go b/controllers/tc000013_source_not_found_test.go index 1dc4303f2..3716042aa 100644 --- a/controllers/tc000013_source_not_found_test.go +++ b/controllers/tc000013_source_not_found_test.go @@ -18,7 +18,7 @@ import ( . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000014_artifact_not_found_test.go b/controllers/tc000014_artifact_not_found_test.go index 5d5f47bfd..1f0b66e31 100644 --- a/controllers/tc000014_artifact_not_found_test.go +++ b/controllers/tc000014_artifact_not_found_test.go @@ -18,8 +18,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000015_cliconfigsecret_cross_ns_denied_test.go b/controllers/tc000015_cliconfigsecret_cross_ns_denied_test.go index 01d47d3d6..cf51b6989 100644 --- a/controllers/tc000015_cliconfigsecret_cross_ns_denied_test.go +++ b/controllers/tc000015_cliconfigsecret_cross_ns_denied_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000015_depends_on_cross_ns_denied_test.go b/controllers/tc000015_depends_on_cross_ns_denied_test.go index caf7bfff0..b17332d58 100644 --- a/controllers/tc000015_depends_on_cross_ns_denied_test.go +++ b/controllers/tc000015_depends_on_cross_ns_denied_test.go @@ -8,9 +8,9 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" fluxmeta "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/tc000015_source_cross_ns_denied_test.go b/controllers/tc000015_source_cross_ns_denied_test.go index a17123a95..8af3962d9 100644 --- a/controllers/tc000015_source_cross_ns_denied_test.go +++ b/controllers/tc000015_source_cross_ns_denied_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/tc000016_default_observed_generation_test.go b/controllers/tc000016_default_observed_generation_test.go index 875a53d7a..7aa242e71 100644 --- a/controllers/tc000016_default_observed_generation_test.go +++ b/controllers/tc000016_default_observed_generation_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/tc000016_finilize_status_test.go b/controllers/tc000016_finilize_status_test.go index c446532cb..e090b4f2f 100644 --- a/controllers/tc000016_finilize_status_test.go +++ b/controllers/tc000016_finilize_status_test.go @@ -9,7 +9,7 @@ import ( sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/tc000020_with_backend_no_outputs_test.go b/controllers/tc000020_with_backend_no_outputs_test.go index a601df608..f7e8b2a80 100644 --- a/controllers/tc000020_with_backend_no_outputs_test.go +++ b/controllers/tc000020_with_backend_no_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000020_with_workspace_no_outputs_test.go b/controllers/tc000020_with_workspace_no_outputs_test.go index 4fe2f9a86..b73261fcf 100644 --- a/controllers/tc000020_with_workspace_no_outputs_test.go +++ b/controllers/tc000020_with_workspace_no_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000030_plan_only_no_outputs_test.go b/controllers/tc000030_plan_only_no_outputs_test.go index 04eb801db..22663ebbe 100644 --- a/controllers/tc000030_plan_only_no_outputs_test.go +++ b/controllers/tc000030_plan_only_no_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000031_plan_only_with_showplan_as_cm_no_outputs_test.go b/controllers/tc000031_plan_only_with_showplan_as_cm_no_outputs_test.go index a1a623e69..c179ef7c6 100644 --- a/controllers/tc000031_plan_only_with_showplan_as_cm_no_outputs_test.go +++ b/controllers/tc000031_plan_only_with_showplan_as_cm_no_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000040_controlled_outputs_test.go b/controllers/tc000040_controlled_outputs_test.go index 0447e93f1..7e51dfc23 100644 --- a/controllers/tc000040_controlled_outputs_test.go +++ b/controllers/tc000040_controlled_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000041_all_outputs_test.go b/controllers/tc000041_all_outputs_test.go index 1a11f122d..47aed2ff1 100644 --- a/controllers/tc000041_all_outputs_test.go +++ b/controllers/tc000041_all_outputs_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000042_output_name_contains_dot_test.go b/controllers/tc000042_output_name_contains_dot_test.go index 715e1e162..298e26027 100644 --- a/controllers/tc000042_output_name_contains_dot_test.go +++ b/controllers/tc000042_output_name_contains_dot_test.go @@ -2,14 +2,15 @@ package controllers import ( "context" - corev1 "k8s.io/api/core/v1" "testing" "time" + corev1 "k8s.io/api/core/v1" + . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000043_controlled_outputs_should_be_reconciled_test.go b/controllers/tc000043_controlled_outputs_should_be_reconciled_test.go index 7aa7ba3f2..36b30ae3e 100644 --- a/controllers/tc000043_controlled_outputs_should_be_reconciled_test.go +++ b/controllers/tc000043_controlled_outputs_should_be_reconciled_test.go @@ -2,14 +2,15 @@ package controllers import ( "context" - corev1 "k8s.io/api/core/v1" "testing" "time" + corev1 "k8s.io/api/core/v1" + . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000044_plan_only_mode_test.go b/controllers/tc000044_plan_only_mode_test.go index c938b38fd..236de36b9 100644 --- a/controllers/tc000044_plan_only_mode_test.go +++ b/controllers/tc000044_plan_only_mode_test.go @@ -10,8 +10,8 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000050_plan_and_manual_approve_no_outputs_test.go b/controllers/tc000050_plan_and_manual_approve_no_outputs_test.go index 55d32252e..001b2a233 100644 --- a/controllers/tc000050_plan_and_manual_approve_no_outputs_test.go +++ b/controllers/tc000050_plan_and_manual_approve_no_outputs_test.go @@ -4,9 +4,9 @@ import ( "os" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000051_plan_and_manual_approve_and_replan_no_outputs_test.go b/controllers/tc000051_plan_and_manual_approve_and_replan_no_outputs_test.go index a1295e197..a5d4ac39d 100644 --- a/controllers/tc000051_plan_and_manual_approve_and_replan_no_outputs_test.go +++ b/controllers/tc000051_plan_and_manual_approve_and_replan_no_outputs_test.go @@ -4,9 +4,9 @@ import ( "os" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000052_plan_and_manual_approve_with_files_test.go b/controllers/tc000052_plan_and_manual_approve_with_files_test.go index dff5a2aa7..491f35cb9 100644 --- a/controllers/tc000052_plan_and_manual_approve_with_files_test.go +++ b/controllers/tc000052_plan_and_manual_approve_with_files_test.go @@ -3,10 +3,10 @@ package controllers import ( "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000060_vars_and_controlled_outputs_test.go b/controllers/tc000060_vars_and_controlled_outputs_test.go index f6f86787c..5ef8b3f92 100644 --- a/controllers/tc000060_vars_and_controlled_outputs_test.go +++ b/controllers/tc000060_vars_and_controlled_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000061_vars_hcl_input_test.go b/controllers/tc000061_vars_hcl_input_test.go index 0048d1216..674924934 100644 --- a/controllers/tc000061_vars_hcl_input_test.go +++ b/controllers/tc000061_vars_hcl_input_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000062_vars_hcl_test.go b/controllers/tc000062_vars_hcl_test.go index e18ea18de..26d80e6bb 100644 --- a/controllers/tc000062_vars_hcl_test.go +++ b/controllers/tc000062_vars_hcl_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000063_values_hcl_test.go b/controllers/tc000063_values_hcl_test.go index d25be6733..da8fe5466 100644 --- a/controllers/tc000063_values_hcl_test.go +++ b/controllers/tc000063_values_hcl_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000064_values_template_hcl_test.go b/controllers/tc000064_values_template_hcl_test.go index 0c3ad1ee2..949f36658 100644 --- a/controllers/tc000064_values_template_hcl_test.go +++ b/controllers/tc000064_values_template_hcl_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000070_varsfrom_secret_and_controlled_outputs_test.go b/controllers/tc000070_varsfrom_secret_and_controlled_outputs_test.go index 113736dec..afab1d3a1 100644 --- a/controllers/tc000070_varsfrom_secret_and_controlled_outputs_test.go +++ b/controllers/tc000070_varsfrom_secret_and_controlled_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000071_varsfrom_secret_with_varkeys_and_controlled_outputs_test.go b/controllers/tc000071_varsfrom_secret_with_varkeys_and_controlled_outputs_test.go index 5510a62fa..391f4d5a3 100644 --- a/controllers/tc000071_varsfrom_secret_with_varkeys_and_controlled_outputs_test.go +++ b/controllers/tc000071_varsfrom_secret_with_varkeys_and_controlled_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000072_varsfrom_optional_secret_controlled_outputs_test.go b/controllers/tc000072_varsfrom_optional_secret_controlled_outputs_test.go index 331480979..64a782b5f 100644 --- a/controllers/tc000072_varsfrom_optional_secret_controlled_outputs_test.go +++ b/controllers/tc000072_varsfrom_optional_secret_controlled_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000073_varsfrom_accepts_many_secrets_outputs_test.go b/controllers/tc000073_varsfrom_accepts_many_secrets_outputs_test.go index 6b13d8e04..55bb80f5b 100644 --- a/controllers/tc000073_varsfrom_accepts_many_secrets_outputs_test.go +++ b/controllers/tc000073_varsfrom_accepts_many_secrets_outputs_test.go @@ -7,8 +7,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000074_varsfrom_accepts_many_secrets_with_last_supplied_key_precedence_test.go b/controllers/tc000074_varsfrom_accepts_many_secrets_with_last_supplied_key_precedence_test.go index 425d6eb11..3b018cc89 100644 --- a/controllers/tc000074_varsfrom_accepts_many_secrets_with_last_supplied_key_precedence_test.go +++ b/controllers/tc000074_varsfrom_accepts_many_secrets_with_last_supplied_key_precedence_test.go @@ -8,12 +8,12 @@ import ( "path/filepath" "testing" + "github.com/flux-iac/tofu-controller/runner" "github.com/google/uuid" - "github.com/weaveworks/tf-controller/runner" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/tc000075_varsfrom_secret_with_varkeys_rename_and_controlled_outputs_test.go b/controllers/tc000075_varsfrom_secret_with_varkeys_rename_and_controlled_outputs_test.go index fc8476d8f..c53c1f36e 100644 --- a/controllers/tc000075_varsfrom_secret_with_varkeys_rename_and_controlled_outputs_test.go +++ b/controllers/tc000075_varsfrom_secret_with_varkeys_rename_and_controlled_outputs_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000080_varsfrom_configmap_and_controlled_outputs_test.go b/controllers/tc000080_varsfrom_configmap_and_controlled_outputs_test.go index 1e62af0ba..712950760 100644 --- a/controllers/tc000080_varsfrom_configmap_and_controlled_outputs_test.go +++ b/controllers/tc000080_varsfrom_configmap_and_controlled_outputs_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000081_varsfrom_accepts_many_configmap_controlled_outputs_test.go b/controllers/tc000081_varsfrom_accepts_many_configmap_controlled_outputs_test.go index 64f2ae017..afa84cf35 100644 --- a/controllers/tc000081_varsfrom_accepts_many_configmap_controlled_outputs_test.go +++ b/controllers/tc000081_varsfrom_accepts_many_configmap_controlled_outputs_test.go @@ -7,8 +7,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000082_varsfrom_accepts_many_configmaps_with_last_supplied_key_precedence_test.go b/controllers/tc000082_varsfrom_accepts_many_configmaps_with_last_supplied_key_precedence_test.go index e9fe98c7a..c7e2a19d2 100644 --- a/controllers/tc000082_varsfrom_accepts_many_configmaps_with_last_supplied_key_precedence_test.go +++ b/controllers/tc000082_varsfrom_accepts_many_configmaps_with_last_supplied_key_precedence_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" . "github.com/onsi/gomega" diff --git a/controllers/tc000090_varsfrom_override_and_controlled_outputs_test.go b/controllers/tc000090_varsfrom_override_and_controlled_outputs_test.go index 515a1566a..698698c44 100644 --- a/controllers/tc000090_varsfrom_override_and_controlled_outputs_test.go +++ b/controllers/tc000090_varsfrom_override_and_controlled_outputs_test.go @@ -7,8 +7,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000100_applied_should_tx_to_plan_when_source_changed_test.go b/controllers/tc000100_applied_should_tx_to_plan_when_source_changed_test.go index c0b75bafe..6178e8147 100644 --- a/controllers/tc000100_applied_should_tx_to_plan_when_source_changed_test.go +++ b/controllers/tc000100_applied_should_tx_to_plan_when_source_changed_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000110_auto_applied_should_tx_to_plan_then_apply_when_source_changed_test.go b/controllers/tc000110_auto_applied_should_tx_to_plan_then_apply_when_source_changed_test.go index 36b2e006d..8e04bd598 100644 --- a/controllers/tc000110_auto_applied_should_tx_to_plan_then_apply_when_source_changed_test.go +++ b/controllers/tc000110_auto_applied_should_tx_to_plan_then_apply_when_source_changed_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000111_with_backend_s3_no_outputs_test.go b/controllers/tc000111_with_backend_s3_no_outputs_test.go index e10f68822..5942dabfe 100644 --- a/controllers/tc000111_with_backend_s3_no_outputs_test.go +++ b/controllers/tc000111_with_backend_s3_no_outputs_test.go @@ -16,9 +16,9 @@ import ( types2 "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/elgohr/go-localstack" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000120_delete_test.go b/controllers/tc000120_delete_test.go index e6aeecbf8..d49a5228c 100644 --- a/controllers/tc000120_delete_test.go +++ b/controllers/tc000120_delete_test.go @@ -9,8 +9,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000121_destroy_on_delete_test.go b/controllers/tc000121_destroy_on_delete_test.go index 8f62e3e9b..b96f7cd75 100644 --- a/controllers/tc000121_destroy_on_delete_test.go +++ b/controllers/tc000121_destroy_on_delete_test.go @@ -10,9 +10,9 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000130_destroy_no_outputs_test.go b/controllers/tc000130_destroy_no_outputs_test.go index 0636b9830..e69b3150a 100644 --- a/controllers/tc000130_destroy_no_outputs_test.go +++ b/controllers/tc000130_destroy_no_outputs_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" apierrors "k8s.io/apimachinery/pkg/api/errors" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000131_destroy_no_changes_test.go b/controllers/tc000131_destroy_no_changes_test.go index 4c0389133..6bd20ac6c 100644 --- a/controllers/tc000131_destroy_no_changes_test.go +++ b/controllers/tc000131_destroy_no_changes_test.go @@ -9,9 +9,9 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000140_auto_applied_should_tx_to_plan_then_apply_when_drift_detected_test.go b/controllers/tc000140_auto_applied_should_tx_to_plan_then_apply_when_drift_detected_test.go index 7f35add29..a1a15de7c 100644 --- a/controllers/tc000140_auto_applied_should_tx_to_plan_then_apply_when_drift_detected_test.go +++ b/controllers/tc000140_auto_applied_should_tx_to_plan_then_apply_when_drift_detected_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000150_manual_apply_should_report_and_loop_when_drift_detected_test.go b/controllers/tc000150_manual_apply_should_report_and_loop_when_drift_detected_test.go index e46d53b94..9bcc04107 100644 --- a/controllers/tc000150_manual_apply_should_report_and_loop_when_drift_detected_test.go +++ b/controllers/tc000150_manual_apply_should_report_and_loop_when_drift_detected_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000160_auto_applied_should_tx_to_plan_when_unrelated_source_changed_test.go b/controllers/tc000160_auto_applied_should_tx_to_plan_when_unrelated_source_changed_test.go index 1d5231b00..52c3a23dd 100644 --- a/controllers/tc000160_auto_applied_should_tx_to_plan_when_unrelated_source_changed_test.go +++ b/controllers/tc000160_auto_applied_should_tx_to_plan_when_unrelated_source_changed_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000170_if_apply_error_we_should_delete_the_plan_and_start_over_test.go b/controllers/tc000170_if_apply_error_we_should_delete_the_plan_and_start_over_test.go index 135cdd779..e30b5ccfe 100644 --- a/controllers/tc000170_if_apply_error_we_should_delete_the_plan_and_start_over_test.go +++ b/controllers/tc000170_if_apply_error_we_should_delete_the_plan_and_start_over_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000180_should_detect_drift_test.go b/controllers/tc000180_should_detect_drift_test.go index b0657d14f..2494a0849 100644 --- a/controllers/tc000180_should_detect_drift_test.go +++ b/controllers/tc000180_should_detect_drift_test.go @@ -3,8 +3,8 @@ package controllers import ( "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" ) // +kubebuilder:docs-gen:collapse=Imports diff --git a/controllers/tc000190_unsupported_source_should_error_test.go b/controllers/tc000190_unsupported_source_should_error_test.go index 6b2e082b3..d40ec65df 100644 --- a/controllers/tc000190_unsupported_source_should_error_test.go +++ b/controllers/tc000190_unsupported_source_should_error_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/tc000191_missing_source_should_error_test.go b/controllers/tc000191_missing_source_should_error_test.go index 3492dbf82..cc621c188 100644 --- a/controllers/tc000191_missing_source_should_error_test.go +++ b/controllers/tc000191_missing_source_should_error_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/tc000200_disable_drift_detection_test.go b/controllers/tc000200_disable_drift_detection_test.go index 5add69539..4255a3489 100644 --- a/controllers/tc000200_disable_drift_detection_test.go +++ b/controllers/tc000200_disable_drift_detection_test.go @@ -3,8 +3,8 @@ package controllers import ( "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" ) // +kubebuilder:docs-gen:collapse=Imports diff --git a/controllers/tc000201_auto_approve_with_disabled_drift_detection_test.go b/controllers/tc000201_auto_approve_with_disabled_drift_detection_test.go index 4dbbab1c2..06fb02902 100644 --- a/controllers/tc000201_auto_approve_with_disabled_drift_detection_test.go +++ b/controllers/tc000201_auto_approve_with_disabled_drift_detection_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000210_plan_encode_decode_test.go b/controllers/tc000210_plan_encode_decode_test.go index 24bf2868b..377e73166 100644 --- a/controllers/tc000210_plan_encode_decode_test.go +++ b/controllers/tc000210_plan_encode_decode_test.go @@ -3,10 +3,11 @@ package controllers import ( "bytes" "compress/gzip" - "github.com/weaveworks/tf-controller/utils" "io/ioutil" "testing" + "github.com/flux-iac/tofu-controller/utils" + . "github.com/onsi/gomega" ) diff --git a/controllers/tc000220_support_config_file_via_secret_test.go b/controllers/tc000220_support_config_file_via_secret_test.go index 4f65451fe..e2871e656 100644 --- a/controllers/tc000220_support_config_file_via_secret_test.go +++ b/controllers/tc000220_support_config_file_via_secret_test.go @@ -12,8 +12,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000230_drift_detection_only_mode_test.go b/controllers/tc000230_drift_detection_only_mode_test.go index a5e7c2bc3..de4ddc1cc 100644 --- a/controllers/tc000230_drift_detection_only_mode_test.go +++ b/controllers/tc000230_drift_detection_only_mode_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000241_auto_approve_with_health_checks_test.go b/controllers/tc000241_auto_approve_with_health_checks_test.go index 0f46a5917..7169d0f82 100644 --- a/controllers/tc000241_auto_approve_with_health_checks_test.go +++ b/controllers/tc000241_auto_approve_with_health_checks_test.go @@ -8,10 +8,10 @@ import ( corev1 "k8s.io/api/core/v1" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" gs "github.com/onsi/gomega/gstruct" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000242_bad_health_checks_test.go b/controllers/tc000242_bad_health_checks_test.go index 129010989..38bcff1e9 100644 --- a/controllers/tc000242_bad_health_checks_test.go +++ b/controllers/tc000242_bad_health_checks_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tc000243_remediation_retry_test.go b/controllers/tc000243_remediation_retry_test.go index 0bb16af60..21045d32f 100644 --- a/controllers/tc000243_remediation_retry_test.go +++ b/controllers/tc000243_remediation_retry_test.go @@ -9,9 +9,9 @@ import ( . "github.com/onsi/gomega" controllerruntime "sigs.k8s.io/controller-runtime" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000260_runner_pod_test.go b/controllers/tc000260_runner_pod_test.go index 0dca82876..6c4ebd81b 100644 --- a/controllers/tc000260_runner_pod_test.go +++ b/controllers/tc000260_runner_pod_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000280_inventory_test.go b/controllers/tc000280_inventory_test.go index 866721ca3..b736a1bd0 100644 --- a/controllers/tc000280_inventory_test.go +++ b/controllers/tc000280_inventory_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/utils" + "github.com/flux-iac/tofu-controller/utils" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000290_force_unlock_test.go b/controllers/tc000290_force_unlock_test.go index 3962b91f1..40bf85a04 100644 --- a/controllers/tc000290_force_unlock_test.go +++ b/controllers/tc000290_force_unlock_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000300_targets_test.go b/controllers/tc000300_targets_test.go index 816cd82ca..636f011a1 100644 --- a/controllers/tc000300_targets_test.go +++ b/controllers/tc000300_targets_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/tc000310_node_selector_affinity_tolerations_test.go b/controllers/tc000310_node_selector_affinity_tolerations_test.go index 70af18379..34db22c2a 100644 --- a/controllers/tc000310_node_selector_affinity_tolerations_test.go +++ b/controllers/tc000310_node_selector_affinity_tolerations_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000311_init_container_test.go b/controllers/tc000311_init_container_test.go index d1e5d3777..519bf31af 100644 --- a/controllers/tc000311_init_container_test.go +++ b/controllers/tc000311_init_container_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000320_vol_and_vol_mounts_test.go b/controllers/tc000320_vol_and_vol_mounts_test.go index b37fc988f..3a25abf2a 100644 --- a/controllers/tc000320_vol_and_vol_mounts_test.go +++ b/controllers/tc000320_vol_and_vol_mounts_test.go @@ -8,8 +8,8 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000330_file_mapping_no_outputs_test.go b/controllers/tc000330_file_mapping_no_outputs_test.go index 9c29c6113..c45e75189 100644 --- a/controllers/tc000330_file_mapping_no_outputs_test.go +++ b/controllers/tc000330_file_mapping_no_outputs_test.go @@ -7,9 +7,9 @@ import ( . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000340_webhooks_for_post_planning_test.go b/controllers/tc000340_webhooks_for_post_planning_test.go index 7291d678e..81cd313e2 100644 --- a/controllers/tc000340_webhooks_for_post_planning_test.go +++ b/controllers/tc000340_webhooks_for_post_planning_test.go @@ -10,9 +10,9 @@ import ( "github.com/google/uuid" . "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" "google.golang.org/grpc" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000350_depends_on_test.go b/controllers/tc000350_depends_on_test.go index 5e86d5de8..163832c16 100644 --- a/controllers/tc000350_depends_on_test.go +++ b/controllers/tc000350_depends_on_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc000360_tfvars_files_test.go b/controllers/tc000360_tfvars_files_test.go index bc2e42efb..fd099bfcc 100644 --- a/controllers/tc000360_tfvars_files_test.go +++ b/controllers/tc000360_tfvars_files_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tc009990_mtls_generate_creds_test.go b/controllers/tc009990_mtls_generate_creds_test.go index de5841a2d..56386e143 100644 --- a/controllers/tc009990_mtls_generate_creds_test.go +++ b/controllers/tc009990_mtls_generate_creds_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/mtls" sourcev1 "github.com/fluxcd/source-controller/api/v1" . "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/mtls" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tf_controller.go b/controllers/tf_controller.go index d307e1d37..593f4bd07 100644 --- a/controllers/tf_controller.go +++ b/controllers/tf_controller.go @@ -27,6 +27,8 @@ import ( "strings" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/mtls" eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/runtime/acl" @@ -40,8 +42,6 @@ import ( sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" "github.com/google/uuid" "github.com/hashicorp/go-retryablehttp" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/mtls" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" diff --git a/controllers/tf_controller_apply.go b/controllers/tf_controller_apply.go index 83dbad264..d18229895 100644 --- a/controllers/tf_controller_apply.go +++ b/controllers/tf_controller_apply.go @@ -7,8 +7,8 @@ import ( eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/tf_controller_backend.go b/controllers/tf_controller_backend.go index 3e26116a1..f9534eb90 100644 --- a/controllers/tf_controller_backend.go +++ b/controllers/tf_controller_backend.go @@ -6,10 +6,10 @@ import ( "os" "strings" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "github.com/fluxcd/pkg/runtime/acl" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" "google.golang.org/grpc/status" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tf_controller_drift_detect.go b/controllers/tf_controller_drift_detect.go index 985a6f4e3..0fd64dfc2 100644 --- a/controllers/tf_controller_drift_detect.go +++ b/controllers/tf_controller_drift_detect.go @@ -7,8 +7,8 @@ import ( eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "google.golang.org/grpc/status" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/controllers/tf_controller_filemapping.go b/controllers/tf_controller_filemapping.go index 38ebc3592..3090a2d91 100644 --- a/controllers/tf_controller_filemapping.go +++ b/controllers/tf_controller_filemapping.go @@ -3,8 +3,8 @@ package controllers import ( "context" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/controllers/tf_controller_finalizer.go b/controllers/tf_controller_finalizer.go index bbe7c866a..ac6bff1e2 100644 --- a/controllers/tf_controller_finalizer.go +++ b/controllers/tf_controller_finalizer.go @@ -7,10 +7,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "github.com/fluxcd/pkg/runtime/logger" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/tf_controller_health_checks.go b/controllers/tf_controller_health_checks.go index 3ead56f9f..386f1bcfc 100644 --- a/controllers/tf_controller_health_checks.go +++ b/controllers/tf_controller_health_checks.go @@ -15,10 +15,10 @@ import ( "time" "unicode" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" "github.com/fluxcd/pkg/runtime/logger" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/controllers/tf_controller_outputs.go b/controllers/tf_controller_outputs.go index cca9af554..fa1aa4464 100644 --- a/controllers/tf_controller_outputs.go +++ b/controllers/tf_controller_outputs.go @@ -6,11 +6,11 @@ import ( "sort" "strings" + "github.com/flux-iac/tofu-controller/api/typeinfo" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" "github.com/hashicorp/terraform-exec/tfexec" - "github.com/weaveworks/tf-controller/api/typeinfo" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" "github.com/zclconf/go-cty/cty" ctyjson "github.com/zclconf/go-cty/cty/json" corev1 "k8s.io/api/core/v1" diff --git a/controllers/tf_controller_plan.go b/controllers/tf_controller_plan.go index d343a8aa5..43dc2db21 100644 --- a/controllers/tf_controller_plan.go +++ b/controllers/tf_controller_plan.go @@ -4,11 +4,11 @@ import ( "context" "fmt" + "github.com/flux-iac/tofu-controller/api/planid" eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" - "github.com/weaveworks/tf-controller/api/planid" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/tf_controller_reconcile.go b/controllers/tf_controller_reconcile.go index aaeb7ac1e..11f6a1c27 100644 --- a/controllers/tf_controller_reconcile.go +++ b/controllers/tf_controller_reconcile.go @@ -22,10 +22,10 @@ import ( "strings" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/tf_controller_runner.go b/controllers/tf_controller_runner.go index dae37ba09..fab41ad83 100644 --- a/controllers/tf_controller_runner.go +++ b/controllers/tf_controller_runner.go @@ -7,10 +7,10 @@ import ( "strings" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/mtls" + "github.com/flux-iac/tofu-controller/runner" "github.com/fluxcd/pkg/runtime/logger" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/mtls" - "github.com/weaveworks/tf-controller/runner" "google.golang.org/grpc" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" diff --git a/controllers/tf_controller_webhooks.go b/controllers/tf_controller_webhooks.go index 8927417f8..479cc9815 100644 --- a/controllers/tf_controller_webhooks.go +++ b/controllers/tf_controller_webhooks.go @@ -14,9 +14,9 @@ import ( "strings" "text/template" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" "github.com/hashicorp/go-cleanhttp" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/kustomize/kyaml/yaml" ) diff --git a/docs/getting_started.md b/docs/getting_started.md index 692497a7f..911c757a7 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -85,15 +85,15 @@ helm upgrade -i tf-controller tf-controller/tf-controller \ ``` For details on configurable parameters of the TF-controller chart, -please see [chart readme](https://github.com/weaveworks/tf-controller/tree/main/charts/tf-controller#tf-controller-for-flux). +please see [chart readme](https://github.com/flux-iac/tofu-controller/tree/main/charts/tf-controller#tf-controller-for-flux). Alternatively, you can install TF-controller via `kubectl`: ```shell export TF_CON_VER=v0.15.1 -kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.crds.yaml -kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.rbac.yaml -kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.deployment.yaml +kubectl apply -f https://github.com/flux-iac/tofu-controller/releases/download/${TF_CON_VER}/tf-controller.crds.yaml +kubectl apply -f https://github.com/flux-iac/tofu-controller/releases/download/${TF_CON_VER}/tf-controller.rbac.yaml +kubectl apply -f https://github.com/flux-iac/tofu-controller/releases/download/${TF_CON_VER}/tf-controller.deployment.yaml ``` ## Quick start diff --git a/docs/tfctl.md b/docs/tfctl.md index 4904b8233..90fcccf2e 100644 --- a/docs/tfctl.md +++ b/docs/tfctl.md @@ -10,7 +10,7 @@ To install `tfctl` via Homebrew, run the following command: brew install weaveworks/tap/tfctl ``` -You can also download the `tfctl` binary via the GitHub releases page: [https://github.com/weaveworks/tf-controller/releases](https://github.com/weaveworks/tf-controller/releases). +You can also download the `tfctl` binary via the GitHub releases page: [https://github.com/flux-iac/tofu-controller/releases](https://github.com/flux-iac/tofu-controller/releases). ``` Usage: diff --git a/docs/use-tf-controller/build-and-use-a-custom-runner-image.md b/docs/use-tf-controller/build-and-use-a-custom-runner-image.md index e6fa7a61b..aa5e122dd 100644 --- a/docs/use-tf-controller/build-and-use-a-custom-runner-image.md +++ b/docs/use-tf-controller/build-and-use-a-custom-runner-image.md @@ -29,7 +29,7 @@ RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin/ USER 65532:65532 ``` -Find the original Dockerfile for the runner [here](https://github.com/weaveworks/tf-controller/blob/89e0c7edde91efebba825b31e9f0ef3cc583684b/runner.Dockerfile). +Find the original Dockerfile for the runner [here](https://github.com/flux-iac/tofu-controller/blob/89e0c7edde91efebba825b31e9f0ef3cc583684b/runner.Dockerfile). 2. Build the image from the directory containing the `Dockerfile` you created above: diff --git a/docs/use-tf-controller/flux-receiver-and-alert.md b/docs/use-tf-controller/flux-receiver-and-alert.md index a3928a0e1..f7e138651 100644 --- a/docs/use-tf-controller/flux-receiver-and-alert.md +++ b/docs/use-tf-controller/flux-receiver-and-alert.md @@ -10,7 +10,7 @@ installation's bootstrap manifests. Find it under the `flux-system` directory. ### Enable Notifications for Third-Party Controllers -Enable notifications for 3rd party Flux controllers such as [tf-controller](https://github.com/weaveworks/tf-controller): +Enable notifications for 3rd party Flux controllers such as [tf-controller](https://github.com/flux-iac/tofu-controller): ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 diff --git a/docs/use-tf-controller/provision-resources-with-customized-runner-pods.md b/docs/use-tf-controller/provision-resources-with-customized-runner-pods.md index d90b2e88f..29b6e9ea6 100644 --- a/docs/use-tf-controller/provision-resources-with-customized-runner-pods.md +++ b/docs/use-tf-controller/provision-resources-with-customized-runner-pods.md @@ -51,7 +51,7 @@ spec: image: registry.io/tf-runner:xyz ``` -You can use [`runner.Dockerfile`](https://github.com/weaveworks/tf-controller/blob/main/runner.Dockerfile) as a basis of customizing runner pod image. +You can use [`runner.Dockerfile`](https://github.com/flux-iac/tofu-controller/blob/main/runner.Dockerfile) as a basis of customizing runner pod image. ## Customize Runner Pod Specifications diff --git a/docs/use-tf-controller/with-azure.md b/docs/use-tf-controller/with-azure.md index 8ee7591dc..09bcfb57d 100644 --- a/docs/use-tf-controller/with-azure.md +++ b/docs/use-tf-controller/with-azure.md @@ -1,6 +1,6 @@ ## Use TF-Controller with Azure -This content was [provided](https://github.com/weaveworks/tf-controller/issues/561) by users [@mingmingshiliyu](https://github.com/mingmingshiliyu) and [@maciekdude](https://github.com/maciekdude). +This content was [provided](https://github.com/flux-iac/tofu-controller/issues/561) by users [@mingmingshiliyu](https://github.com/mingmingshiliyu) and [@maciekdude](https://github.com/maciekdude). Use the OIDC flag and explicitly point to the token. Due to a bug in AzureRM 3.44.x, use version 3.47.x or later. diff --git a/go.mod b/go.mod index eb1641206..e75ebb869 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module github.com/weaveworks/tf-controller +module github.com/flux-iac/tofu-controller go 1.20 -replace github.com/weaveworks/tf-controller/api => ./api +replace github.com/flux-iac/tofu-controller/api => ./api -replace github.com/weaveworks/tf-controller/tfctl => ./tfctl +replace github.com/flux-iac/tofu-controller/tfctl => ./tfctl require ( github.com/Masterminds/sprig/v3 v3.2.3 @@ -15,6 +15,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.38.5 github.com/cyphar/filepath-securejoin v0.2.4 github.com/elgohr/go-localstack v1.0.20 + github.com/flux-iac/tofu-controller/api v0.0.0-00010101000000-000000000000 + github.com/flux-iac/tofu-controller/tfctl v0.0.0-00010101000000-000000000000 github.com/fluxcd/pkg/apis/event v0.6.0 github.com/fluxcd/pkg/apis/meta v1.2.0 github.com/fluxcd/pkg/runtime v0.43.2 @@ -37,8 +39,6 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 - github.com/weaveworks/tf-controller/api v0.0.0-00010101000000-000000000000 - github.com/weaveworks/tf-controller/tfctl v0.0.0-00010101000000-000000000000 github.com/zclconf/go-cty v1.14.1 golang.org/x/net v0.19.0 google.golang.org/grpc v1.56.3 diff --git a/internal/config/config_test.go b/internal/config/config_test.go index df4b67d14..401a5121c 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" + "github.com/flux-iac/tofu-controller/internal/config" "github.com/onsi/gomega" - "github.com/weaveworks/tf-controller/internal/config" "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/config/naming_test.go b/internal/config/naming_test.go index 4d10a202c..1ea4c8b54 100644 --- a/internal/config/naming_test.go +++ b/internal/config/naming_test.go @@ -3,8 +3,8 @@ package config_test import ( "testing" + "github.com/flux-iac/tofu-controller/internal/config" gm "github.com/onsi/gomega" - "github.com/weaveworks/tf-controller/internal/config" ) func Test_PullRequestObjectName(t *testing.T) { diff --git a/internal/git/provider/provider_test.go b/internal/git/provider/provider_test.go index 94c0174a8..755e7e0ec 100644 --- a/internal/git/provider/provider_test.go +++ b/internal/git/provider/provider_test.go @@ -3,8 +3,8 @@ package provider_test import ( "testing" + "github.com/flux-iac/tofu-controller/internal/git/provider" "github.com/stretchr/testify/assert" - "github.com/weaveworks/tf-controller/internal/git/provider" ) func TestFromURL(t *testing.T) { @@ -16,17 +16,17 @@ func TestFromURL(t *testing.T) { shouldError bool }{ { - url: "https://github.com/weaveworks/tf-controller", + url: "https://github.com/flux-iac/tofu-controller", repoOrg: "weaveworks", repoName: "tf-controller", }, { - url: "https://github.com/weaveworks/tf-controller.git", + url: "https://github.com/flux-iac/tofu-controller.git", repoOrg: "weaveworks", repoName: "tf-controller", }, { - url: "ssh://git@github.com/weaveworks/tf-controller.git", + url: "ssh://git@github.com/flux-iac/tofu-controller.git", repoOrg: "weaveworks", repoName: "tf-controller", }, diff --git a/internal/git/provider/providerfakes/fake_provider.go b/internal/git/provider/providerfakes/fake_provider.go index 4e7c44257..c2793d632 100644 --- a/internal/git/provider/providerfakes/fake_provider.go +++ b/internal/git/provider/providerfakes/fake_provider.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/internal/git/provider" + "github.com/flux-iac/tofu-controller/internal/git/provider" ) type FakeProvider struct { diff --git a/internal/informer/branch-planner/informer.go b/internal/informer/branch-planner/informer.go index 85a5b42ef..bb2a46662 100644 --- a/internal/informer/branch-planner/informer.go +++ b/internal/informer/branch-planner/informer.go @@ -10,12 +10,12 @@ import ( "sync" "text/template" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider" sourcev1 "github.com/fluxcd/source-controller/api/v1" "github.com/go-logr/logr" giturl "github.com/kubescape/go-git-url" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/internal/informer/branch-planner/informer_test.go b/internal/informer/branch-planner/informer_test.go index f88bac9eb..e2a30de2d 100644 --- a/internal/informer/branch-planner/informer_test.go +++ b/internal/informer/branch-planner/informer_test.go @@ -10,10 +10,10 @@ import ( gom "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/client" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider/providerfakes" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider/providerfakes" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/dynamic" diff --git a/internal/informer/branch-planner/main_test.go b/internal/informer/branch-planner/main_test.go index acdcbb960..7d1c75c22 100644 --- a/internal/informer/branch-planner/main_test.go +++ b/internal/informer/branch-planner/main_test.go @@ -14,8 +14,8 @@ import ( "github.com/onsi/gomega" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" ) diff --git a/internal/informer/branch-planner/options.go b/internal/informer/branch-planner/options.go index 4fdd33123..5ac0ce6b8 100644 --- a/internal/informer/branch-planner/options.go +++ b/internal/informer/branch-planner/options.go @@ -1,8 +1,8 @@ package branchplanner import ( + "github.com/flux-iac/tofu-controller/internal/git/provider" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/internal/git/provider" "k8s.io/client-go/tools/cache" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/internal/server/polling/config.go b/internal/server/polling/config.go index d5b537dc5..f8055a6c7 100644 --- a/internal/server/polling/config.go +++ b/internal/server/polling/config.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/weaveworks/tf-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/config" ) const DefaultConfigMapName = "branch-planner" diff --git a/internal/server/polling/fake_git_provider_test.go b/internal/server/polling/fake_git_provider_test.go index 77e291b1b..533802981 100644 --- a/internal/server/polling/fake_git_provider_test.go +++ b/internal/server/polling/fake_git_provider_test.go @@ -3,8 +3,8 @@ package polling_test import ( "fmt" + "github.com/flux-iac/tofu-controller/internal/git/provider" giturl "github.com/kubescape/go-git-url" - "github.com/weaveworks/tf-controller/internal/git/provider" ) func mockedProvider(gitProvider provider.Provider) provider.URLParserFn { diff --git a/internal/server/polling/main_test.go b/internal/server/polling/main_test.go index c48098e6d..61f4dd6bc 100644 --- a/internal/server/polling/main_test.go +++ b/internal/server/polling/main_test.go @@ -13,8 +13,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" ) var ( diff --git a/internal/server/polling/option.go b/internal/server/polling/option.go index 1f6403dad..9b466cbd9 100644 --- a/internal/server/polling/option.go +++ b/internal/server/polling/option.go @@ -4,9 +4,9 @@ import ( "fmt" "time" + "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/internal/server/polling/poll_test.go b/internal/server/polling/poll_test.go index f3c488348..dbb6b0dc6 100644 --- a/internal/server/polling/poll_test.go +++ b/internal/server/polling/poll_test.go @@ -4,20 +4,20 @@ import ( "context" "testing" - "github.com/weaveworks/tf-controller/internal/config" - bpconfig "github.com/weaveworks/tf-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/config" + bpconfig "github.com/flux-iac/tofu-controller/internal/config" "k8s.io/apimachinery/pkg/labels" - "github.com/weaveworks/tf-controller/internal/git/provider/providerfakes" + "github.com/flux-iac/tofu-controller/internal/git/provider/providerfakes" "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/internal/git/provider" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/internal/git/provider" ) // This checks poll can be called with a little setting-up, with no @@ -33,7 +33,7 @@ func Test_poll_empty(t *testing.T) { Namespace: ns.Name, }, Spec: sourcev1.GitRepositorySpec{ - URL: "https://github.com/weaveworks/tf-controller", + URL: "https://github.com/flux-iac/tofu-controller", Reference: &sourcev1.GitRepositoryRef{ Branch: "main", }, @@ -298,7 +298,7 @@ func Test_poll_noPathChanges(t *testing.T) { Namespace: ns.Name, }, Spec: sourcev1.GitRepositorySpec{ - URL: "https://github.com/weaveworks/tf-controller", + URL: "https://github.com/flux-iac/tofu-controller", Reference: &sourcev1.GitRepositoryRef{ Branch: "main", }, diff --git a/internal/server/polling/server.go b/internal/server/polling/server.go index 1645661ce..944966ae3 100644 --- a/internal/server/polling/server.go +++ b/internal/server/polling/server.go @@ -11,15 +11,15 @@ import ( apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + bpconfig "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider" "github.com/go-logr/logr" - bpconfig "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" ) const DefaultPollingInterval = time.Second * 30 diff --git a/internal/server/polling/server_test.go b/internal/server/polling/server_test.go index 76629de23..9b4cdcbe6 100644 --- a/internal/server/polling/server_test.go +++ b/internal/server/polling/server_test.go @@ -6,15 +6,15 @@ import ( "testing" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/internal/config" + "github.com/flux-iac/tofu-controller/internal/git/provider" + "github.com/flux-iac/tofu-controller/internal/git/provider/providerfakes" + "github.com/flux-iac/tofu-controller/internal/server/polling" "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/runtime/logger" sourcev1 "github.com/fluxcd/source-controller/api/v1" "github.com/onsi/gomega" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/internal/config" - "github.com/weaveworks/tf-controller/internal/git/provider" - "github.com/weaveworks/tf-controller/internal/git/provider/providerfakes" - "github.com/weaveworks/tf-controller/internal/server/polling" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/internal/server/polling/terraform.go b/internal/server/polling/terraform.go index 00ac2a161..48046f655 100644 --- a/internal/server/polling/terraform.go +++ b/internal/server/polling/terraform.go @@ -5,10 +5,10 @@ import ( "fmt" "time" + "github.com/flux-iac/tofu-controller/internal/config" + bpconfig "github.com/flux-iac/tofu-controller/internal/config" "github.com/fluxcd/pkg/runtime/acl" sourcev1 "github.com/fluxcd/source-controller/api/v1" - "github.com/weaveworks/tf-controller/internal/config" - bpconfig "github.com/weaveworks/tf-controller/internal/config" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -17,7 +17,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" ) func (s *Server) getTerraformObject(ctx context.Context, ref client.ObjectKey) (*infrav1.Terraform, error) { diff --git a/mkdocs.yml b/mkdocs.yml index a9dc17198..795fbaf01 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,7 +16,7 @@ theme: - content.code.annotate - content.code.copy -repo_url: https://github.com/weaveworks/tf-controller +repo_url: https://github.com/flux-iac/tofu-controller repo_name: weaveworks/tf-controller markdown_extensions: diff --git a/mtls/grpc.go b/mtls/grpc.go index fff78e9a7..8300f8c40 100644 --- a/mtls/grpc.go +++ b/mtls/grpc.go @@ -4,11 +4,12 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "github.com/weaveworks/tf-controller/runner" + "net" + + "github.com/flux-iac/tofu-controller/runner" "google.golang.org/grpc" "google.golang.org/grpc/credentials" corev1 "k8s.io/api/core/v1" - "net" controllerruntime "sigs.k8s.io/controller-runtime" ) diff --git a/mtls/rotator.go b/mtls/rotator.go index 7f5995b1f..44dced68d 100644 --- a/mtls/rotator.go +++ b/mtls/rotator.go @@ -15,8 +15,8 @@ import ( "sync" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/pkg/errors" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/mtls/runner_serve.go b/mtls/runner_serve.go index 284266e3a..26c8c78ec 100644 --- a/mtls/runner_serve.go +++ b/mtls/runner_serve.go @@ -6,9 +6,9 @@ import ( "net" "os" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/runner" sourcev1 "github.com/fluxcd/source-controller/api/v1" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/runner" "google.golang.org/grpc" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/planner.Dockerfile b/planner.Dockerfile index 848ab5b1c..3164da181 100644 --- a/planner.Dockerfile +++ b/planner.Dockerfile @@ -37,7 +37,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller" +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" ARG LIBCRYPTO_VERSION diff --git a/rfcs/README.md b/rfcs/README.md index 5654b7815..dcbea45de 100644 --- a/rfcs/README.md +++ b/rfcs/README.md @@ -1,7 +1,7 @@ # Terraform Controller RFCs In many situations, enhancements and new features are proposed -on [tf-controller/discussions](https://github.com/weaveworks/tf-controller/discussions). +on [tf-controller/discussions](https://github.com/flux-iac/tofu-controller/discussions). These proposals are evaluated publicly by maintainers, contributors, users, and any other interested parties. After a consensus is reached among the participants, the proposed changes proceed to the pull request stage where the implementation specifics are reviewed, and either approved or rejected by the maintainers. diff --git a/runner-base.Dockerfile b/runner-base.Dockerfile index 373f95441..b554e074e 100644 --- a/runner-base.Dockerfile +++ b/runner-base.Dockerfile @@ -40,7 +40,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller" +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" ARG LIBCRYPTO_VERSION diff --git a/runner/read_inputs_test.go b/runner/read_inputs_test.go index de4c09426..b7bd9045d 100644 --- a/runner/read_inputs_test.go +++ b/runner/read_inputs_test.go @@ -2,14 +2,15 @@ package runner import ( "context" - . "github.com/onsi/gomega" "testing" + . "github.com/onsi/gomega" + + "github.com/flux-iac/tofu-controller/api/typeinfo" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/go-logr/logr" "github.com/hashicorp/hcl2/hcldec" "github.com/hashicorp/hcl2/hclparse" - "github.com/weaveworks/tf-controller/api/typeinfo" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "github.com/zclconf/go-cty/cty" ctyjson "github.com/zclconf/go-cty/cty/json" corev1 "k8s.io/api/core/v1" diff --git a/runner/server.go b/runner/server.go index e247f7eaf..a43e9fe10 100644 --- a/runner/server.go +++ b/runner/server.go @@ -11,12 +11,12 @@ import ( "strings" securejoin "github.com/cyphar/filepath-securejoin" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" "github.com/fluxcd/pkg/untar" "github.com/go-logr/logr" "github.com/hashicorp/terraform-exec/tfexec" tfjson "github.com/hashicorp/terraform-json" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" corev1 "k8s.io/api/core/v1" diff --git a/runner/server_generate_tf_vars.go b/runner/server_generate_tf_vars.go index 50c0d90ea..c59f92d15 100644 --- a/runner/server_generate_tf_vars.go +++ b/runner/server_generate_tf_vars.go @@ -10,16 +10,16 @@ import ( "strings" "text/template" + "github.com/flux-iac/tofu-controller/api/typeinfo" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/api/typeinfo" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/json" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime" + controllerruntime "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/runner/server_load_tfplan.go b/runner/server_load_tfplan.go index 9ccfa021b..211bb6883 100644 --- a/runner/server_load_tfplan.go +++ b/runner/server_load_tfplan.go @@ -3,13 +3,14 @@ package runner import ( "context" "fmt" - "github.com/go-logr/logr" "path/filepath" + + "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/client" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" "github.com/spf13/afero" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/runner/server_load_tfplan_test.go b/runner/server_load_tfplan_test.go index 75a7c7a18..bfe52d0d6 100644 --- a/runner/server_load_tfplan_test.go +++ b/runner/server_load_tfplan_test.go @@ -5,11 +5,11 @@ import ( "path/filepath" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" "github.com/go-logr/logr" . "github.com/onsi/gomega" "github.com/spf13/afero" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/runner/server_outputs.go b/runner/server_outputs.go index b961a17d5..461b43357 100644 --- a/runner/server_outputs.go +++ b/runner/server_outputs.go @@ -6,8 +6,8 @@ import ( "io" "reflect" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/hashicorp/terraform-exec/tfexec" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/runner/server_save_tfplan.go b/runner/server_save_tfplan.go index 498261382..b3c3aafef 100644 --- a/runner/server_save_tfplan.go +++ b/runner/server_save_tfplan.go @@ -7,11 +7,11 @@ import ( "io/ioutil" "path/filepath" + "github.com/flux-iac/tofu-controller/api/planid" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/flux-iac/tofu-controller/utils" "github.com/go-logr/logr" - "github.com/weaveworks/tf-controller/api/planid" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" - "github.com/weaveworks/tf-controller/utils" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/runner/server_workspace_blob.go b/runner/server_workspace_blob.go index fe82ed526..ed97fe31c 100644 --- a/runner/server_workspace_blob.go +++ b/runner/server_workspace_blob.go @@ -10,7 +10,7 @@ import ( "os" "path/filepath" - "github.com/weaveworks/tf-controller/internal/storage" + "github.com/flux-iac/tofu-controller/internal/storage" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/runner/server_workspace_blob_test.go b/runner/server_workspace_blob_test.go index ec96914fc..a0b5a2ec8 100644 --- a/runner/server_workspace_blob_test.go +++ b/runner/server_workspace_blob_test.go @@ -8,9 +8,9 @@ import ( "path/filepath" "testing" + "github.com/flux-iac/tofu-controller/runner" "github.com/fluxcd/pkg/untar" . "github.com/onsi/gomega" - "github.com/weaveworks/tf-controller/runner" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/runner/suite_test.go b/runner/suite_test.go index 7867feec0..83b09b251 100644 --- a/runner/suite_test.go +++ b/runner/suite_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/weaveworks/tf-controller/controllers" - "github.com/weaveworks/tf-controller/runner" + "github.com/flux-iac/tofu-controller/controllers" + "github.com/flux-iac/tofu-controller/runner" grpc "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "k8s.io/apimachinery/pkg/runtime" @@ -23,10 +23,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/runtime/logger" sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/tfctl/approve_plan.go b/tfctl/approve_plan.go index d66b498a7..a27006027 100644 --- a/tfctl/approve_plan.go +++ b/tfctl/approve_plan.go @@ -7,7 +7,7 @@ import ( "io" "os" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/yaml" diff --git a/tfctl/break_glass.go b/tfctl/break_glass.go index af43137c2..268bdcce1 100644 --- a/tfctl/break_glass.go +++ b/tfctl/break_glass.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/cli-runtime/pkg/genericclioptions" diff --git a/tfctl/create.go b/tfctl/create.go index 09edf34bd..e076d46bb 100644 --- a/tfctl/create.go +++ b/tfctl/create.go @@ -9,7 +9,7 @@ import ( "strings" "time" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" ) diff --git a/tfctl/delete_terraform.go b/tfctl/delete_terraform.go index e45bec01b..8d8d4fa9a 100644 --- a/tfctl/delete_terraform.go +++ b/tfctl/delete_terraform.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" ) diff --git a/tfctl/forceUnlock.go b/tfctl/forceUnlock.go index 512d97b29..dedc83406 100644 --- a/tfctl/forceUnlock.go +++ b/tfctl/forceUnlock.go @@ -6,8 +6,8 @@ import ( "io" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/tfctl/get.go b/tfctl/get.go index 30ab8682a..70776733f 100644 --- a/tfctl/get.go +++ b/tfctl/get.go @@ -9,9 +9,9 @@ import ( "strings" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" "github.com/hako/durafmt" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/tfctl/get_terraform.go b/tfctl/get_terraform.go index d4f1194cf..77dc12d74 100644 --- a/tfctl/get_terraform.go +++ b/tfctl/get_terraform.go @@ -5,8 +5,8 @@ import ( "io" "strconv" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/tfctl/go.mod b/tfctl/go.mod index 4dda674f4..cc076f108 100644 --- a/tfctl/go.mod +++ b/tfctl/go.mod @@ -1,8 +1,8 @@ -module github.com/weaveworks/tf-controller/tfctl +module github.com/flux-iac/tofu-controller/tfctl go 1.20 -replace github.com/weaveworks/tf-controller/api => ../api +replace github.com/flux-iac/tofu-controller/api => ../api require ( github.com/fluxcd/cli-utils v0.36.0-flux.2 @@ -16,7 +16,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.13.0 github.com/theckman/yacspin v0.13.12 - github.com/weaveworks/tf-controller/api v0.0.0-00010101000000-000000000000 + github.com/flux-iac/tofu-controller/api v0.0.0-00010101000000-000000000000 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 k8s.io/cli-runtime v0.28.4 diff --git a/tfctl/main.go b/tfctl/main.go index 40955719f..482179c61 100644 --- a/tfctl/main.go +++ b/tfctl/main.go @@ -14,8 +14,8 @@ import ( "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/client-go/rest" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/cli-utils/pkg/kstatus/polling" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" _ "k8s.io/client-go/plugin/pkg/client/auth" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/tfctl/reconcile.go b/tfctl/reconcile.go index 0ddcadf5e..940844c1c 100644 --- a/tfctl/reconcile.go +++ b/tfctl/reconcile.go @@ -6,8 +6,8 @@ import ( "io" "time" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/tfctl/replan.go b/tfctl/replan.go index e07d12d1d..705a6ca27 100644 --- a/tfctl/replan.go +++ b/tfctl/replan.go @@ -3,16 +3,17 @@ package tfctl import ( "context" "fmt" - "github.com/fluxcd/pkg/apis/meta" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" "io" + "time" + + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" + "github.com/fluxcd/pkg/apis/meta" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/retry" "sigs.k8s.io/controller-runtime/pkg/client" - "time" ) // clear plan pending diff --git a/tfctl/resume.go b/tfctl/resume.go index eb0830c7a..70ec38f02 100644 --- a/tfctl/resume.go +++ b/tfctl/resume.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/tfctl/show_plan.go b/tfctl/show_plan.go index 3a2ef62b5..b70449e13 100644 --- a/tfctl/show_plan.go +++ b/tfctl/show_plan.go @@ -8,8 +8,8 @@ import ( "io" "io/ioutil" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/fluxcd/pkg/apis/meta" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" corev1 "k8s.io/api/core/v1" apimeta "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/types" diff --git a/tfctl/show_plan_test.go b/tfctl/show_plan_test.go index c204819c1..9177cc9c0 100644 --- a/tfctl/show_plan_test.go +++ b/tfctl/show_plan_test.go @@ -6,12 +6,12 @@ import ( "os" "testing" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "github.com/hashicorp/go-version" hc "github.com/hashicorp/hc-install" "github.com/hashicorp/hc-install/fs" "github.com/hashicorp/hc-install/product" "github.com/hashicorp/hc-install/src" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" diff --git a/tfctl/suspend.go b/tfctl/suspend.go index fbf689857..3b97249b2 100644 --- a/tfctl/suspend.go +++ b/tfctl/suspend.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" "sigs.k8s.io/controller-runtime/pkg/client" From 58ff059c11d3737726dfc08de4861e317fd14a86 Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Tue, 27 Feb 2024 18:23:45 +0100 Subject: [PATCH 05/42] fixed bad replace --- controllers/cleaner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/cleaner_test.go b/controllers/cleaner_test.go index 9a29a2de4..02a062731 100644 --- a/controllers/cleaner_test.go +++ b/controllers/cleaner_test.go @@ -5,7 +5,7 @@ import ( "fmt" infrav1 "github.com/flux-iac/tofu-controller/api/v1alpha2" - "github.cgithub.com/flux-iac/tofu-controller + "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" From 02ec890d9ef56e4a8eb10374428489d3a5d1498e Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Tue, 27 Feb 2024 18:32:03 +0100 Subject: [PATCH 06/42] internal/git/provider: replace reference to old repo --- internal/git/provider/provider_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/git/provider/provider_test.go b/internal/git/provider/provider_test.go index 755e7e0ec..0da75183c 100644 --- a/internal/git/provider/provider_test.go +++ b/internal/git/provider/provider_test.go @@ -17,25 +17,25 @@ func TestFromURL(t *testing.T) { }{ { url: "https://github.com/flux-iac/tofu-controller", - repoOrg: "weaveworks", - repoName: "tf-controller", + repoOrg: "flux-iac", + repoName: "tofu-controller", }, { url: "https://github.com/flux-iac/tofu-controller.git", - repoOrg: "weaveworks", - repoName: "tf-controller", + repoOrg: "flux-iac", + repoName: "tofu-controller", }, { url: "ssh://git@github.com/flux-iac/tofu-controller.git", - repoOrg: "weaveworks", - repoName: "tf-controller", + repoOrg: "flux-iac", + repoName: "tofu-controller", }, { - url: "https://github.com/weaveworks", + url: "https://github.com/flux-iac", shouldError: true, }, { - url: "https://weave.works/weaveworks/tf-controller", + url: "https://weave.works/flux-iac/tofu-controller", shouldError: true, }, } From b528d396aa3980491f29a5c798fe5f579d7fbe92 Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Tue, 27 Feb 2024 18:36:50 +0100 Subject: [PATCH 07/42] internal/git/provider/providerfakes: reordered import paths --- internal/git/provider/providerfakes/fake_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/git/provider/providerfakes/fake_provider.go b/internal/git/provider/providerfakes/fake_provider.go index c2793d632..0fb62cc15 100644 --- a/internal/git/provider/providerfakes/fake_provider.go +++ b/internal/git/provider/providerfakes/fake_provider.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/go-logr/logr" "github.com/flux-iac/tofu-controller/internal/git/provider" + "github.com/go-logr/logr" ) type FakeProvider struct { From 5a7cee675fefb0e6eb108b8c15363993cac10a2b Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 09:05:49 +0100 Subject: [PATCH 08/42] helm-docs updated to version 1.13.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fb650730a..3128f9fc9 100644 --- a/Makefile +++ b/Makefile @@ -295,7 +295,7 @@ release-manifests: # Helm SRC_ROOT = $(shell git rev-parse --show-toplevel) -helm-docs: HELMDOCS_VERSION := v1.11.0 +helm-docs: HELMDOCS_VERSION := v1.13.0 helm-docs: docker @docker run -v "$(SRC_ROOT):/helm-docs" jnorwood/helm-docs:$(HELMDOCS_VERSION) --chart-search-root /helm-docs From 900b74783c58a371998e374e0e45eba5436b8125 Mon Sep 17 00:00:00 2001 From: Kasper le Fevre Date: Wed, 28 Feb 2024 09:15:19 +0100 Subject: [PATCH 09/42] updating tf_version --- runner.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runner.Dockerfile b/runner.Dockerfile index df6add4a1..3aaa9a676 100644 --- a/runner.Dockerfile +++ b/runner.Dockerfile @@ -2,7 +2,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE ARG TARGETARCH -ARG TF_VERSION=1.3.9 +ARG TF_VERSION=1.5.7 # Switch to root to have permissions for operations USER root From 5bb8b606f719d14306a34c762b4c8fb3f20c292a Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 09:55:32 +0100 Subject: [PATCH 10/42] move urls from weave to flux-iac in makefile --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3128f9fc9..1d96550b5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ .DEFAULT_GOAL := help # Image URL to use all building/pushing image targets -MANAGER_IMG ?= ghcr.io/weaveworks/tf-controller -RUNNER_IMG ?= ghcr.io/weaveworks/tf-runner -RUNNER_AZURE_IMAGE ?= ghcr.io/weaveworks/tf-runner-azure -BRANCH_PLANNER_IMAGE ?= ghcr.io/weaveworks/branch-planner +MANAGER_IMG ?= ghcr.io/flux-iac/tofu-controller +RUNNER_IMG ?= ghcr.io/flux-iac/tf-runner +RUNNER_AZURE_IMAGE ?= ghcr.io/flux-iac/tf-runner-azure +BRANCH_PLANNER_IMAGE ?= ghcr.io/flux-iac/branch-planner TAG ?= latest BUILD_SHA ?= $(shell git rev-parse --short HEAD) BUILD_VERSION ?= $(shell git describe --tags $$(git rev-list --tags --max-count=1)) @@ -192,7 +192,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified .PHONY: deploy deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image weaveworks/tf-controller=${MANAGER_IMG}:${TAG} + cd config/manager && $(KUSTOMIZE) edit set image flux-iac/tofu-controller=${MANAGER_IMG}:${TAG} $(KUSTOMIZE) build config/default | kubectl apply --server-side -f - .PHONY: undeploy @@ -203,7 +203,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi .PHONY: dev-deploy dev-deploy: manifests kustomize mkdir -p config/dev && cp config/default/* config/dev - cd config/dev && $(KUSTOMIZE) edit set image ghcr.io/weaveworks/tf-controller=${MANAGER_IMG}:${TAG} + cd config/dev && $(KUSTOMIZE) edit set image ghcr.io/flux-iac/tofu-controller=${MANAGER_IMG}:${TAG} $(KUSTOMIZE) build config/dev | yq e "select(.kind == \"Deployment\" and .metadata.name == \"tf-controller\").spec.template.spec.containers[0].env[1].value = \"test/tf-runner:$${TAG}\"" - | kubectl apply --server-side -f - rm -rf config/dev @@ -211,7 +211,7 @@ dev-deploy: manifests kustomize .PHONY: dev-cleanup dev-cleanup: manifests kustomize mkdir -p config/dev && cp config/default/* config/dev - cd config/dev && $(KUSTOMIZE) edit set image ghcr.io/weaveworks/tf-controller=${MANAGER_IMG}:${TAG} + cd config/dev && $(KUSTOMIZE) edit set image ghcr.io/flux-iac/tofu-controller=${MANAGER_IMG}:${TAG} $(KUSTOMIZE) build config/dev | kubectl delete --server-side -f - rm -rf config/dev From a81f9cdd181f9f89689552c41dad90f78925c509 Mon Sep 17 00:00:00 2001 From: Kasper le Fevre Date: Wed, 28 Feb 2024 11:24:30 +0100 Subject: [PATCH 11/42] updating dokumentation for custom runner --- .../build-and-use-a-custom-runner-image.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/use-tf-controller/build-and-use-a-custom-runner-image.md b/docs/use-tf-controller/build-and-use-a-custom-runner-image.md index aa5e122dd..aca8e88dd 100644 --- a/docs/use-tf-controller/build-and-use-a-custom-runner-image.md +++ b/docs/use-tf-controller/build-and-use-a-custom-runner-image.md @@ -1,6 +1,6 @@ # Build and Use a Custom Runner Image -To build a custom runner image, you need a Dockerfile that extends the base image and that adds Terraform, plus any additional required tooling. The repository that contains the base images is [here](ghcr.io/weaveworks/tf-runner). All base image tags follow the following format: `${TF_CONTROLLER_VERSION}-base`. +To build a custom runner image, you need a Dockerfile that extends the base image and that adds Terraform, plus any additional required tooling. The repository that contains the base images is [here](ghcr.io/flux-iac/tf-runner). All base image tags follow the following format: `${TF_CONTROLLER_VERSION}-base`. ## Prerequisites @@ -15,7 +15,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE ARG TARGETARCH -ARG TF_VERSION=1.3.9 +ARG TF_VERSION=1.5.7 # Switch to root to have permissions for operations USER root @@ -29,14 +29,14 @@ RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin/ USER 65532:65532 ``` -Find the original Dockerfile for the runner [here](https://github.com/flux-iac/tofu-controller/blob/89e0c7edde91efebba825b31e9f0ef3cc583684b/runner.Dockerfile). +Find the original Dockerfile for the runner [here](https://github.com/flux-iac/tofu-controller/blob/main/runner.Dockerfile). 2. Build the image from the directory containing the `Dockerfile` you created above: ```bash export TF_CONTROLLER_VERSION=v0.16.0-rc.3 -export TF_VERSION=1.3.9 -export BASE_IMAGE=ghcr.io/weaveworks/tf-runner:${TF_CONTROLLER_VERSION}-base +export TF_VERSION=1.5.7 +export BASE_IMAGE=ghcr.io/flux-iac/tf-runner:${TF_CONTROLLER_VERSION}-base export TARGETARCH=amd64 export REMOTE_REPO=ghcr.io/my-org/custom-runnner docker build \ From 8bb24f5795696284600065c28fe5cdf8710e0f4f Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 16:39:15 +0100 Subject: [PATCH 12/42] rename tf->tofu, replace weaveworks->flux-iac --- config/manager/manager.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 96672d5ef..dafcce404 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,33 +2,33 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: tf-controller + name: tofu-controller labels: - control-plane: tf-controller + control-plane: tofu-controller spec: selector: matchLabels: - control-plane: tf-controller + control-plane: tofu-controller replicas: 1 template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - control-plane: tf-controller + control-plane: tofu-controller spec: terminationGracePeriodSeconds: 10 - serviceAccountName: tf-controller + serviceAccountName: tofu-controller securityContext: fsGroup: 1337 containers: - name: manager - image: weaveworks/tf-controller + image: flux-iac/tofu-controller imagePullPolicy: IfNotPresent command: - /sbin/tini - -- - - tf-controller + - tofu-controller args: - --watch-all-namespaces - --log-level=info @@ -47,7 +47,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: RUNNER_POD_IMAGE - value: weaveworks/tf-runner + value: flux-iac/tf-runner securityContext: capabilities: drop: ["ALL"] From dccbe24f4f9125765276aab0e587249f69c91091 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 16:40:20 +0100 Subject: [PATCH 13/42] fix naming in manager/kustomization.yaml --- config/manager/kustomization.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 8d7a70087..b9857e6ae 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -6,6 +6,6 @@ resources: generatorOptions: disableNameSuffixHash: true images: - - name: weaveworks/tf-controller - newName: ghcr.io/weaveworks/tf-controller + - name: flux-iac/tofu-controller + newName: ghcr.io/flux-iac/tofu-controller newTag: v0.16.0-rc.3 From 197f4aebc3fa77e273c231bd589ac2fd5b570a4b Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 16:43:02 +0100 Subject: [PATCH 14/42] source url to flux-iac --- config/testdata/multi-tenancy/base/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/testdata/multi-tenancy/base/test.yaml b/config/testdata/multi-tenancy/base/test.yaml index 6ac0d4b69..9cc3af32b 100644 --- a/config/testdata/multi-tenancy/base/test.yaml +++ b/config/testdata/multi-tenancy/base/test.yaml @@ -4,7 +4,7 @@ metadata: name: helloworld spec: interval: 1m - url: https://github.com/tf-controller/helloworld.git + url: https://github.com/flux-iac/helloworld.git ref: branch: main --- From df22ec0fb22c0741c33a0f796846276377282898 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 16:59:05 +0100 Subject: [PATCH 15/42] rebranding config/* except service-accounts --- Dockerfile | 6 +++--- config/branch-planner/kustomization.yaml | 4 ++-- config/branch-planner/planner.yaml | 16 ++++++++-------- config/default/kustomization.yaml | 2 +- config/default/namespace.yaml | 2 +- config/manager/manager.yaml | 2 +- config/package/aws-package.yaml | 2 +- config/samples/infra_v1alpha2_terraform.yaml | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index e31f273f1..77a955f68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ COPY utils/ utils/ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ go build -gcflags=all="-N -l" \ -ldflags "-X main.BuildSHA='${BUILD_SHA}' -X main.BuildVersion='${BUILD_VERSION}'" \ - -a -o tf-controller ./cmd/manager + -a -o tofu-controller ./cmd/manager FROM alpine:3.18 @@ -48,7 +48,7 @@ RUN apk update && \ libretls \ busybox -COPY --from=builder /workspace/tf-controller /usr/local/bin/ +COPY --from=builder /workspace/tofu-controller /usr/local/bin/ RUN addgroup --gid 65532 -S controller && adduser --uid 65532 -S controller -G controller @@ -56,4 +56,4 @@ USER 65532:65532 ENV GNUPGHOME=/tmp -ENTRYPOINT [ "/sbin/tini", "--", "tf-controller" ] +ENTRYPOINT [ "/sbin/tini", "--", "tofu-controller" ] diff --git a/config/branch-planner/kustomization.yaml b/config/branch-planner/kustomization.yaml index aa46ace7d..8a016b24f 100644 --- a/config/branch-planner/kustomization.yaml +++ b/config/branch-planner/kustomization.yaml @@ -6,6 +6,6 @@ resources: generatorOptions: disableNameSuffixHash: true images: - - name: weaveworks/branch-planner - newName: ghcr.io/weaveworks/branch-planner + - name: flux-iac/branch-planner + newName: ghcr.io/flux-iac/branch-planner newTag: v0.16.0-rc.3 diff --git a/config/branch-planner/planner.yaml b/config/branch-planner/planner.yaml index 9d436d68b..14bb03e23 100644 --- a/config/branch-planner/planner.yaml +++ b/config/branch-planner/planner.yaml @@ -2,27 +2,27 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app.kubernetes.io/name: tf-controller-planner - app.kubernetes.io/instance: tf-controller + app.kubernetes.io/name: tofu-controller-planner + app.kubernetes.io/instance: tofu-controller name: branch-planner spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: tf-controller-planner - app.kubernetes.io/instance: tf-controller + app.kubernetes.io/name: tofu-controller-planner + app.kubernetes.io/instance: tofu-controller template: metadata: labels: - app.kubernetes.io/name: tf-controller-planner - app.kubernetes.io/instance: tf-controller + app.kubernetes.io/name: tofu-controller-planner + app.kubernetes.io/instance: tofu-controller spec: containers: - args: [] # Update the env variables according to your new deployment - image: "ghcr.io/weaveworks/branch-planner:v0.15.0-rc.5" + image: "ghcr.io/flux-iac/branch-planner:v0.15.0-rc.5" imagePullPolicy: IfNotPresent - name: tf-controller + name: tofu-controller ports: - containerPort: 8080 name: http-prom diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 4d4731ca2..4f95b2fd6 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,6 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: tf-system +namespace: tofu-system resources: - https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.1/source-controller.crds.yaml - https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.1/source-controller.deployment.yaml diff --git a/config/default/namespace.yaml b/config/default/namespace.yaml index dd68eb624..c72e8aa28 100644 --- a/config/default/namespace.yaml +++ b/config/default/namespace.yaml @@ -3,4 +3,4 @@ kind: Namespace metadata: labels: control-plane: controller - name: tf-system + name: tofu-system diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index dafcce404..be2ec3fe5 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -18,7 +18,7 @@ spec: control-plane: tofu-controller spec: terminationGracePeriodSeconds: 10 - serviceAccountName: tofu-controller + serviceAccountName: tf-controller securityContext: fsGroup: 1337 containers: diff --git a/config/package/aws-package.yaml b/config/package/aws-package.yaml index f86620977..f08147dda 100644 --- a/config/package/aws-package.yaml +++ b/config/package/aws-package.yaml @@ -5,6 +5,6 @@ metadata: name: aws-package spec: interval: 1h0m0s - url: oci://ghcr.io/tf-controller/aws-primitive-modules + url: oci://ghcr.io/flux-iac/aws-primitive-modules ref: tag: v4.38.0-v1alpha11 diff --git a/config/samples/infra_v1alpha2_terraform.yaml b/config/samples/infra_v1alpha2_terraform.yaml index 86a113c10..33b141b2d 100644 --- a/config/samples/infra_v1alpha2_terraform.yaml +++ b/config/samples/infra_v1alpha2_terraform.yaml @@ -6,7 +6,7 @@ metadata: namespace: flux-system spec: interval: 30s - url: https://github.com/tf-controller/helloworld + url: https://github.com/flux-iac/helloworld ref: branch: main --- From a85d205896d64a1dddc6deb1471d5c25b9068d31 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 17:49:10 +0100 Subject: [PATCH 16/42] e2e-tests fixed to support tf->tofu --- .github/workflows/e2e.yaml | 106 ++++++++++++++++++------------------- Makefile | 2 +- local-e2e.sh | 64 +++++++++++----------- 3 files changed, 86 insertions(+), 86 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 84907b854..17eca8d4e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -58,16 +58,16 @@ jobs: echo 'run make test and commit changes' exit 1 fi - - name: Build the tf-controller container image + - name: Build the tofu-controller container image run: | VERSION="e2e-${GITHUB_SHA::8}" docker buildx use default - make docker-buildx MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION + make docker-buildx MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION - name: Load test images into KIND run: | VERSION="e2e-${GITHUB_SHA::8}" - kind load docker-image test/tf-controller:$VERSION + kind load docker-image test/tofu-controller:$VERSION kind load docker-image test/tf-runner:$VERSION - name: Install CRDs run: make install @@ -79,17 +79,17 @@ jobs: yq -i e ".spec.template.spec.containers[0].env[1].value=\"test/tf-runner:$VERSION\"" config/manager/manager.yaml # Dev deploy - do it twice to make sure the CRDs get in first - make dev-deploy MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION || true - make dev-deploy MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION + make dev-deploy MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION || true + make dev-deploy MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION # All of these old cert would be cleaned up by GC at the start of the test - kubectl -n tf-system apply -f config/testdata/gc-old-certs/test.yaml + kubectl -n tofu-system apply -f config/testdata/gc-old-certs/test.yaml # Increase the concurrency of the controller to speed up tests # --cert-rotation-check-frequency=6m0s, then GC will run every 1 minute kubectl patch deployment \ - tf-controller \ - --namespace tf-system \ + tofu-controller \ + --namespace tofu-system \ --type='json' \ -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args", "value": [ "--watch-all-namespaces", @@ -100,71 +100,71 @@ jobs: "--cert-rotation-check-frequency=6m0s", ]}]' - kubectl -n tf-system rollout status deploy/source-controller --timeout=1m - kubectl -n tf-system rollout status deploy/tf-controller --timeout=1m + kubectl -n tofu-system rollout status deploy/source-controller --timeout=1m + kubectl -n tofu-system rollout status deploy/tofu-controller --timeout=1m - name: Get terraform version run: | - # Terraform binary will be moved from the TF-controller image to TF-runner, so we check TF's version there + # Terraform binary will be moved from the ToFu-controller image to TF-runner, so we check TF's version there VERSION="e2e-${GITHUB_SHA::8}" docker run --rm --entrypoint=/usr/local/bin/terraform test/tf-runner:$VERSION version - name: Add git repository source run: | - kubectl -n tf-system apply -f ./config/testdata/source - kubectl -n tf-system wait gitrepository/helloworld --for=condition=ready --timeout=4m - kubectl -n tf-system wait ocirepository/helloworld-oci --for=condition=ready --timeout=4m + kubectl -n tofu-system apply -f ./config/testdata/source + kubectl -n tofu-system wait gitrepository/helloworld --for=condition=ready --timeout=4m + kubectl -n tofu-system wait ocirepository/helloworld-oci --for=condition=ready --timeout=4m - name: Run approvePlan tests run: | - kubectl -n tf-system apply -f ./config/testdata/approve-plan - kubectl -n tf-system wait terraform/helloworld-auto-approve --for=condition=ready --timeout=4m - kubectl -n tf-system wait terraform/helloworld-oci-auto-approve --for=condition=ready --timeout=4m - kubectl -n tf-system wait terraform/helloworld-manual-approve --for=condition=plan=true --timeout=4m + kubectl -n tofu-system apply -f ./config/testdata/approve-plan + kubectl -n tofu-system wait terraform/helloworld-auto-approve --for=condition=ready --timeout=4m + kubectl -n tofu-system wait terraform/helloworld-oci-auto-approve --for=condition=ready --timeout=4m + kubectl -n tofu-system wait terraform/helloworld-manual-approve --for=condition=plan=true --timeout=4m # delete after tests - kubectl -n tf-system delete -f ./config/testdata/approve-plan + kubectl -n tofu-system delete -f ./config/testdata/approve-plan - name: Run plan with pod cleanup tests run: | - kubectl -n tf-system apply -f ./config/testdata/always-clean-pod - kubectl -n tf-system wait terraform/helloworld-always-clean-pod-manual-approve --for=condition=plan=true --timeout=4m + kubectl -n tofu-system apply -f ./config/testdata/always-clean-pod + kubectl -n tofu-system wait terraform/helloworld-always-clean-pod-manual-approve --for=condition=plan=true --timeout=4m # negate pod not found to be true - ! kubectl -n tf-system get terraform/helloworld-always-clean-pod-manual-approve-tf-runner + ! kubectl -n tofu-system get terraform/helloworld-always-clean-pod-manual-approve-tf-runner # delete after tests - kubectl -n tf-system delete -f ./config/testdata/always-clean-pod + kubectl -n tofu-system delete -f ./config/testdata/always-clean-pod - name: Run drift detection tests run: | - kubectl -n tf-system apply -f ./config/testdata/drift-detection + kubectl -n tofu-system apply -f ./config/testdata/drift-detection # apply should be true first - kubectl -n tf-system wait terraform/helloworld-drift-detection --for=condition=apply=true --timeout=4m + kubectl -n tofu-system wait terraform/helloworld-drift-detection --for=condition=apply=true --timeout=4m # patch .spec.approvePlan to "disable" - kubectl -n tf-system patch terraform/helloworld-drift-detection -p '{"spec":{"approvePlan":"disable"}}' --type=merge - kubectl -n tf-system wait terraform/helloworld-drift-detection --for=condition=ready=true --timeout=4m + kubectl -n tofu-system patch terraform/helloworld-drift-detection -p '{"spec":{"approvePlan":"disable"}}' --type=merge + kubectl -n tofu-system wait terraform/helloworld-drift-detection --for=condition=ready=true --timeout=4m # disable drift detection # the object should work correctly - kubectl -n tf-system wait terraform/helloworld-drift-detection-disable --for=condition=ready --timeout=4m + kubectl -n tofu-system wait terraform/helloworld-drift-detection-disable --for=condition=ready --timeout=4m # delete after tests - kubectl -n tf-system delete -f ./config/testdata/drift-detection + kubectl -n tofu-system delete -f ./config/testdata/drift-detection - name: Run healthchecks tests run: | - kubectl -n tf-system apply -f ./config/testdata/healthchecks - kubectl -n tf-system wait terraform/helloworld-healthchecks --for=condition=ready --timeout=4m + kubectl -n tofu-system apply -f ./config/testdata/healthchecks + kubectl -n tofu-system wait terraform/helloworld-healthchecks --for=condition=ready --timeout=4m # delete after tests - kubectl -n tf-system delete -f ./config/testdata/healthchecks + kubectl -n tofu-system delete -f ./config/testdata/healthchecks - name: Run vars tests run: | - kubectl -n tf-system apply -f ./config/testdata/vars - kubectl -n tf-system wait terraform/helloworld-vars --for=condition=ready --timeout=4m + kubectl -n tofu-system apply -f ./config/testdata/vars + kubectl -n tofu-system wait terraform/helloworld-vars --for=condition=ready --timeout=4m # delete after tests - kubectl -n tf-system delete -f ./config/testdata/vars + kubectl -n tofu-system delete -f ./config/testdata/vars - name: Run multi-tenancy test run: | - kubectl -n tf-system scale --replicas=3 deploy/tf-controller + kubectl -n tofu-system scale --replicas=3 deploy/tf-controller kustomize build ./config/testdata/multi-tenancy/tenant01 | kubectl apply -f - kustomize build ./config/testdata/multi-tenancy/tenant02 | kubectl apply -f - kubectl -n tf-tenant01-dev wait terraform/helloworld-tenant01-dev --for=condition=ready --timeout=4m @@ -190,7 +190,7 @@ jobs: - name: Set up chaos testing environment run: | - kubectl -n tf-system scale --replicas=0 deploy/tf-controller + kubectl -n tofu-system scale --replicas=0 deploy/tf-controller sleep 3 kubectl -n chaos-testing apply -f ./config/testdata/chaos @@ -199,7 +199,7 @@ jobs: # Set up namespace-scoped old certs for GC kubectl -n chaos-testing apply -f ./config/testdata/gc-old-certs/test.yaml - kubectl -n tf-system scale --replicas=1 deploy/tf-controller + kubectl -n tofu-system scale --replicas=1 deploy/tf-controller sleep 10 - name: Randomly delete runner pods @@ -232,32 +232,32 @@ jobs: (kubectl get secret terraform-runner.tls-8 -n chaos-testing >/dev/null 2>&1 && exit 1 || exit 0) (kubectl get secret terraform-runner.tls-9 -n chaos-testing >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-0 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-1 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-2 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-3 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-4 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-5 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-6 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-7 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-8 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) - (kubectl get secret terraform-runner.tls-9 -n tf-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-0 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-1 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-2 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-3 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-4 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-5 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-6 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-7 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-8 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) + (kubectl get secret terraform-runner.tls-9 -n tofu-system >/dev/null 2>&1 && exit 1 || exit 0) echo "All tests are true, all of the old secrets were GCed." - name: Logs run: | - kubectl -n tf-system logs deploy/source-controller - kubectl -n tf-system logs deploy/tf-controller + kubectl -n tofu-system logs deploy/source-controller + kubectl -n tofu-system logs deploy/tf-controller - name: Debug failure if: failure() run: | which kubectl kubectl version kustomize version - kubectl -n tf-system logs deploy/source-controller - kubectl -n tf-system logs deploy/tf-controller + kubectl -n tofu-system logs deploy/source-controller + kubectl -n tofu-system logs deploy/tf-controller - ns=(tf-system tf-tenant01-dev tf-tenant01-prd tf-tenant02-dev tf-tenant02-prd chaos-testing) + ns=(tofu-system tf-tenant01-dev tf-tenant01-prd tf-tenant02-dev tf-tenant02-prd chaos-testing) for n in "${ns[@]}" do kubectl -n $n get gitrepositories -oyaml diff --git a/Makefile b/Makefile index 1d96550b5..ef52033aa 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi dev-deploy: manifests kustomize mkdir -p config/dev && cp config/default/* config/dev cd config/dev && $(KUSTOMIZE) edit set image ghcr.io/flux-iac/tofu-controller=${MANAGER_IMG}:${TAG} - $(KUSTOMIZE) build config/dev | yq e "select(.kind == \"Deployment\" and .metadata.name == \"tf-controller\").spec.template.spec.containers[0].env[1].value = \"test/tf-runner:$${TAG}\"" - | kubectl apply --server-side -f - + $(KUSTOMIZE) build config/dev | yq e "select(.kind == \"Deployment\" and .metadata.name == \"tofu-controller\").spec.template.spec.containers[0].env[1].value = \"test/tf-runner:$${TAG}\"" - | kubectl apply --server-side -f - rm -rf config/dev # Delete dev deployment and CRDs diff --git a/local-e2e.sh b/local-e2e.sh index f36dfa742..1e1d2e008 100755 --- a/local-e2e.sh +++ b/local-e2e.sh @@ -7,20 +7,20 @@ VERSION=e2e-$(git rev-parse --short HEAD)-$(if [[ $(git diff --stat) != '' ]]; t kind create cluster -[[ -z "$SKIP_IMAGE_BUILD" ]] && make docker-build MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION # BUILD_ARGS="--no-cache" +[[ -z "$SKIP_IMAGE_BUILD" ]] && make docker-build MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION # BUILD_ARGS="--no-cache" -kind load docker-image test/tf-controller:$VERSION +kind load docker-image test/tofu-controller:$VERSION kind load docker-image test/tf-runner:$VERSION make install # Dev deploy -make dev-deploy MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION || true -make dev-deploy MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=$VERSION +make dev-deploy MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION || true +make dev-deploy MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=$VERSION kubectl patch deployment \ - tf-controller \ - --namespace tf-system \ + tofu-controller \ + --namespace tofu-system \ --type='json' \ -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args", "value": [ "--watch-all-namespaces", @@ -30,71 +30,71 @@ kubectl patch deployment \ "--concurrent=10", ]}]' -kubectl -n tf-system rollout status deploy/source-controller --timeout=1m -kubectl -n tf-system rollout status deploy/tf-controller --timeout=1m +kubectl -n tofu-system rollout status deploy/source-controller --timeout=1m +kubectl -n tofu-system rollout status deploy/tofu-controller --timeout=1m echo "==================== Show Terraform version" docker run --rm --entrypoint=/usr/local/bin/terraform test/tf-runner:$VERSION version echo "==================== Add git repository source" -kubectl -n tf-system apply -f ./config/testdata/source -kubectl -n tf-system wait gitrepository/helloworld --for=condition=ready --timeout=4m +kubectl -n tofu-system apply -f ./config/testdata/source +kubectl -n tofu-system wait gitrepository/helloworld --for=condition=ready --timeout=4m echo "==================== Run approvePlan tests" -kubectl -n tf-system apply -f ./config/testdata/approve-plan -kubectl -n tf-system wait terraform/helloworld-auto-approve --for=condition=ready --timeout=4m -kubectl -n tf-system wait terraform/helloworld-manual-approve --for=condition=plan=true --timeout=4m +kubectl -n tofu-system apply -f ./config/testdata/approve-plan +kubectl -n tofu-system wait terraform/helloworld-auto-approve --for=condition=ready --timeout=4m +kubectl -n tofu-system wait terraform/helloworld-manual-approve --for=condition=plan=true --timeout=4m # delete after tests -kubectl -n tf-system delete -f ./config/testdata/approve-plan +kubectl -n tofu-system delete -f ./config/testdata/approve-plan echo "==================== Run plan with pod cleanup tests" -kubectl -n tf-system apply -f ./config/testdata/always-clean-pod -kubectl -n tf-system wait terraform/helloworld-always-clean-pod-manual-approve --for=condition=plan=true --timeout=4m +kubectl -n tofu-system apply -f ./config/testdata/always-clean-pod +kubectl -n tofu-system wait terraform/helloworld-always-clean-pod-manual-approve --for=condition=plan=true --timeout=4m # negate pod not found to be true -! kubectl -n tf-system get terraform/helloworld-always-clean-pod-manual-approve-tf-runner +! kubectl -n tofu-system get terraform/helloworld-always-clean-pod-manual-approve-tf-runner # delete after tests -kubectl -n tf-system delete -f ./config/testdata/always-clean-pod +kubectl -n tofu-system delete -f ./config/testdata/always-clean-pod echo "==================== Run drift detection tests" -kubectl -n tf-system apply -f ./config/testdata/drift-detection +kubectl -n tofu-system apply -f ./config/testdata/drift-detection # apply should be true first -kubectl -n tf-system wait terraform/helloworld-drift-detection --for=condition=apply=true --timeout=4m +kubectl -n tofu-system wait terraform/helloworld-drift-detection --for=condition=apply=true --timeout=4m # patch .spec.approvePlan to "disable" -kubectl -n tf-system patch terraform/helloworld-drift-detection -p '{"spec":{"approvePlan":"disable"}}' --type=merge -kubectl -n tf-system wait terraform/helloworld-drift-detection --for=condition=ready=true --timeout=4m +kubectl -n tofu-system patch terraform/helloworld-drift-detection -p '{"spec":{"approvePlan":"disable"}}' --type=merge +kubectl -n tofu-system wait terraform/helloworld-drift-detection --for=condition=ready=true --timeout=4m # disable drift detection # the object should work correctly -kubectl -n tf-system wait terraform/helloworld-drift-detection-disable --for=condition=ready --timeout=4m +kubectl -n tofu-system wait terraform/helloworld-drift-detection-disable --for=condition=ready --timeout=4m # delete after tests -kubectl -n tf-system delete -f ./config/testdata/drift-detection +kubectl -n tofu-system delete -f ./config/testdata/drift-detection echo "==================== Run healthchecks tests" -kubectl -n tf-system apply -f ./config/testdata/healthchecks -kubectl -n tf-system wait terraform/helloworld-healthchecks --for=condition=ready --timeout=4m +kubectl -n tofu-system apply -f ./config/testdata/healthchecks +kubectl -n tofu-system wait terraform/helloworld-healthchecks --for=condition=ready --timeout=4m # delete after tests -kubectl -n tf-system delete -f ./config/testdata/healthchecks +kubectl -n tofu-system delete -f ./config/testdata/healthchecks echo "==================== Run vars tests" -kubectl -n tf-system apply -f ./config/testdata/vars -kubectl -n tf-system wait terraform/helloworld-vars --for=condition=ready --timeout=4m +kubectl -n tofu-system apply -f ./config/testdata/vars +kubectl -n tofu-system wait terraform/helloworld-vars --for=condition=ready --timeout=4m # delete after tests -kubectl -n tf-system delete -f ./config/testdata/vars +kubectl -n tofu-system delete -f ./config/testdata/vars echo "==================== Run multi-tenancy test" -kubectl -n tf-system scale --replicas=3 deploy/tf-controller +kubectl -n tofu-system scale --replicas=3 deploy/tofu-controller kustomize build ./config/testdata/multi-tenancy/tenant01 | kubectl apply -f - kustomize build ./config/testdata/multi-tenancy/tenant02 | kubectl apply -f - kubectl -n tf-tenant01-dev wait terraform/helloworld-tenant01-dev --for=condition=ready --timeout=4m @@ -119,7 +119,7 @@ kubectl delete ns tf-tenant02-dev kubectl delete ns tf-tenant02-prd echo "==================== Set up chaos testing environment" -kubectl -n tf-system scale --replicas=1 deploy/tf-controller +kubectl -n tofu-system scale --replicas=1 deploy/tofu-controller kubectl -n chaos-testing apply -f ./config/testdata/chaos kubectl -n chaos-testing apply -f ./config/testdata/source sleep 20 From a92140e0cdc999112d40cb67cc9677c7cd157a53 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 18:04:31 +0100 Subject: [PATCH 17/42] e2e-test missed tf->tofu fixed. --- .github/workflows/e2e.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 17eca8d4e..60a1910bf 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -164,7 +164,7 @@ jobs: kubectl -n tofu-system delete -f ./config/testdata/vars - name: Run multi-tenancy test run: | - kubectl -n tofu-system scale --replicas=3 deploy/tf-controller + kubectl -n tofu-system scale --replicas=3 deploy/tofu-controller kustomize build ./config/testdata/multi-tenancy/tenant01 | kubectl apply -f - kustomize build ./config/testdata/multi-tenancy/tenant02 | kubectl apply -f - kubectl -n tf-tenant01-dev wait terraform/helloworld-tenant01-dev --for=condition=ready --timeout=4m @@ -190,7 +190,7 @@ jobs: - name: Set up chaos testing environment run: | - kubectl -n tofu-system scale --replicas=0 deploy/tf-controller + kubectl -n tofu-system scale --replicas=0 deploy/tofu-controller sleep 3 kubectl -n chaos-testing apply -f ./config/testdata/chaos @@ -199,7 +199,7 @@ jobs: # Set up namespace-scoped old certs for GC kubectl -n chaos-testing apply -f ./config/testdata/gc-old-certs/test.yaml - kubectl -n tofu-system scale --replicas=1 deploy/tf-controller + kubectl -n tofu-system scale --replicas=1 deploy/tofu-controller sleep 10 - name: Randomly delete runner pods @@ -247,7 +247,7 @@ jobs: - name: Logs run: | kubectl -n tofu-system logs deploy/source-controller - kubectl -n tofu-system logs deploy/tf-controller + kubectl -n tofu-system logs deploy/tofu-controller - name: Debug failure if: failure() run: | @@ -255,7 +255,7 @@ jobs: kubectl version kustomize version kubectl -n tofu-system logs deploy/source-controller - kubectl -n tofu-system logs deploy/tf-controller + kubectl -n tofu-system logs deploy/tofu-controller ns=(tofu-system tf-tenant01-dev tf-tenant01-prd tf-tenant02-dev tf-tenant02-prd chaos-testing) for n in "${ns[@]}" From b2b43406e55d0332e00fc21c5853519ee0b22ef3 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Wed, 28 Feb 2024 19:10:45 +0100 Subject: [PATCH 18/42] tilt configs weaveworks->flux-iac --- config/tilt/helm/dev-values.yaml | 2 +- config/tilt/test/tf-dev-subject.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/tilt/helm/dev-values.yaml b/config/tilt/helm/dev-values.yaml index 9e5b0a23f..2489a69aa 100644 --- a/config/tilt/helm/dev-values.yaml +++ b/config/tilt/helm/dev-values.yaml @@ -1,6 +1,6 @@ runner: image: - repository: ghcr.io/weaveworks/tf-runner + repository: ghcr.io/flux-iac/tf-runner serviceAccount: allowedNamespaces: - flux-system diff --git a/config/tilt/test/tf-dev-subject.yaml b/config/tilt/test/tf-dev-subject.yaml index 47c10657c..edcad5344 100644 --- a/config/tilt/test/tf-dev-subject.yaml +++ b/config/tilt/test/tf-dev-subject.yaml @@ -6,7 +6,7 @@ metadata: namespace: terraform spec: interval: 30s - url: https://github.com/tf-controller/helloworld + url: https://github.com/flux-iac/helloworld ref: branch: main --- @@ -48,4 +48,4 @@ spec: labels: instance: helloworld-tf # This is the name of the Terraform resource spec: - image: ghcr.io/weaveworks/tf-runner + image: ghcr.io/flux-iac/tf-runner From 392e34a61e6cf2d4c1773ab6d172de45133b3314 Mon Sep 17 00:00:00 2001 From: Kasper le Fevre Date: Thu, 29 Feb 2024 10:02:15 +0100 Subject: [PATCH 19/42] renamed to flux-iac and added tf_version 1.5.7 --- tools/check-runner-images.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/check-runner-images.sh b/tools/check-runner-images.sh index 1aff35d5f..55ef6c1fd 100755 --- a/tools/check-runner-images.sh +++ b/tools/check-runner-images.sh @@ -1,11 +1,11 @@ #!/bin/bash # Define the base image name and tag prefix -IMAGE_NAME="ghcr.io/weaveworks/tf-runner" +IMAGE_NAME="ghcr.io/flux-iac/tf-runner" VERSION="${1}" # Assuming the desired version is passed as an argument to this script # Versions of Terraform to check -TF_VERSIONS=(1.0.11 1.1.9 1.2.9 1.3.9 1.4.6 1.5.5) +TF_VERSIONS=(1.0.11 1.1.9 1.2.9 1.3.9 1.4.6 1.5.5 1.5.7) # Loop over each Terraform version for TF_VERSION in "${TF_VERSIONS[@]}"; do From 8d857ff9873e15223c82bc4c4b130358cfba0fa1 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Thu, 29 Feb 2024 16:36:20 +0100 Subject: [PATCH 20/42] dockerfiles updated to alpine:3.19 --- Dockerfile | 2 +- planner.Dockerfile | 2 +- runner-azure.Dockerfile | 4 ++-- runner-base.Dockerfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77a955f68..1b352ca3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ -ldflags "-X main.BuildSHA='${BUILD_SHA}' -X main.BuildVersion='${BUILD_VERSION}'" \ -a -o tofu-controller ./cmd/manager -FROM alpine:3.18 +FROM alpine:3.19 LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" diff --git a/planner.Dockerfile b/planner.Dockerfile index 3164da181..b10c556c2 100644 --- a/planner.Dockerfile +++ b/planner.Dockerfile @@ -35,7 +35,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ -o branch-planner \ ./cmd/branch-planner -FROM alpine:3.18 +FROM alpine:3.19 LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" diff --git a/runner-azure.Dockerfile b/runner-azure.Dockerfile index 76eb46ee4..0de188189 100644 --- a/runner-azure.Dockerfile +++ b/runner-azure.Dockerfile @@ -16,8 +16,8 @@ RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin/ ARG AZCLI_VERSION=2.50.0 RUN apk add --no-cache py3-pip && \ apk add --no-cache gcc musl-dev python3-dev libffi-dev openssl-dev -RUN pip install --upgrade pip && \ - pip install azure-cli==${AZCLI_VERSION} +RUN pip install --break-system-packages --upgrade pip && \ + pip install azure-cli==${AZCLI_VERSION} --break-system-packages # Switch back to the non-root user after operations USER 65532:65532 diff --git a/runner-base.Dockerfile b/runner-base.Dockerfile index b554e074e..a69b0b650 100644 --- a/runner-base.Dockerfile +++ b/runner-base.Dockerfile @@ -38,7 +38,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \ -o tf-runner \ ./cmd/runner/main.go -FROM alpine:3.18 +FROM alpine:3.19 LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" From fe4b0da0ae54e52df14c729d6a0392f99afa4019 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Thu, 29 Feb 2024 17:02:19 +0000 Subject: [PATCH 21/42] move crds to ./crds folder, remove installCRDs value from helm chart --- charts/tf-controller/README.md | 1 - .../tf-controller/{templates => crds}/crds.yaml | 15 ++++++--------- charts/tf-controller/values.yaml | 2 -- 3 files changed, 6 insertions(+), 12 deletions(-) rename charts/tf-controller/{templates => crds}/crds.yaml (99%) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index 04a1bf817..67dc3aabe 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -52,7 +52,6 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | image.repository | string | `"ghcr.io/flux-iac/tf-controller"` | Controller image repository | | image.tag | string | `.Chart.AppVersion` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | Controller image pull secret | -| installCRDs | bool | `true` | If `true`, install CRDs as part of the helm installation | | kubeAPIBurst | int | `100` | Argument for `--kube-api-burst` (Controller). Burst indicates the maximum burst queries-per-second of requests sent to the Kubernetes API, defaults to 100. | | kubeAPIQPS | int | `50` | Argument for `--kube-api-qps` (Controller). Kube API QPS indicates the maximum queries-per-second of requests sent to the Kubernetes API, defaults to 50. | | logEncoding | string | `"json"` | Argument for `--log-encoding`. Can be 'json' or 'console'. (Controller) | diff --git a/charts/tf-controller/templates/crds.yaml b/charts/tf-controller/crds/crds.yaml similarity index 99% rename from charts/tf-controller/templates/crds.yaml rename to charts/tf-controller/crds/crds.yaml index 683138769..3a867862f 100644 --- a/charts/tf-controller/templates/crds.yaml +++ b/charts/tf-controller/crds/crds.yaml @@ -1,4 +1,3 @@ -{{- if .Values.installCRDs }} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -7,7 +6,8 @@ metadata: creationTimestamp: null name: terraforms.infra.contrib.fluxcd.io labels: - {{- include "tf-controller.labels" . | nindent 4 }} + helm.sh/chart: tf-controller-0.16.0-rc.3 + app.kubernetes.io/version: 0.16.0-rc.3 spec: group: infra.contrib.fluxcd.io names: @@ -238,7 +238,7 @@ spec: address: description: Address to perform tcp health check on. Required when tcp type is specified. Go template can be used to reference - values from the terraform output (e.g. 127.0.0.1:8080, {{.address}}:{{.port}}). + values from the terraform output (e.g. 127.0.0.1:8080). type: string name: description: Name of the health check. @@ -262,8 +262,7 @@ spec: url: description: URL to perform http health check on. Required when http type is specified. Go template can be used to reference - values from the terraform output (e.g. https://example.org, - {{.output_url}}). + values from the terraform output (e.g. https://example.org). type: string required: - name @@ -5203,7 +5202,7 @@ spec: address: description: Address to perform tcp health check on. Required when tcp type is specified. Go template can be used to reference - values from the terraform output (e.g. 127.0.0.1:8080, {{.address}}:{{.port}}). + values from the terraform output (e.g. 127.0.0.1:8080). type: string name: description: Name of the health check. @@ -5227,8 +5226,7 @@ spec: url: description: URL to perform http health check on. Required when http type is specified. Go template can be used to reference - values from the terraform output (e.g. https://example.org, - {{.output_url}}). + values from the terraform output (e.g. https://example.org). type: string required: - name @@ -10221,4 +10219,3 @@ spec: storage: true subresources: status: {} -{{- end }} diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index 871d01988..798ec6297 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -1,5 +1,3 @@ -# -- If `true`, install CRDs as part of the helm installation -installCRDs: true # -- If `true`, enable cross-namespace references for controller and branch-planner allowCrossNamespaceRefs: false # ServiceAccount From 481ce954bb11743d18631e73db36abab6ac7b578 Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Fri, 1 Mar 2024 09:33:53 +0100 Subject: [PATCH 22/42] trivy scan tf->tofu fixed --- .github/workflows/scan.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scan.yaml b/.github/workflows/scan.yaml index 7c5a7d5e7..1580e7aeb 100644 --- a/.github/workflows/scan.yaml +++ b/.github/workflows/scan.yaml @@ -46,13 +46,13 @@ jobs: steps: - name: Checkout code uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - name: Build tf-controller image + - name: Build tofu-controller image run: | make docker-buildx - name: Run Trivy vulnerability scanner on controller image uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0 with: - image-ref: 'ghcr.io/flux-iac/tf-controller:latest' + image-ref: 'ghcr.io/flux-iac/tofu-controller:latest' format: 'table' exit-code: '1' ignore-unfixed: true From f69beb2d5106a9a0a8ff12be49d9bd005fe82e62 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Fri, 1 Mar 2024 09:14:13 +0000 Subject: [PATCH 23/42] helm deployment.yaml launch tofu-controller --- charts/tf-controller/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tf-controller/templates/deployment.yaml b/charts/tf-controller/templates/deployment.yaml index a135edf30..be8d7683d 100644 --- a/charts/tf-controller/templates/deployment.yaml +++ b/charts/tf-controller/templates/deployment.yaml @@ -49,7 +49,7 @@ spec: command: - /sbin/tini - -- - - tf-controller + - tofu-controller env: {{- include "pod-namespace" . | indent 8 }} - name: RUNNER_POD_IMAGE From eead3c036c317df36215b025f67c497d48d11f8f Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Fri, 1 Mar 2024 09:16:10 +0000 Subject: [PATCH 24/42] helm values.yaml controller image repository --- charts/tf-controller/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index 798ec6297..03caad302 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -22,7 +22,7 @@ podLabels: {} replicaCount: 1 image: # -- Controller image repository - repository: ghcr.io/flux-iac/tf-controller + repository: ghcr.io/flux-iac/tofu-controller # -- Controller image pull policy pullPolicy: IfNotPresent # -- Overrides the image tag whose default is the chart appVersion. From 608fa30164b16c5557b96a7460930048e660155f Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Fri, 1 Mar 2024 09:19:52 +0000 Subject: [PATCH 25/42] Helm README.md Controller image repository --- charts/tf-controller/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index 67dc3aabe..5a029711e 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -49,7 +49,7 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | extraEnv | object | `{}` | Additional container environment variables. | | fullnameOverride | string | `""` | Provide a fullname | | image.pullPolicy | string | `"IfNotPresent"` | Controller image pull policy | -| image.repository | string | `"ghcr.io/flux-iac/tf-controller"` | Controller image repository | +| image.repository | string | `"ghcr.io/flux-iac/tofu-controller"` | Controller image repository | | image.tag | string | `.Chart.AppVersion` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | Controller image pull secret | | kubeAPIBurst | int | `100` | Argument for `--kube-api-burst` (Controller). Burst indicates the maximum burst queries-per-second of requests sent to the Kubernetes API, defaults to 100. | @@ -94,5 +94,3 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | volumeMounts | list | `[]` | Volume mounts properties for the TF-Controller deployment | | volumes | list | `[]` | Volumes properties for the TF-Controller deployment | ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0) \ No newline at end of file From 5d9f0948a66c60affa7ce946ba3001c7f7f4d38a Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Fri, 1 Mar 2024 09:26:39 +0000 Subject: [PATCH 26/42] helm README.md autogen postambel --- charts/tf-controller/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index 5a029711e..8aa1adca4 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -94,3 +94,5 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | volumeMounts | list | `[]` | Volume mounts properties for the TF-Controller deployment | | volumes | list | `[]` | Volumes properties for the TF-Controller deployment | +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0) \ No newline at end of file From d03e2c408620ec637b4252ad6d4c29d4787c561b Mon Sep 17 00:00:00 2001 From: Tonni Follmann Date: Sat, 2 Mar 2024 00:27:01 +0100 Subject: [PATCH 27/42] ghcr urls changed to flux-iac in runners --- controllers/tc000260_runner_pod_test.go | 2 +- controllers/tf_controller_runner.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/tc000260_runner_pod_test.go b/controllers/tc000260_runner_pod_test.go index 6c4ebd81b..8830b68d0 100644 --- a/controllers/tc000260_runner_pod_test.go +++ b/controllers/tc000260_runner_pod_test.go @@ -25,7 +25,7 @@ func Test_000260_runner_pod_test(t *testing.T) { terraformName = "runner-pod-test" sourceName = "runner-pod-test" serviceAccountName = "helloworld-tf-runner" - runnerPodImage = "ghcr.io/weaveworks/tf-runner:test" + runnerPodImage = "ghcr.io/flux-iac/tf-runner:test" revision = "v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5" ) diff --git a/controllers/tf_controller_runner.go b/controllers/tf_controller_runner.go index fab41ad83..07cb266c3 100644 --- a/controllers/tf_controller_runner.go +++ b/controllers/tf_controller_runner.go @@ -32,7 +32,7 @@ func getRunnerPodImage(image string) string { runnerPodImage = os.Getenv("RUNNER_POD_IMAGE") } if runnerPodImage == "" { - runnerPodImage = "ghcr.io/weaveworks/tf-runner:latest" + runnerPodImage = "ghcr.io/flux-iac/tf-runner:latest" } return runnerPodImage } From de9999b2bd7dc336893d89152573c025e9d6908a Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Mon, 4 Mar 2024 01:06:05 +0700 Subject: [PATCH 28/42] Update SECURITY.md --- SECURITY.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index beeaffc5b..f1dda44dc 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,14 +1,14 @@ -# tf-controller Security +# Tofu-Controller Security -This document defines security reporting, handling and disclosure information for the tf-controller project and community. +This document defines security reporting, handling and disclosure information for the Tofu-Controller project and community. ## Security Process ### Report a Vulnerability -We're very thankful for – and if desired happy to credit – security researchers and users who report vulnerabilities to the tf-controller community. +We're very thankful for – and if desired happy to credit – security researchers and users who report vulnerabilities to the Tofu-Controller community. -- To make a report please email the private security list at with the details. +- To make a report please go to [Tofu-Controller's Security](https://github.com/flux-iac/tofu-controller/security) page and submit the details. We ask that reporters act in good faith by not disclosing the issue to others. - The Security Team will investigate the issue as soon as possible and where needed, coordinate a release date with relevant parties. - You will be able to choose if you want public acknowledgement of your effort and how you would like to be credited. @@ -16,7 +16,7 @@ We're very thankful for – and if desired happy to credit – security researc ### Security Team -Our Security Team consists of project maintainers and Weaveworks employees. +Our Security Team consists of the Project's maintainers. ### Handling From 8292325e4184ac9950e9af0d7a29d0a00c6a75ec Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Mon, 4 Mar 2024 18:19:10 +0700 Subject: [PATCH 29/42] Update MAINTAINERS --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index bedbba29a..7f6c9a2f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,4 +1,4 @@ -Chanwit Kaewkasi, Weaveworks (github: @chanwit) +Chanwit Kaewkasi (github: @chanwit) Balazs Nadasdi (github: @yitsushi) ### Emeritus Maintainers From cd8faa16d81bdfb9fbdeb28cdc450d5f54b7e1df Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Mon, 4 Mar 2024 17:52:17 +0100 Subject: [PATCH 30/42] Tiltfile: added config for building tf-runner image and using it in helloworld example --- Tiltfile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Tiltfile b/Tiltfile index f0a0980fd..a54744d0d 100644 --- a/Tiltfile +++ b/Tiltfile @@ -40,9 +40,9 @@ k8s_yaml(helm( # Add Example k8s_yaml("./config/tilt/test/tf-dev-subject.yaml") k8s_resource( - objects=['helloworld:GitRepository:terraform','helloworld-tf:Secret:terraform','helloworld-tf:Terraform:terraform'], + objects=['helloworld:GitRepository:terraform','helloworld-tf:Secret:terraform'], extra_pod_selectors={'instance': 'helloworld-tf'}, - new_name="helloworld-tf", + new_name="helloworld-tf-runner", pod_readiness='ignore', labels=["resources"], ) @@ -60,7 +60,7 @@ k8s_yaml(namespace_inject("./config/tilt/configMap.yaml", namespace)) # Images docker_build( - "ghcr.io/weaveworks/tf-controller", + "ghcr.io/flux-iac/tofu-controller", "", dockerfile="Dockerfile", build_args={ @@ -70,7 +70,7 @@ docker_build( }) docker_build( - "ghcr.io/weaveworks/branch-planner", + "ghcr.io/flux-iac/branch-planner", "", dockerfile="planner.Dockerfile", build_args={ @@ -79,15 +79,23 @@ docker_build( 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, }) -# There are no resources using this image when tilt starts, but we still need -# this image. -update_settings(suppress_unused_image_warnings=["ghcr.io/weaveworks/tf-runner"]) + +k8s_kind('Terraform', image_json_path='{.spec.runnerPodTemplate.spec.image}') docker_build( - 'ghcr.io/weaveworks/tf-runner', + 'ghcr.io/flux-iac/tf-runner-base', '', - dockerfile='runner.Dockerfile', + dockerfile='runner-base.Dockerfile', build_args={ 'BUILD_SHA': buildSHA, 'BUILD_VERSION': buildVersion, 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, - }) + } +) +docker_build( + 'ghcr.io/flux-iac/tf-runner', + '', + dockerfile='runner.Dockerfile', + build_args={ + 'BASE_IMAGE': 'ghcr.io/flux-iac/tf-runner-base', + } +) From d699de64b959d89d2b8476ffb468a9ea58eacb2a Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Thu, 7 Mar 2024 14:56:28 -0500 Subject: [PATCH 31/42] Reduce resulting binary size Signed-off-by: Brian Dwyer --- .goreleaser.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 680c25d0a..affb470e4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,8 +15,11 @@ builds: binary: tfctl env: - CGO_ENABLED=0 + flags: + - -trimpath ldflags: - - -X main.BuildSHA={{.ShortCommit}} -X main.BuildVersion={{.Tag}} + - -s -w + - -X main.BuildSHA={{.ShortCommit}} -X main.BuildVersion={{.Tag}} goos: - darwin - linux From 1eb23e363236c20723c3cf93e906041050237709 Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Fri, 8 Mar 2024 20:14:41 +0700 Subject: [PATCH 32/42] Add Tonni Follmann (@ilithanos) as a MAINTAINER --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7f6c9a2f7..6f000007f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,5 +1,6 @@ Chanwit Kaewkasi (github: @chanwit) Balazs Nadasdi (github: @yitsushi) +Tonni Follmann (github: @ilithanos) ### Emeritus Maintainers From a65ce6dbb27ee7f5989f490554456a3d349a755e Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Sat, 9 Mar 2024 08:25:11 +0100 Subject: [PATCH 33/42] tilt: speed up compiling of binaries --- .dockerignore | 3 ++ Dockerfile.dev | 23 +++++++++++++ Tiltfile | 74 +++++++++++++++++++++++++++++++++--------- planner.Dockerfile.dev | 23 +++++++++++++ runner.Dockerfile.dev | 44 +++++++++++++++++++++++++ 5 files changed, 151 insertions(+), 16 deletions(-) create mode 100644 Dockerfile.dev create mode 100644 planner.Dockerfile.dev create mode 100644 runner.Dockerfile.dev diff --git a/.dockerignore b/.dockerignore index 0f046820f..838b5b9a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,6 @@ # Ignore build and test binaries. bin/ testbin/ +!bin/tf-runner +!bin/tofu-controller +!bin/branch-planner \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 000000000..aad93460e --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,23 @@ +FROM alpine:3.19 + +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" + +ARG LIBCRYPTO_VERSION + +RUN apk update && \ + apk add --no-cache \ + libcrypto3=${LIBCRYPTO_VERSION} \ + libssl3=${LIBCRYPTO_VERSION} \ + ca-certificates tini git openssh-client gnupg \ + libretls \ + busybox + +COPY bin/tofu-controller /usr/local/bin/ + +RUN addgroup --gid 65532 -S controller && adduser --uid 65532 -S controller -G controller + +USER 65532:65532 + +ENV GNUPGHOME=/tmp + +ENTRYPOINT [ "/sbin/tini", "--", "tofu-controller" ] diff --git a/Tiltfile b/Tiltfile index a54744d0d..162b37555 100644 --- a/Tiltfile +++ b/Tiltfile @@ -58,44 +58,86 @@ k8s_yaml(namespace_inject(secret_from_dict("bbp-token", inputs = { # Add configMap k8s_yaml(namespace_inject("./config/tilt/configMap.yaml", namespace)) +local_resource( + 'manager-compile', + 'CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -o bin/tofu-controller ./cmd/manager', + deps=[ + 'api/', + 'tfctl/', + 'cmd/manager/', + 'controllers/', + 'mtls/', + 'runner/', + 'internal/', + 'utils/', + 'go.mod', + 'go.sum' + ], + labels = ['native-processes'], +) + # Images docker_build( "ghcr.io/flux-iac/tofu-controller", "", - dockerfile="Dockerfile", + dockerfile="Dockerfile.dev", build_args={ 'BUILD_SHA': buildSHA, 'BUILD_VERSION': buildVersion, 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, - }) + } +) + +local_resource( + 'branch-planner-compile', + 'CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -o bin/branch-planner ./cmd/branch-planner', + deps=[ + 'api/', + 'tfctl/', + 'cmd/branch-planner/', + 'internal/', + 'utils/', + 'go.mod', + 'go.sum' + ], + labels = ['native-processes'], +) docker_build( "ghcr.io/flux-iac/branch-planner", "", - dockerfile="planner.Dockerfile", + dockerfile="planner.Dockerfile.dev", build_args={ 'BUILD_SHA': buildSHA, 'BUILD_VERSION': buildVersion, 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, - }) + } +) -k8s_kind('Terraform', image_json_path='{.spec.runnerPodTemplate.spec.image}') -docker_build( - 'ghcr.io/flux-iac/tf-runner-base', - '', - dockerfile='runner-base.Dockerfile', - build_args={ - 'BUILD_SHA': buildSHA, - 'BUILD_VERSION': buildVersion, - 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, - } +local_resource( + 'runner-compile', + 'CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -o bin/tf-runner ./cmd/runner/main.go', + deps=[ + 'api/', + 'tfctl/', + 'cmd/runner', + 'controllers/', + 'mtls/', + 'runner/', + 'internal/', + 'utils/', + 'go.mod', + 'go.sum' + ], + labels = ['native-processes'], ) +k8s_kind('Terraform', image_json_path='{.spec.runnerPodTemplate.spec.image}') docker_build( 'ghcr.io/flux-iac/tf-runner', '', - dockerfile='runner.Dockerfile', + dockerfile='runner.Dockerfile.dev', build_args={ - 'BASE_IMAGE': 'ghcr.io/flux-iac/tf-runner-base', + 'LIBCRYPTO_VERSION': LIBCRYPTO_VERSION, } ) diff --git a/planner.Dockerfile.dev b/planner.Dockerfile.dev new file mode 100644 index 000000000..a84d15113 --- /dev/null +++ b/planner.Dockerfile.dev @@ -0,0 +1,23 @@ +FROM alpine:3.19 + +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" + +ARG LIBCRYPTO_VERSION + +RUN apk update && \ + apk add --no-cache \ + libcrypto3=${LIBCRYPTO_VERSION} \ + libssl3=${LIBCRYPTO_VERSION} \ + ca-certificates tini git openssh-client gnupg \ + libretls \ + busybox + +COPY bin/branch-planner /usr/local/bin/ + +RUN addgroup --gid 65532 -S controller && adduser --uid 65532 -S controller -G controller + +USER 65532:65532 + +ENV GNUPGHOME=/tmp + +ENTRYPOINT [ "/sbin/tini", "--", "branch-planner" ] diff --git a/runner.Dockerfile.dev b/runner.Dockerfile.dev new file mode 100644 index 000000000..0b9de7739 --- /dev/null +++ b/runner.Dockerfile.dev @@ -0,0 +1,44 @@ +FROM alpine:3.19 as base + +LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller" + +ARG LIBCRYPTO_VERSION + +RUN apk update && \ + apk add --no-cache \ + busybox \ + ca-certificates \ + git \ + gnupg \ + libcrypto3=${LIBCRYPTO_VERSION} \ + libssl3=${LIBCRYPTO_VERSION} \ + libretls \ + openssh-client \ + tini + +RUN addgroup --gid 65532 -S runner && adduser --uid 65532 -S runner -G runner + +USER 65532:65532 + +ENV GNUPGHOME=/tmp + +ENTRYPOINT [ "/sbin/tini", "--", "tf-runner" ] + +FROM base + +ARG TARGETARCH +ARG TF_VERSION=1.5.7 + +# Switch to root to have permissions for operations +USER root + +ADD https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_${TARGETARCH}.zip /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip +RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin/ && \ + rm /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip && \ + chmod +x /usr/local/bin/terraform + +# Switch back to the non-root user after operations +USER 65532:65532 + +COPY bin/tf-runner /usr/local/bin/ + From 9bab501e092c467a55eec7f546ff9d412fcab8ac Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Wed, 13 Mar 2024 00:46:46 +0700 Subject: [PATCH 34/42] Update .goreleaser.yml --- .goreleaser.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index affb470e4..71bef97cd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -70,13 +70,13 @@ brews: ids: - tfctl tap: - owner: weaveworks + owner: flux-iac name: homebrew-tap token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" commit_author: - name: weaveworksbot - email: team+gitbot@weave.works + name: flux-iac + email: noreply@github.com folder: Formula - homepage: https://weaveworks.github.io/tf-controller + homepage: https://flux-iac.github.io/tofu-controller install: | bin.install "tfctl" From f79ec87a0676db4764a49ad19e20004afd4a3e37 Mon Sep 17 00:00:00 2001 From: Arie Lev <34907201+ArieLevs@users.noreply.github.com> Date: Tue, 12 Mar 2024 20:32:55 +0200 Subject: [PATCH 35/42] add private registries integration docs (#1237) * add private registries integration docs * add link integration-with-terraform-private-registries.md Co-authored-by: Tonni Follmann --- docs/use-tf-controller/index.md | 1 + ...ation-with-terraform-private-registries.md | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 docs/use-tf-controller/integration-with-terraform-private-registries.md diff --git a/docs/use-tf-controller/index.md b/docs/use-tf-controller/index.md index 5b0495e97..119985dfd 100644 --- a/docs/use-tf-controller/index.md +++ b/docs/use-tf-controller/index.md @@ -15,6 +15,7 @@ - [Use TF-controller with Terraform Runners enabled via Env Variables](with-tf-runner-logging.md) - [Use TF-controller to provision resources with **customized Runner Pods**](provision-resources-with-customized-runner-pods.md) - [Use TF-controller with **Terraform Enterprise**](integration-with-terraform-enterprise-or-cloud.md) + - [Use TF-controller with **Terraform Private Registries**](integration-with-terraform-private-registries.md) - [Use TF-controller with **primitive modules**](with-primitive-modules.md) - [Use TF-controller with **GitOps dependency management**](with-gitops-dependency-management.md) - [Use TF-controller with **the ready-to-use AWS package**](with-the-ready-to-use-aws-package.md) diff --git a/docs/use-tf-controller/integration-with-terraform-private-registries.md b/docs/use-tf-controller/integration-with-terraform-private-registries.md new file mode 100644 index 000000000..1e013a046 --- /dev/null +++ b/docs/use-tf-controller/integration-with-terraform-private-registries.md @@ -0,0 +1,103 @@ +# Terraform Private Registries Integration + +Using Terraform private registries with the tofu-controller is exactly as you would use them directly via Terraform. +For example, you would like to use the tofu-controller to deploy code that contains the following module: +```terraform +module "vpc" { + source = "my.private.server/terraform-modules/path/to/module" + version = "1.2.3" + + ... + ... +} +``` +without configuring the terraform login process, deploying the module with the controller will result in the error: +```shell +Failed to retrieve available versions for module "vpc" (main.tf:1) from +my.private.server: error looking up module versions: 401 Unauthorized. +``` + +### Terraform Login +As a human you would normally execute `terraform login my.private.server` to obtain a token from the registry, +with the tofu-controller use the native [terraform credentials](https://developer.hashicorp.com/terraform/cli/config/config-file#credentials) configs instead. + +Obtain a token from your private registry, then follow one of the below options: + +#### Using credentials file + +content of `credentials.tfrc` should look like: +```json +{ + "credentials": { + "my.private.server": { + "token": "TOP_SECRET_TOKEN" + } + } +} +``` + +K8S secret example: +```yaml +apiVersion: "v1" +kind: "Secret" +metadata: + name: tf-private-config +type: "Opaque" +stringData: + credentials.tfrc: |- + { + "credentials": { + "my.private.server": { + "token": "TOP_SECRET_TOKEN" + } + } + } +``` +Then deploy the Terraform object, while referencing the above `tf-private-config` secret +```yaml +apiVersion: infra.contrib.fluxcd.io/v1alpha2 +kind: Terraform +metadata: + name: tf-private-demo + namespace: flux-system +spec: + approvePlan: auto + interval: 2m + path: ./terraform/tf-private-demo + cliConfigSecretRef: + name: tf-private-config + namespace: flux-system + sourceRef: + kind: GitRepository + name: flux-system + namespace: flux-system +``` +--- +#### Using environment variables +Another option is to use [environment variable credentials](https://developer.hashicorp.com/terraform/cli/config/config-file#environment-variable-credentials), +Terraform object should look like: +```yaml +apiVersion: infra.contrib.fluxcd.io/v1alpha2 +kind: Terraform +metadata: + name: tf-private-demo + namespace: flux-system +spec: + approvePlan: auto + interval: 2m + path: ./terraform/tf-private-demo + sourceRef: + kind: GitRepository + name: flux-system + namespace: flux-system + # api referance https://flux-iac.github.io/tofu-controller/References/terraform/#infra.contrib.fluxcd.io/v1alpha2.RunnerPodTemplate + runnerPodTemplate: + spec: + env: + - name: "TF_TOKEN_my_private_server" + value: "TOP_SECRET_TOKEN" + # or use get ENV from existing secret + envFrom: + - secretRef: + name: tf-private-token +``` \ No newline at end of file From dd0d7b363cb059f6a892960fb731d699db10da34 Mon Sep 17 00:00:00 2001 From: aksel-skaar-leirvaag Date: Wed, 13 Mar 2024 10:49:18 +0100 Subject: [PATCH 36/42] helm-chart: add watchAllNamespaces argument --- charts/tf-controller/README.md | 1 + charts/tf-controller/templates/deployment.yaml | 2 +- charts/tf-controller/values.yaml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index 8aa1adca4..5027cb33a 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -93,6 +93,7 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | usePodSubdomainResolution | bool | `false` | Argument for `--use-pod-subdomain-resolution` (Controller). UsePodSubdomainResolution allow pod hostname/subdomain DNS resolution for the pod runner instead of IP based DNS resolution. | | volumeMounts | list | `[]` | Volume mounts properties for the TF-Controller deployment | | volumes | list | `[]` | Volumes properties for the TF-Controller deployment | +| watchAllNamespaces | bool | `true` | If `true`, controller will watch all namespaces for Terraform resources | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0) \ No newline at end of file diff --git a/charts/tf-controller/templates/deployment.yaml b/charts/tf-controller/templates/deployment.yaml index be8d7683d..7fd4fede2 100644 --- a/charts/tf-controller/templates/deployment.yaml +++ b/charts/tf-controller/templates/deployment.yaml @@ -30,7 +30,7 @@ spec: containers: - args: - --allow-cross-namespace-refs={{ .Values.allowCrossNamespaceRefs }} - - --watch-all-namespaces + - --watch-all-namespaces={{ .Values.watchAllNamespaces }} - --log-level={{ .Values.logLevel }} - --log-encoding={{ .Values.logEncoding }} - --enable-leader-election diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index 03caad302..c1e6ffc71 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -1,5 +1,7 @@ # -- If `true`, enable cross-namespace references for controller and branch-planner allowCrossNamespaceRefs: false +# -- If `true`, controller will watch all namespaces for Terraform resources +watchAllNamespaces: true # ServiceAccount serviceAccount: # -- If `true`, create a new service account From 343793564092f7fa60b72f94010b0fb38797d98c Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Wed, 13 Mar 2024 21:57:58 +0700 Subject: [PATCH 37/42] change weaveworks to flux-iac org in the release pipeline --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c8c75d6b..c1fd8412f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -194,7 +194,7 @@ jobs: kustomize build ./config/rbac > ./config/release/${{ env.CONTROLLER }}.rbac.yaml kustomize build ./config/manager | yq e '.spec.template.spec.containers[0].env[1].value="ghcr.io/flux-iac/tf-runner:${{ steps.prep.outputs.VERSION }}"' - > ./config/release/${{ env.CONTROLLER }}.deployment.yaml kustomize build ./config/package > ./config/release/${{ env.CONTROLLER }}.packages.yaml - echo '[CHANGELOG](https://github.com/weaveworks/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md + echo '[CHANGELOG](https://github.com/flux-iac/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md - name: Setup Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: From e106a09216cd009e09b27f9924aa83cffb1bc30d Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Wed, 13 Mar 2024 22:03:22 +0700 Subject: [PATCH 38/42] bump chart and doc yamls to v0.16.0-rc.4 Signed-off-by: Chanwit Kaewkasi --- charts/tf-controller/Chart.yaml | 4 ++-- charts/tf-controller/values.yaml | 4 ++-- config/branch-planner/kustomization.yaml | 2 +- config/manager/kustomization.yaml | 2 +- docs/branch-planner/release.yaml | 8 ++++---- docs/release.yaml | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/charts/tf-controller/Chart.yaml b/charts/tf-controller/Chart.yaml index 8a4323801..f211f7497 100644 --- a/charts/tf-controller/Chart.yaml +++ b/charts/tf-controller/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: tf-controller description: The Helm chart for Weave GitOps Terraform Controller type: application -version: 0.16.0-rc.3 -appVersion: "v0.16.0-rc.3" +version: 0.16.0-rc.4 +appVersion: "v0.16.0-rc.4" diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index c1e6ffc71..70d56f28f 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -29,7 +29,7 @@ image: pullPolicy: IfNotPresent # -- Overrides the image tag whose default is the chart appVersion. # @default -- `.Chart.AppVersion` - tag: "v0.16.0-rc.3" + tag: "v0.16.0-rc.4" # -- Controller image pull secret imagePullSecrets: [] # -- Resource limits and requests @@ -119,7 +119,7 @@ runner: repository: ghcr.io/flux-iac/tf-runner # -- Runner image tag # @default -- `.Chart.AppVersion` - tag: "v0.16.0-rc.3" + tag: "v0.16.0-rc.4" grpc: # -- Maximum GRPC message size (Controller) maxMessageSize: 4 diff --git a/config/branch-planner/kustomization.yaml b/config/branch-planner/kustomization.yaml index 8a016b24f..4cb62f6bb 100644 --- a/config/branch-planner/kustomization.yaml +++ b/config/branch-planner/kustomization.yaml @@ -8,4 +8,4 @@ generatorOptions: images: - name: flux-iac/branch-planner newName: ghcr.io/flux-iac/branch-planner - newTag: v0.16.0-rc.3 + newTag: v0.16.0-rc.4 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index b9857e6ae..23084b51f 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -8,4 +8,4 @@ generatorOptions: images: - name: flux-iac/tofu-controller newName: ghcr.io/flux-iac/tofu-controller - newTag: v0.16.0-rc.3 + newTag: v0.16.0-rc.4 diff --git a/docs/branch-planner/release.yaml b/docs/branch-planner/release.yaml index e4723c99a..d155d3e57 100644 --- a/docs/branch-planner/release.yaml +++ b/docs/branch-planner/release.yaml @@ -21,7 +21,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '>=0.16.0-rc.3' + version: '>=0.16.0-rc.4' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system @@ -46,13 +46,13 @@ spec: caCertValidityDuration: 24h certRotationCheckFrequency: 30m image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 runner: image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 grpc: maxMessageSize: 30 branchPlanner: enabled: true image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 diff --git a/docs/release.yaml b/docs/release.yaml index a06da03f2..bc7aa1083 100644 --- a/docs/release.yaml +++ b/docs/release.yaml @@ -21,7 +21,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '>=0.16.0-rc.3' + version: '>=0.16.0-rc.4' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system @@ -46,9 +46,9 @@ spec: caCertValidityDuration: 24h certRotationCheckFrequency: 30m image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 runner: image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 grpc: maxMessageSize: 30 From 2bce19fe748fb99a67c28fac427d8193c4463c38 Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Wed, 13 Mar 2024 22:07:25 +0700 Subject: [PATCH 39/42] make helm-docs Signed-off-by: Chanwit Kaewkasi --- charts/tf-controller/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/tf-controller/README.md b/charts/tf-controller/README.md index 5027cb33a..84b67107c 100644 --- a/charts/tf-controller/README.md +++ b/charts/tf-controller/README.md @@ -1,6 +1,6 @@ # Weave GitOps Terraform Controller -![Version: 0.16.0-rc.3](https://img.shields.io/badge/Version-0.16.0--rc.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.16.0-rc.3](https://img.shields.io/badge/AppVersion-v0.16.0--rc.3-informational?style=flat-square) +![Version: 0.16.0-rc.4](https://img.shields.io/badge/Version-0.16.0--rc.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.16.0-rc.4](https://img.shields.io/badge/AppVersion-v0.16.0--rc.4-informational?style=flat-square) The Helm chart for Weave GitOps Terraform Controller @@ -76,7 +76,7 @@ __Note__: If you need to use the `imagePullSecrets` it would be best to set `ser | rbac.create | bool | `true` | If `true`, create and use RBAC resources | | replicaCount | int | `1` | Number of TF-Controller pods to deploy | | resources | object | `{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"64Mi"}}` | Resource limits and requests | -| runner | object | `{"creationTimeout":"5m0s","grpc":{"maxMessageSize":4},"image":{"repository":"ghcr.io/flux-iac/tf-runner","tag":"v0.16.0-rc.3"},"serviceAccount":{"allowedNamespaces":[],"annotations":{},"create":true,"name":""}}` | Runner-specific configurations | +| runner | object | `{"creationTimeout":"5m0s","grpc":{"maxMessageSize":4},"image":{"repository":"ghcr.io/flux-iac/tf-runner","tag":"v0.16.0-rc.4"},"serviceAccount":{"allowedNamespaces":[],"annotations":{},"create":true,"name":""}}` | Runner-specific configurations | | runner.creationTimeout | string | `"5m0s"` | Timeout for runner-creation (Controller) | | runner.grpc.maxMessageSize | int | `4` | Maximum GRPC message size (Controller) | | runner.image.repository | string | `"ghcr.io/flux-iac/tf-runner"` | Runner image repository | From 0d0b813e301d6c6404b7bffa013e5976a3846f65 Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Thu, 14 Mar 2024 02:44:05 +0700 Subject: [PATCH 40/42] update changelog Signed-off-by: Chanwit Kaewkasi --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7777d152..dfcce2aee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,44 @@ All notable changes of this project are documented in this file. +# v0.16.0-rc.4 + +**Release date:** 2024-03-14 + +This is the first release of the project after rebooting under its new name and organization: Tofu Controller, now part of the Flux-IaC organization. Fully driven by our community, Tofu Controller and Flux-IaC aim to help innovate the development of Infrastructure as Code (IaC) controllers for Flux. + +Thank you so much to our vibrant community, which propelled us to reach 1,000 stars on GitHub recently. + +With the renaming of the controller, our community has identified several breaking changes, although some may have been missed. The transition from Weave TF-Controller to Flux-IaC Tofu-Controller could be challenging. We advise: + + * Backing up your Terraform states (tfstates) + * Setting `spec.destroyResourcesOnDeletion=false` to avoid unintentional resource deletion + * Pausing all Terraform CRs + +before doing the upgrade. + +**BREAKING CHANGES** + + * The renaming of the controller. + * Reorganization of CRDs in the Helm Chart, which may lead to their uninstallation and reinstallation. + +New Features and Bug Fixing: + + * Pass missing build arg TARGETARCH to docker-build. + * Implement BLOB encryption within the tf-runner. + * Add `tfvars` feature and API. + * Generate checksum for cache blobs. + * Implement remediation retry. + * Add unique hash to cloned source to avoid conflict. + * Speed up compiling of binaries. + * Added config for building tf-runner image and using it in helloworld example. + * Bump version in manifest used in user guide to reflect latest RC. + * Document a fix to "terraform objects stuck on deletion" issue. + * Fix docker build breaking due to LIBCRYPTO_VERSION. + * Fix issues surfaced around the polling server. + * Add documentation about IPv6 support. + * Update branch planner default configuration. + # v0.16.0-rc.3 **Release date:** 2023-09-19 From 70c3ea041aa82e7beac41a33fda1466942c999b5 Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Thu, 14 Mar 2024 14:14:09 +0700 Subject: [PATCH 41/42] fix yamls in docs Signed-off-by: Chanwit Kaewkasi --- docs/rc-gke.yaml | 10 +++++----- docs/rc.yaml | 10 +++++----- docs/release.yaml | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/rc-gke.yaml b/docs/rc-gke.yaml index a44b9cdb9..cc03de485 100644 --- a/docs/rc-gke.yaml +++ b/docs/rc-gke.yaml @@ -7,9 +7,9 @@ metadata: spec: interval: 1h0s type: oci - url: oci://ghcr.io/weaveworks/charts + url: oci://ghcr.io/flux-iac/charts --- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: tf-controller @@ -21,7 +21,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '=0.16.0-rc.3' + version: '0.16.0-rc.4' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system @@ -43,7 +43,7 @@ spec: certRotationCheckFrequency: 30m usePodSubdomainResolution: true image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 runner: image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 diff --git a/docs/rc.yaml b/docs/rc.yaml index 13cdffae4..d16b46ac5 100644 --- a/docs/rc.yaml +++ b/docs/rc.yaml @@ -7,9 +7,9 @@ metadata: spec: interval: 1h0s type: oci - url: oci://ghcr.io/weaveworks/charts + url: oci://ghcr.io/flux-iac/charts --- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: tf-controller @@ -21,7 +21,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '>=0.16.0-rc.3' + version: '0.16.0-rc.4' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system @@ -42,7 +42,7 @@ spec: caCertValidityDuration: 24h certRotationCheckFrequency: 30m image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 runner: image: - tag: v0.16.0-rc.3 + tag: v0.16.0-rc.4 diff --git a/docs/release.yaml b/docs/release.yaml index bc7aa1083..053faa891 100644 --- a/docs/release.yaml +++ b/docs/release.yaml @@ -7,9 +7,9 @@ metadata: spec: interval: 1h0s type: oci - url: oci://ghcr.io/weaveworks/charts + url: oci://ghcr.io/flux-iac/charts --- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: tf-controller @@ -21,7 +21,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '>=0.16.0-rc.4' + version: '0.16.0-rc.4' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system From 13ca68b6d03066fba987446dc900a5415d9dc515 Mon Sep 17 00:00:00 2001 From: Angel Yanev Date: Thu, 14 Mar 2024 12:44:06 +0200 Subject: [PATCH 42/42] Fix runner-serviceaccount helm template The end statement for the custom imagePullSecrets is wrongly placed af the bottom of the yaml file. Instead it should be placed at the end of the ServiceAccount definition. --- charts/tf-controller/templates/runner-serviceaccount.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tf-controller/templates/runner-serviceaccount.yaml b/charts/tf-controller/templates/runner-serviceaccount.yaml index b811d64fb..ab785f019 100644 --- a/charts/tf-controller/templates/runner-serviceaccount.yaml +++ b/charts/tf-controller/templates/runner-serviceaccount.yaml @@ -15,6 +15,7 @@ metadata: {{- with $.Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 2 }} +{{- end }} --- apiVersion: v1 kind: Secret @@ -26,4 +27,3 @@ metadata: type: kubernetes.io/service-account-token {{- end }} {{- end }} -{{- end }}