-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deployment await logic for accurate rollout detection (#2756)
### Proposed changes This pull request enhances the deployment await logic to accurately identify whether a deployment has triggered a rollout. In the previous implementation, the logic relied on flagging a rollout if the pod template spec had changed. However, this approach proved inaccurate, as instances arose where a pod template spec update did not necessarily result in a replicaset rollout. Specifically, when users explicitly defined a default field, the await logic would run until timeout, erroneously reporting that the deployment failed to complete. The revised logic now assesses whether the new deployment revision has been incremented compared to the previous deployment. #### Changes made: - Updated logic for determining Deployment rollout triggers - Added unit tests - Addressed data race conditions in existing unit tests - Added additional step to existing e2e test case to validate CUJ is fixed (test fails on older provider version, but passes on new version) ### Related issues (optional) Fixes: #2662
- Loading branch information
Showing
6 changed files
with
256 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2016-2024, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import * as k8s from "@pulumi/kubernetes"; | ||
|
||
export const namespace = new k8s.core.v1.Namespace("test-namespace"); | ||
|
||
const appLabels = { app: "nginx" }; | ||
new k8s.apps.v1.Deployment("nginx", { | ||
metadata: { namespace: namespace.metadata.name }, | ||
spec: { | ||
selector: { matchLabels: appLabels }, | ||
replicas: 1, | ||
template: { | ||
metadata: { labels: appLabels }, | ||
spec: { | ||
containers: [ | ||
{ | ||
name: "nginx", | ||
image: "nginx:stable", | ||
ports: [{ containerPort: 80 }], | ||
}, | ||
], | ||
schedulerName: "default-scheduler", // No-op update that doesn't result in a new replica set rollout. | ||
}, | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.