Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on refresh for an unreachable cluster. #1522

Merged
merged 2 commits into from Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,6 +1,7 @@
## HEAD (Unreleased)

- Fix refresh for render-yaml resources (https://github.com/pulumi/pulumi-kubernetes/pull/1523)
- Behavior change: Error on refresh for an unreachable cluster. (https://github.com/pulumi/pulumi-kubernetes/pull/1522)

## 2.9.0 (April 8, 2021)

Expand Down
5 changes: 3 additions & 2 deletions provider/pkg/provider/provider.go
Expand Up @@ -1594,11 +1594,12 @@ func (k *kubeProvider) Read(ctx context.Context, req *pulumirpc.ReadRequest) (*p
label := fmt.Sprintf("%s.Read(%s)", k.label(), urn)
logger.V(9).Infof("%s executing", label)

// If the cluster is unreachable, consider the resource deleted and inform the user.
// If the cluster is unreachable, return an error.
if k.clusterUnreachable {
_ = k.host.Log(ctx, diag.Warning, urn, fmt.Sprintf(
"configured Kubernetes cluster is unreachable: %s", k.clusterUnreachableReason))
return deleteResponse, nil
return nil, fmt.Errorf("failed to read resource state due to unreachable cluster. " +
"If the cluster has been deleted, you can edit the pulumi state to remove this resource")
}

// Obtain new properties, create a Kubernetes `unstructured.Unstructured` that we can pass to the
Expand Down