Skip to content

Commit

Permalink
Change await logic client to use target apiVersion on update (#1758)
Browse files Browse the repository at this point in the history
Previously, the await logic used the previous apiVersion of a
resource to issue requests to the API server. In the case of
API changes, this could cause errors. Newer apiVersions should
be backward compatible, so switch to using the target apiVersion
of a resource instead.
  • Loading branch information
lblackstone committed Oct 6, 2021
1 parent 5f43eaf commit 399f62f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [sdk/dotnet] Fix creation of CustomResources (https://github.com/pulumi/pulumi-kubernetes/pull/1741)
- Always override namespace for helm release operations (https://github.com/pulumi/pulumi-kubernetes/pull/1747)
- Add k8s client tuning settings to Provider (https://github.com/pulumi/pulumi-kubernetes/pull/1748)
- Change await logic client to use target apiVersion on updates (https://github.com/pulumi/pulumi-kubernetes/pull/1758)

## 3.7.3 (September 30, 2021)
- Use helm release's namespace on templates where namespace is left unspecified (https://github.com/pulumi/pulumi-kubernetes/pull/1733)
Expand Down
5 changes: 3 additions & 2 deletions provider/pkg/await/await.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2018, Pulumi Corporation.
// Copyright 2016-2021, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@ package await
import (
"context"
"fmt"

"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/clients"
"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/cluster"
"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/kinds"
Expand Down Expand Up @@ -353,7 +354,7 @@ func Update(c UpdateConfig) (*unstructured.Unstructured, error) {
// - [ ] Support server-side apply, when it comes out.
//

client, err := c.ClientSet.ResourceClient(c.Previous.GroupVersionKind(), c.Previous.GetNamespace())
client, err := c.ClientSet.ResourceClient(c.Inputs.GroupVersionKind(), c.Inputs.GetNamespace())
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 399f62f

Please sign in to comment.