diff --git a/.changes/2.10.0.md b/.changes/2.10.0.md new file mode 100644 index 00000000..086a8509 --- /dev/null +++ b/.changes/2.10.0.md @@ -0,0 +1,38 @@ +## 2.10.0 (November 12, 2025) + +NOTES: + +* `RunsCollector`: Add new Prometheus-compatible metrics `hcp_tf_runs` and `hcp_tf_runs_total` to collect pending runs by status and the total number of pending runs, respectively. These metrics are in the alpha stage and subject to change. [[GH-637](https://github.com/hashicorp/hcp-terraform-operator/pull/637)] + +BUG FIXES: + +* `Workspace`: Fix an issue where sensitive Terraform or Environment variables are not updated when their sensitivity changes. [[GH-629](https://github.com/hashicorp/hcp-terraform-operator/pull/629)] +* `AgentPool`: Exclude runs awaiting user interaction from scaling to prevent agents from being kept unnecessarily active. [[GH-618](https://github.com/hashicorp/hcp-terraform-operator/pull/618)] +* `AgentPool`: Fix version parsing for Terraform Enterprise version format changes. [[GH-641](https://github.com/hashicorp/hcp-terraform-operator/pull/641)] + +FEATURES: + +* `RunsCollector`: Introduce a new controller that scrapes HCP Terraform run statuses from a specified Agent Pool and exposes them as Prometheus-compatible metrics. [[GH-637](https://github.com/hashicorp/hcp-terraform-operator/pull/637)] +* `AgentToken`: Introduce a new controller that manages tokens in arbitrary agent pools. [[GH-628](https://github.com/hashicorp/hcp-terraform-operator/pull/628)] + +ENHANCEMENTS: + +* `Controllers`: Add a new annotation, `app.terraform.io/paused`, to pause reconciliation for a specific CR. [[GH-631](https://github.com/hashicorp/hcp-terraform-operator/pull/631)] +* `AgentPool`: Update Kubernetes Secret synchronization to perform batch updates at the end of agent token reconciliation, reducing API calls and preventing race conditions. [[GH-650](https://github.com/hashicorp/hcp-terraform-operator/pull/650)] + +DEPENDENCIES: + +* Bump `kube-rbac-proxy` from 0.19.1 to 0.20.0. [[GH-640](https://github.com/hashicorp/hcp-terraform-operator/pull/640)] +* Bump `k8s.io/api` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `k8s.io/apimachinery` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `github.com/hashicorp/go-slug` from 0.16.4 to 0.16.7. [[GH-644](https://github.com/hashicorp/hcp-terraform-operator/pull/644)] +* Bump `github.com/hashicorp/go-tfe` from 1.76.0 to 1.93.0. [[GH-644](https://github.com/hashicorp/hcp-terraform-operator/pull/644)] +* Bump `k8s.io/client-go` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `sigs.k8s.io/controller-runtime` from 0.20.4 to 0.22.4. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] + +## Community Contributors :raised_hands: + +- @AleksaC made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/617 +- @jrindy-iterable made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/618 +- @nhomble made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/627 + diff --git a/.changes/unreleased/BUG FIXES-618-20250806-133210.yaml b/.changes/unreleased/BUG FIXES-618-20250806-133210.yaml deleted file mode 100644 index 256cca84..00000000 --- a/.changes/unreleased/BUG FIXES-618-20250806-133210.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: '`AgentPool`:Adjust pendingWorkspaceRuns to not count workspaces with a status requiring user interaction since they can sit in that state for an unknown amount of time.' -time: 2025-08-06T13:32:10.293471-05:00 -custom: - PR: "618" diff --git a/.changes/unreleased/BUG FIXES-629-20250804-183959.yaml b/.changes/unreleased/BUG FIXES-629-20250804-183959.yaml deleted file mode 100644 index 2e1f3660..00000000 --- a/.changes/unreleased/BUG FIXES-629-20250804-183959.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: '`Workspace`: Fix an issue where sensitive Terraform or Environment variables are not updated when their sensitivity changes.' -time: 2025-08-04T18:39:59.523146+02:00 -custom: - PR: "629" diff --git a/.changes/unreleased/BUG FIXES-638-20250918-163816.yaml b/.changes/unreleased/BUG FIXES-638-20250918-163816.yaml deleted file mode 100644 index aab7aa6a..00000000 --- a/.changes/unreleased/BUG FIXES-638-20250918-163816.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: BUG FIXES -body: Support TFE versions of type vX.Y.Z -time: 2025-09-18T16:38:16.255351-07:00 -custom: - PR: "641" diff --git a/.changes/unreleased/DEPENDENCIES-640-20250919-114007.yaml b/.changes/unreleased/DEPENDENCIES-640-20250919-114007.yaml deleted file mode 100644 index 8c73cc07..00000000 --- a/.changes/unreleased/DEPENDENCIES-640-20250919-114007.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `kube-rbac-proxy` from 0.19.1 to 0.20.0. -time: 2025-09-19T11:40:07.913853+02:00 -custom: - PR: "640" diff --git a/.changes/unreleased/DEPENDENCIES-643-20251105-104449.yaml b/.changes/unreleased/DEPENDENCIES-643-20251105-104449.yaml deleted file mode 100644 index 40b0aa01..00000000 --- a/.changes/unreleased/DEPENDENCIES-643-20251105-104449.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `k8s.io/api` from 0.32.3 to 0.34.1. -time: 2025-11-05T10:44:49.417608+01:00 -custom: - PR: "643" diff --git a/.changes/unreleased/DEPENDENCIES-643-20251105-104451.yaml b/.changes/unreleased/DEPENDENCIES-643-20251105-104451.yaml deleted file mode 100644 index baf2e92a..00000000 --- a/.changes/unreleased/DEPENDENCIES-643-20251105-104451.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `k8s.io/apimachinery` from 0.32.3 to 0.34.1. -time: 2025-11-05T10:44:51.785712+01:00 -custom: - PR: "643" diff --git a/.changes/unreleased/DEPENDENCIES-643-20251105-104842.yaml b/.changes/unreleased/DEPENDENCIES-643-20251105-104842.yaml deleted file mode 100644 index 6548a995..00000000 --- a/.changes/unreleased/DEPENDENCIES-643-20251105-104842.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `k8s.io/client-go` from 0.32.3 to 0.34.1. -time: 2025-11-05T10:48:42.397219+01:00 -custom: - PR: "643" diff --git a/.changes/unreleased/DEPENDENCIES-643-20251105-105011.yaml b/.changes/unreleased/DEPENDENCIES-643-20251105-105011.yaml deleted file mode 100644 index b8efa8de..00000000 --- a/.changes/unreleased/DEPENDENCIES-643-20251105-105011.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `sigs.k8s.io/controller-runtime` from 0.20.4 to 0.22.4. -time: 2025-11-05T10:50:11.541114+01:00 -custom: - PR: "643" diff --git a/.changes/unreleased/DEPENDENCIES-644-20251105-104657.yaml b/.changes/unreleased/DEPENDENCIES-644-20251105-104657.yaml deleted file mode 100644 index 01191796..00000000 --- a/.changes/unreleased/DEPENDENCIES-644-20251105-104657.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `github.com/hashicorp/go-slug` from 0.16.4 to 0.16.7. -time: 2025-11-05T10:46:57.472+01:00 -custom: - PR: "644" diff --git a/.changes/unreleased/DEPENDENCIES-644-20251105-104659.yaml b/.changes/unreleased/DEPENDENCIES-644-20251105-104659.yaml deleted file mode 100644 index 63a8963b..00000000 --- a/.changes/unreleased/DEPENDENCIES-644-20251105-104659.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: DEPENDENCIES -body: Bump `github.com/hashicorp/go-tfe` from 1.76.0 to 1.93.0. -time: 2025-11-05T10:46:59.644113+01:00 -custom: - PR: "644" diff --git a/.changes/unreleased/ENHANCEMENTS-631-20250813-084714.yaml b/.changes/unreleased/ENHANCEMENTS-631-20250813-084714.yaml deleted file mode 100644 index 886a200e..00000000 --- a/.changes/unreleased/ENHANCEMENTS-631-20250813-084714.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: ENHANCEMENTS -body: '`Controllers`: Add a new annotation, `app.terraform.io/paused`, to pause reconciliation for a specific CR.' -time: 2025-08-13T08:47:14.104109+02:00 -custom: - PR: "631" diff --git a/.changes/unreleased/ENHANCEMENTS-650-20251028-125628.yaml b/.changes/unreleased/ENHANCEMENTS-650-20251028-125628.yaml deleted file mode 100644 index 3c0deea1..00000000 --- a/.changes/unreleased/ENHANCEMENTS-650-20251028-125628.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: ENHANCEMENTS -body: '`AgentPool`: Update Kubernetes Secret synchronization to perform batch updates at the end of agent token reconciliation, reducing API calls and preventing race conditions.' -time: 2025-10-28T12:56:28.082375+01:00 -custom: - PR: "650" diff --git a/.changes/unreleased/FEATURES-628-20250925-091657.yaml b/.changes/unreleased/FEATURES-628-20250925-091657.yaml deleted file mode 100644 index 256c31b0..00000000 --- a/.changes/unreleased/FEATURES-628-20250925-091657.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: '`AgentToken`: Introduce a new controller that manages tokens in arbitrary agent pools.' -time: 2025-09-25T09:16:57.344633+02:00 -custom: - PR: "628" diff --git a/.changes/unreleased/FEATURES-637-20250922-132243.yaml b/.changes/unreleased/FEATURES-637-20250922-132243.yaml deleted file mode 100644 index 20fccbf0..00000000 --- a/.changes/unreleased/FEATURES-637-20250922-132243.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: FEATURES -body: '`RunsCollector`: Introduce a new controller that scrapes HCP Terraform run statuses from a specified Agent Pool and exposes them as Prometheus-compatible metrics.' -time: 2025-09-22T13:22:43.774802+02:00 -custom: - PR: "637" diff --git a/.changes/unreleased/NOTES-637-20250922-132629.yaml b/.changes/unreleased/NOTES-637-20250922-132629.yaml deleted file mode 100644 index 83c0a322..00000000 --- a/.changes/unreleased/NOTES-637-20250922-132629.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: NOTES -body: '`RunsCollector`: Add new Prometheus-compatible metrics `hcp_tf_runs` and `hcp_tf_runs_total` to collect pending runs by status and the total number of pending runs by status, respectively. These metrics are in the alpha stage and subject to change.' -time: 2025-09-22T13:26:29.977557+02:00 -custom: - PR: "637" diff --git a/CHANGELOG.md b/CHANGELOG.md index 12522879..ce06fcaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +## 2.10.0 (November 12, 2025) + +NOTES: + +* `RunsCollector`: Add new Prometheus-compatible metrics `hcp_tf_runs` and `hcp_tf_runs_total` to collect pending runs by status and the total number of pending runs, respectively. These metrics are in the alpha stage and subject to change. [[GH-637](https://github.com/hashicorp/hcp-terraform-operator/pull/637)] + +BUG FIXES: + +* `Workspace`: Fix an issue where sensitive Terraform or Environment variables are not updated when their sensitivity changes. [[GH-629](https://github.com/hashicorp/hcp-terraform-operator/pull/629)] +* `AgentPool`: Exclude runs awaiting user interaction from scaling to prevent agents from being kept unnecessarily active. [[GH-618](https://github.com/hashicorp/hcp-terraform-operator/pull/618)] +* `AgentPool`: Fix version parsing for Terraform Enterprise version format changes. [[GH-641](https://github.com/hashicorp/hcp-terraform-operator/pull/641)] + +FEATURES: + +* `RunsCollector`: Introduce a new controller that scrapes HCP Terraform run statuses from a specified Agent Pool and exposes them as Prometheus-compatible metrics. [[GH-637](https://github.com/hashicorp/hcp-terraform-operator/pull/637)] +* `AgentToken`: Introduce a new controller that manages tokens in arbitrary agent pools. [[GH-628](https://github.com/hashicorp/hcp-terraform-operator/pull/628)] + +ENHANCEMENTS: + +* `Controllers`: Add a new annotation, `app.terraform.io/paused`, to pause reconciliation for a specific CR. [[GH-631](https://github.com/hashicorp/hcp-terraform-operator/pull/631)] +* `AgentPool`: Update Kubernetes Secret synchronization to perform batch updates at the end of agent token reconciliation, reducing API calls and preventing race conditions. [[GH-650](https://github.com/hashicorp/hcp-terraform-operator/pull/650)] + +DEPENDENCIES: + +* Bump `kube-rbac-proxy` from 0.19.1 to 0.20.0. [[GH-640](https://github.com/hashicorp/hcp-terraform-operator/pull/640)] +* Bump `k8s.io/api` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `k8s.io/apimachinery` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `github.com/hashicorp/go-slug` from 0.16.4 to 0.16.7. [[GH-644](https://github.com/hashicorp/hcp-terraform-operator/pull/644)] +* Bump `github.com/hashicorp/go-tfe` from 1.76.0 to 1.93.0. [[GH-644](https://github.com/hashicorp/hcp-terraform-operator/pull/644)] +* Bump `k8s.io/client-go` from 0.32.3 to 0.34.1. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] +* Bump `sigs.k8s.io/controller-runtime` from 0.20.4 to 0.22.4. [[GH-643](https://github.com/hashicorp/hcp-terraform-operator/pull/643)] + +## Community Contributors :raised_hands: + +- @AleksaC made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/617 +- @jrindy-iterable made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/618 +- @nhomble made their contribution in https://github.com/hashicorp/hcp-terraform-operator/pull/627 + ## 2.9.2 (May 28, 2025) BUG FIXES: diff --git a/Dockerfile b/Dockerfile index 888f51b4..787e1221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ # Every target has a BIN_NAME argument that must be provided via --build-arg=BIN_NAME= # when building. -ARG GO_VERSION=1.25.1 +ARG GO_VERSION=1.25.4 # =================================== # diff --git a/Makefile b/Makefile index cb4a12b5..b3fd8078 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ copywrite: install-copywrite ## Run copywrite against code. .PHONY: test test: manifests generate fmt vet copywrite envtest ## Run tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -timeout 45m -v ./internal/controller -coverprofile cover.out ${TESTARGS} + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -timeout 1h -v ./internal/controller -coverprofile cover.out ${TESTARGS} .PHONY: test-api test-api: fmt vet copywrite ## Run API tests. diff --git a/README.md b/README.md index c9fd1ab8..9c75b1dd 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Three simple commands to install the Operator: ```console $ helm repo add hashicorp https://helm.releases.hashicorp.com $ helm repo update -$ helm install demo hashicorp/hcp-terraform-operator --wait --version 2.9.2 +$ helm install demo hashicorp/hcp-terraform-operator --wait --version 2.10.0 ``` More detailed information about the installation and available values can be found [here](./charts/hcp-terraform-operator/README.md). @@ -61,7 +61,7 @@ Controllers usage guides: - [AgentToken](./docs/agenttoken.md) - [Module](./docs/module.md) - [Project](./docs/project.md) -- [Runs Collector](./docs/runs_collector.md) +- [RunsCollector](./docs/runs_collector.md) - [Workspace](./docs/workspace.md) diff --git a/RELEASING.md b/RELEASING.md index b8a14b08..f95f43b5 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -47,10 +47,17 @@ To create a new release, adhere to the following steps: Note that the version option (`auto` in the example above) must match the option you selected earlier. If there are any issues, address them before proceeding. - Once the log entry appears as expected, proceed with the generation and merge your changes. + Once the log entry appears as expected, proceed with the generation. ```console $ changie batch auto + ``` + + _This is the time to review the corresponding changelog for the version in the `.changie/.md` file and update it if necessary. Please include any community contribution acknowledgements here._ + + Merge the release changes into the [`CHANGELOG`](./CHANGELOG.md) file. + + ```console $ changie merge ``` diff --git a/api/v1alpha2/runscollector_types.go b/api/v1alpha2/runscollector_types.go index 37fafc3d..80d66ddb 100644 --- a/api/v1alpha2/runscollector_types.go +++ b/api/v1alpha2/runscollector_types.go @@ -36,7 +36,7 @@ type RunsCollectorStatus struct { //+kubebuilder:printcolumn:name="Pool Name",type=string,JSONPath=`.status.agentPool.name` //+kubebuilder:metadata:labels="app.terraform.io/crd-schema-version=v25.11.0" -// Runs Collector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. +// RunsCollector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. // More information: // - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations type RunsCollector struct { diff --git a/charts/hcp-terraform-operator/Chart.yaml b/charts/hcp-terraform-operator/Chart.yaml index 6ed12e7b..99d26dd0 100644 --- a/charts/hcp-terraform-operator/Chart.yaml +++ b/charts/hcp-terraform-operator/Chart.yaml @@ -5,5 +5,5 @@ apiVersion: v2 name: hcp-terraform-operator description: Official Helm chart for HCP Terraform Operator for Kubernetes. type: application -version: "2.9.2" -appVersion: "2.9.2" +version: "2.10.0" +appVersion: "2.10.0" diff --git a/charts/hcp-terraform-operator/README.md b/charts/hcp-terraform-operator/README.md index 7b1ae745..8a6b3a70 100644 --- a/charts/hcp-terraform-operator/README.md +++ b/charts/hcp-terraform-operator/README.md @@ -25,7 +25,7 @@ Use the option `--version VERSION` with `helm install` and `helm upgrade` comman ```console $ helm install demo hashicorp/hcp-terraform-operator \ - --version 2.9.2 \ + --version 2.10.0 \ --namespace tfc-operator-system \ --create-namespace ``` @@ -36,7 +36,7 @@ Below are examples of the Operator installation/upgrade Helm chart with options. ```console $ helm install demo hashicorp/hcp-terraform-operator \ - --version 2.9.2 \ + --version 2.10.0 \ --namespace tfc-operator-system \ --create-namespace \ --set operator.syncPeriod=10m \ @@ -57,7 +57,7 @@ If targeting a Terraform Enterprise instance rather than HCP Terraform, set the ```console $ helm install demo hashicorp/hcp-terraform-operator \ - --version 2.9.2 \ + --version 2.10.0 \ --set operator.tfeAddress="https://tfe-api.my-company.com" ``` @@ -69,7 +69,7 @@ For more information, please refer to the [FAQ](./../../docs/faq.md#general-ques ```console $ helm upgrade demo hashicorp/hcp-terraform-operator \ - --version 2.9.2 \ + --version 2.10.0 \ --namespace hcp-terraform-operator-system \ --set operator.syncPeriod=5m \ --set controllers.agentPool.workers=5 \ diff --git a/charts/hcp-terraform-operator/crds/app.terraform.io_runscollectors.yaml b/charts/hcp-terraform-operator/crds/app.terraform.io_runscollectors.yaml index 7288d502..d643ca9e 100644 --- a/charts/hcp-terraform-operator/crds/app.terraform.io_runscollectors.yaml +++ b/charts/hcp-terraform-operator/crds/app.terraform.io_runscollectors.yaml @@ -30,7 +30,7 @@ spec: schema: openAPIV3Schema: description: |- - Runs Collector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. + RunsCollector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. More information: - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations properties: diff --git a/charts/test/go.mod b/charts/test/go.mod index 677559de..0bab7f98 100644 --- a/charts/test/go.mod +++ b/charts/test/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/hcp-terraform-operator/charts/test -go 1.25.1 +go 1.25.4 require ( github.com/gruntwork-io/terratest v0.47.2 diff --git a/config/crd/bases/app.terraform.io_runscollectors.yaml b/config/crd/bases/app.terraform.io_runscollectors.yaml index 7152c553..974ecc0e 100644 --- a/config/crd/bases/app.terraform.io_runscollectors.yaml +++ b/config/crd/bases/app.terraform.io_runscollectors.yaml @@ -27,7 +27,7 @@ spec: schema: openAPIV3Schema: description: |- - Runs Collector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. + RunsCollector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. More information: - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations properties: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index a7867fe9..afac155b 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: registry.connect.redhat.com/hashicorp/hcp-terraform-operator - newTag: 2.9.2 + newTag: 2.10.0 diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 47baf385..7ee5959c 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -68,6 +68,8 @@ spec: - --module-sync-period=5m - --project-workers=1 - --project-sync-period=5m + - --runs-collector-workers=1 + - --runs-collector-sync-period=15s - --workspace-workers=1 - --workspace-sync-period=5m image: controller:latest diff --git a/config/manifests/bases/hcp-terraform-operator.clusterserviceversion.yaml b/config/manifests/bases/hcp-terraform-operator.clusterserviceversion.yaml index 072d3012..4023d267 100644 --- a/config/manifests/bases/hcp-terraform-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/hcp-terraform-operator.clusterserviceversion.yaml @@ -63,7 +63,7 @@ spec: name: projects.app.terraform.io version: v1alpha2 - description: |- - Runs Collector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. + RunsCollector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. More information: - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations displayName: Runs Collector diff --git a/docs/api-reference.md b/docs/api-reference.md index fea630c0..c3647822 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -683,7 +683,7 @@ _Appears in:_ -Runs Collector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. +RunsCollector scraptes HCP Terraform Run statuses from a given Agent Pool and exposes them as Prometheus-compatible metrics. More information: - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations diff --git a/docs/metrics.md b/docs/metrics.md index 34d94c8b..4f10145d 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -15,6 +15,8 @@ Starting with version `2.10.0`, the operator introduces HCP Terraform–specific | `hcp_tf_runs{run_status, agent_pool_id, agent_pool_name}` | Gauge | Pending runs by statuses. | RunsCollector | Alpha | | `hcp_tf_runs_total{agent_pool_id, agent_pool_name}` | Gauge | Total number of pending Runs. | RunsCollector | Alpha | +_When combined with external scalers such as [KEDA](https://keda.sh/), runs-related metrics offer greater flexibility for scaling._ + ## Scraping Metrics How metrics are scraped will depend on how you operate your Prometheus server. The below example assumes that the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) is being used to run Prometheus. diff --git a/docs/runs_collector.md b/docs/runs_collector.md index 2a1435fb..5097c219 100644 --- a/docs/runs_collector.md +++ b/docs/runs_collector.md @@ -1,8 +1,8 @@ -# `Runs Collector` +# `RunsCollector` -`Runs Collector` controller scrapes HCP Terraform run statuses from a given Agent Pool. +The `RunsCollector` controller retrieves HCP Terraform run statuses from a specified Agent Pool and exposes them as Prometheus metrics. -Please refer to the [CRD](../config/crd/bases/app.terraform.io_runscollectors.yaml) and [API Reference](./api-reference.md#runscollector) to get the full list of available options. +For a complete list of available configuration options, refer to the [CRD](../config/crd/bases/app.terraform.io_runscollectors.yaml) and [API Reference](./api-reference.md#runscollector). Below is a basic example of a Runs Collector Custom Resource: @@ -23,6 +23,8 @@ spec: Once the above CR is applied, the Operator starts scraping run metrics from the `multik` agent pool under the `kubernetes-operator` organization. +Please refer to the [metrics page](./metrics.md#available-metrics) for a complete list of available metrics. + If you have any questions, please check out the [FAQ](./faq.md#runs-collector-controller). If you encounter any issues with the `RunsCollector` controller please refer to the [Troubleshooting](../README.md#troubleshooting). diff --git a/go.mod b/go.mod index d7ca030f..62833e99 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/hcp-terraform-operator -go 1.25.1 +go 1.25.4 require ( github.com/go-logr/logr v1.4.3 diff --git a/internal/controller/agentpool_controller_test.go b/internal/controller/agentpool_controller_test.go index e10199b3..fda54f69 100644 --- a/internal/controller/agentpool_controller_test.go +++ b/internal/controller/agentpool_controller_test.go @@ -99,7 +99,7 @@ var _ = Describe("Agent Pool controller", Ordered, func() { Eventually(func() bool { err := tfClient.AgentPools.Delete(ctx, instance.Status.AgentPoolID) - return err == tfc.ErrResourceNotFound || err == nil + return err == tfc.ErrResourceNotFound }).Should(BeTrue()) }) diff --git a/internal/controller/agenttoken_controller_test.go b/internal/controller/agenttoken_controller_test.go index 20986691..356f3638 100644 --- a/internal/controller/agenttoken_controller_test.go +++ b/internal/controller/agenttoken_controller_test.go @@ -71,7 +71,7 @@ var _ = Describe("AgentToken Controller", Ordered, func() { }) AfterEach(func() { - // DELETE AGENT POOL + // DELETE AGENT TOKEN RESOURCE Expect(k8sClient.Delete(ctx, instance)).Should(Succeed()) Eventually(func() bool { @@ -84,7 +84,7 @@ var _ = Describe("AgentToken Controller", Ordered, func() { return true } err := tfClient.AgentPools.Delete(ctx, instance.Status.AgentPool.ID) - return err == tfc.ErrResourceNotFound || err == nil + return err == tfc.ErrResourceNotFound }).Should(BeTrue()) }) diff --git a/version/VERSION b/version/VERSION index 5d9ade10..10c2c0c3 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -2.9.2 +2.10.0