-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure deplyoment await logic uses the latest deployment object (#2943)
### Proposed changes This PR ensures that we compare deployment revisions based on the old live object, and the most current deployment object. This PR does the following: - Add a repro test that fails before the change is applied - Only watch for deployment events until the deployment object has been reconciled by the deployment controller - Update existing unit tests to account for blocking unbuffered channels, and faked objects that did not have `.status.observedGeneration` ### Related issues (optional) Fixes: #2941
- Loading branch information
Showing
5 changed files
with
113 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// 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, | ||
annotations: { | ||
"pulumi.com/timeoutSeconds": "30", | ||
}, | ||
}, | ||
spec: { | ||
selector: { matchLabels: appLabels }, | ||
replicas: 1, | ||
template: { | ||
metadata: { labels: appLabels }, | ||
spec: { | ||
containers: [ | ||
{ | ||
name: "nginx", | ||
image: "nginx:fake", // Should trigger a failure on await. | ||
ports: [{ containerPort: 80 }], | ||
}, | ||
], | ||
schedulerName: "default-scheduler", | ||
}, | ||
}, | ||
}, | ||
}); |
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