diff --git a/RELEASE b/RELEASE index 49178c1e85..a6cc23e964 100644 --- a/RELEASE +++ b/RELEASE @@ -1,4 +1,4 @@ -tag: v0.44.0 +tag: v0.44.2 releaseNoteGenerator: showCommitter: false diff --git a/docs/content/en/blog/releases/v0.44.1.md b/docs/content/en/blog/releases/v0.44.1.md new file mode 100644 index 0000000000..4bf7617aa8 --- /dev/null +++ b/docs/content/en/blog/releases/v0.44.1.md @@ -0,0 +1,13 @@ +--- +title: "Release v0.44.1" +linkTitle: "Release v0.44.1" +date: 2023-06-26 +description: > + Release v0.44.1 +--- + +## Changes since v0.44.0 + +### Bug Fixes + +* Fix Terraform drift render logic that causes runtime error ([#4444](https://github.com/pipe-cd/pipecd/pull/4444)) diff --git a/docs/content/en/blog/releases/v0.44.2.md b/docs/content/en/blog/releases/v0.44.2.md new file mode 100644 index 0000000000..9b6d88434e --- /dev/null +++ b/docs/content/en/blog/releases/v0.44.2.md @@ -0,0 +1,25 @@ +--- +title: "Release v0.44.2" +linkTitle: "Release v0.44.2" +date: 2023-07-12 +description: > + Release v0.44.2 +--- + +## Changes since v0.44.1 +### New Features +* Enable to install Helm and Kustomize if both versions are specified ([#4463](https://github.com/pipe-cd/pipecd/pull/4463)) +* Support AWS LoadBalancer with multi listeners ([#4462](https://github.com/pipe-cd/pipecd/pull/4462)) + +### Notable Changes +* Update logs message for ECS routing stage executor ([#4466](https://github.com/pipe-cd/pipecd/pull/4466)) +* Output usage only when flag parsing fails [#4381](https://github.com/pipe-cd/pipecd/pull/4381) ([#4464](https://github.com/pipe-cd/pipecd/pull/4464)) +* Update quickstart to support arm hardware(ex: M1) ([#4457](https://github.com/pipe-cd/pipecd/pull/4457)) + +### Bug Fixes +* Skip update AppState when no log updates ([#4482](https://github.com/pipe-cd/pipecd/pull/4482)) +* Update deprecated apiVersion since GKE removed ([#4469](https://github.com/pipe-cd/pipecd/pull/4469)) +* Fix ECS rollback stage does not remove canary created tasks ([#4465](https://github.com/pipe-cd/pipecd/pull/4465)) + +### Internal Changes +* Update web deps ([#4451](https://github.com/pipe-cd/pipecd/pull/4451)) diff --git a/docs/content/en/docs-dev/user-guide/managing-piped/configuration-reference.md b/docs/content/en/docs-dev/user-guide/managing-piped/configuration-reference.md index 003776225c..16bf1a022d 100644 --- a/docs/content/en/docs-dev/user-guide/managing-piped/configuration-reference.md +++ b/docs/content/en/docs-dev/user-guide/managing-piped/configuration-reference.md @@ -110,6 +110,7 @@ Must be one of the following structs: | Field | Type | Description | Required | |-|-|-|-| | vars | []string | List of variables that will be set directly on terraform commands with `-var` flag. The variable must be formatted by `key=value`. | No | +| driftDetectionEnabled | bool | Enable drift detection. This is a temporary option and will be possibly removed in the future release. Default is `true` | No | ### PlatformProviderCloudRunConfig diff --git a/pkg/app/piped/controller/controller.go b/pkg/app/piped/controller/controller.go index d99eab7fea..76e057de3c 100644 --- a/pkg/app/piped/controller/controller.go +++ b/pkg/app/piped/controller/controller.go @@ -364,7 +364,7 @@ func (c *controller) syncPlanners(ctx context.Context) error { if pre, ok := pendingByApp[appID]; ok && !d.TriggerBefore(pre) { continue } - controllermetrics.UpdateDeploymentStatus(d.Id, d.Status, d.Kind, d.PlatformProvider) + controllermetrics.UpdateDeploymentStatus(d, d.Status) pendingByApp[appID] = d } diff --git a/pkg/app/piped/controller/controllermetrics/metrics.go b/pkg/app/piped/controller/controllermetrics/metrics.go index e4d4ef24df..d2f8c0e001 100644 --- a/pkg/app/piped/controller/controllermetrics/metrics.go +++ b/pkg/app/piped/controller/controllermetrics/metrics.go @@ -21,6 +21,8 @@ import ( const ( deploymentIDKey = "deployment" + applicationIDKey = "application_id" + applicationNameKey = "application_name" applicationKindKey = "application_kind" platformProviderKey = "platform_provider" deploymentStatusKey = "status" @@ -32,16 +34,16 @@ var ( Name: "deployment_status", Help: "The current status of deployment. 1 for current status, 0 for others.", }, - []string{deploymentIDKey, applicationKindKey, platformProviderKey, deploymentStatusKey}, + []string{deploymentIDKey, applicationIDKey, applicationNameKey, applicationKindKey, platformProviderKey, deploymentStatusKey}, ) ) -func UpdateDeploymentStatus(id string, status model.DeploymentStatus, applicationKind model.ApplicationKind, platformProvider string) { +func UpdateDeploymentStatus(d *model.Deployment, status model.DeploymentStatus) { for name, value := range model.DeploymentStatus_value { if model.DeploymentStatus(value) == status { - deploymentStatus.WithLabelValues(id, applicationKind.String(), platformProvider, name).Set(1) + deploymentStatus.WithLabelValues(d.Id, d.ApplicationId, d.ApplicationName, d.Kind.String(), d.PlatformProvider, name).Set(1) } else { - deploymentStatus.WithLabelValues(id, applicationKind.String(), platformProvider, name).Set(0) + deploymentStatus.WithLabelValues(d.Id, d.ApplicationId, d.ApplicationName, d.Kind.String(), d.PlatformProvider, name).Set(0) } } } diff --git a/pkg/app/piped/controller/planner.go b/pkg/app/piped/controller/planner.go index 94c5ac716d..0beef633c2 100644 --- a/pkg/app/piped/controller/planner.go +++ b/pkg/app/piped/controller/planner.go @@ -189,7 +189,7 @@ func (p *planner) Run(ctx context.Context) error { } defer func() { - controllermetrics.UpdateDeploymentStatus(p.deployment.Id, p.doneDeploymentStatus, p.deployment.Kind, p.deployment.PlatformProvider) + controllermetrics.UpdateDeploymentStatus(p.deployment, p.doneDeploymentStatus) }() planner, ok := p.plannerRegistry.Planner(p.deployment.Kind) diff --git a/pkg/app/piped/controller/scheduler.go b/pkg/app/piped/controller/scheduler.go index cb04e95d2d..91e0bf63a2 100644 --- a/pkg/app/piped/controller/scheduler.go +++ b/pkg/app/piped/controller/scheduler.go @@ -193,7 +193,7 @@ func (s *scheduler) Run(ctx context.Context) error { defer func() { s.doneTimestamp = s.nowFunc() s.doneDeploymentStatus = deploymentStatus - controllermetrics.UpdateDeploymentStatus(s.deployment.Id, deploymentStatus, s.deployment.Kind, s.deployment.PlatformProvider) + controllermetrics.UpdateDeploymentStatus(s.deployment, deploymentStatus) s.done.Store(true) }() @@ -209,7 +209,7 @@ func (s *scheduler) Run(ctx context.Context) error { if err != nil { return err } - controllermetrics.UpdateDeploymentStatus(s.deployment.Id, model.DeploymentStatus_DEPLOYMENT_RUNNING, s.deployment.Kind, s.deployment.PlatformProvider) + controllermetrics.UpdateDeploymentStatus(s.deployment, model.DeploymentStatus_DEPLOYMENT_RUNNING) } var ( diff --git a/pkg/app/piped/driftdetector/detector.go b/pkg/app/piped/driftdetector/detector.go index eb86444605..e4e803a569 100644 --- a/pkg/app/piped/driftdetector/detector.go +++ b/pkg/app/piped/driftdetector/detector.go @@ -132,6 +132,9 @@ func NewDetector( )) case model.PlatformProviderTerraform: + if !*cp.TerraformConfig.DriftDetectionEnabled { + continue + } sg, ok := stateGetter.TerraformGetter(cp.Name) if !ok { return nil, fmt.Errorf(format, cp.Name) diff --git a/pkg/config/piped.go b/pkg/config/piped.go index 5f1545b0e7..dc331e069d 100644 --- a/pkg/config/piped.go +++ b/pkg/config/piped.go @@ -642,6 +642,9 @@ type PlatformProviderTerraformConfig struct { // 'image_id_list=["ami-abc123","ami-def456"]' // 'image_id_map={"us-east-1":"ami-abc123","us-east-2":"ami-def456"}' Vars []string `json:"vars,omitempty"` + // Enable drift detection. + // TODO: This is a temporary option because Terraform drift detection is buggy and has performace issues. This will be possibly removed in the future release. + DriftDetectionEnabled *bool `json:"driftDetectionEnabled" default:"true"` } type PlatformProviderCloudRunConfig struct { diff --git a/pkg/config/piped_test.go b/pkg/config/piped_test.go index e8126c988b..bf43023188 100644 --- a/pkg/config/piped_test.go +++ b/pkg/config/piped_test.go @@ -129,6 +129,7 @@ func TestPipedConfig(t *testing.T) { "project=gcp-project", "region=us-centra1", }, + DriftDetectionEnabled: newBoolPointer(false), }, }, { diff --git a/pkg/config/testdata/piped/piped-config.yaml b/pkg/config/testdata/piped/piped-config.yaml index 179cac3cff..518228d3dd 100644 --- a/pkg/config/testdata/piped/piped-config.yaml +++ b/pkg/config/testdata/piped/piped-config.yaml @@ -64,6 +64,7 @@ spec: vars: - "project=gcp-project" - "region=us-centra1" + driftDetectionEnabled: false - name: cloudrun type: CLOUDRUN