Skip to content

Commit

Permalink
Revert "Enable Server-Side Apply mode by default (#2206)"
Browse files Browse the repository at this point in the history
This reverts commit 5960e58.

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
lblackstone committed Oct 27, 2022
1 parent 090de2b commit 90ba85f
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 25 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Unreleased

## 3.22.1 (October 26, 2022)

Note: Enabling SSA mode by default was causing problems for a number of users, so we decided to revert this change.
We plan to re-enable this as the default behavior in the next major (`v4.0.0`) release with additional documentation
about the expected differences.

- Revert: Enable Server-Side Apply mode by default (https://github.com/pulumi/pulumi-kubernetes/pull/2216)

## 3.22.0 (October 21, 2022)

Important Note -- This release changes the Provider default to enable Server-Side Apply mode. This change is
Expand Down
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-kubernetes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
},
"enableServerSideApply": {
"type": "boolean",
"description": "If present and set to false, disable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details."
"description": "BETA FEATURE - If present and set to true, enable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.\nThis feature is in developer preview, and is disabled by default."
},
"kubeconfig": {
"type": "string",
Expand Down Expand Up @@ -57864,7 +57864,7 @@
},
"enableServerSideApply": {
"type": "boolean",
"description": "If present and set to false, disable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.",
"description": "BETA FEATURE - If present and set to true, enable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.\nThis feature is in developer preview, and is disabled by default.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_ENABLE_SERVER_SIDE_APPLY"
Expand Down
4 changes: 2 additions & 2 deletions provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
DeprecationMessage: "This option has been replaced by `enableServerSideApply`.",
},
"enableServerSideApply": {
Description: "If present and set to false, disable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.",
Description: "BETA FEATURE - If present and set to true, enable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.\nThis feature is in developer preview, and is disabled by default.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"enableReplaceCRD": {
Expand Down Expand Up @@ -157,7 +157,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
"PULUMI_K8S_ENABLE_SERVER_SIDE_APPLY",
},
},
Description: "If present and set to false, disable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.",
Description: "BETA FEATURE - If present and set to true, enable Server-Side Apply mode.\nSee https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.\nThis feature is in developer preview, and is disabled by default.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"enableReplaceCRD": {
Expand Down
10 changes: 4 additions & 6 deletions provider/pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ func (k *kubeProvider) Configure(_ context.Context, req *pulumirpc.ConfigureRequ
CurrentContext: vars["kubernetes:config:context"],
}

// TODO: Simplify / factor out the provider flag parsing. Currently lots of error-prone copy-paste code here.

deleteUnreachable := func() bool {
// If the provider flag is set, use that value to determine behavior. This will override the ENV var.
if enabled, exists := vars["kubernetes:config:deleteUnreachable"]; exists {
Expand Down Expand Up @@ -444,7 +442,8 @@ func (k *kubeProvider) Configure(_ context.Context, req *pulumirpc.ConfigureRequ
if enabled, exists := os.LookupEnv("PULUMI_K8S_ENABLE_SERVER_SIDE_APPLY"); exists {
return enabled == trueStr
}
return true
// Default to false.
return false
}
if enableServerSideApply() {
k.enableDryRun = true
Expand Down Expand Up @@ -2756,11 +2755,10 @@ func (k *kubeProvider) tryServerSidePatch(
return nil, nil, false, err
}
if se, isStatusError := err.(*errors.StatusError); isStatusError {
// If the resource field is immutable.
if se.Status().Code == http.StatusUnprocessableEntity ||
strings.Contains(se.ErrStatus.Message, "field is immutable") {
// This error occurs if the resource field is immutable.
// Ignore this error since this case is handled by the replacement logic.
return nil, nil, false, nil
return nil, nil, false, err
}
}
if err.Error() == "name is required" {
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public void Set(T value)

private static readonly __Value<bool?> _enableServerSideApply = new __Value<bool?>(() => __config.GetBoolean("enableServerSideApply"));
/// <summary>
/// If present and set to false, disable Server-Side Apply mode.
/// BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
/// See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
/// This feature is in developer preview, and is disabled by default.
/// </summary>
public static bool? EnableServerSideApply
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ public sealed class ProviderArgs : global::Pulumi.ResourceArgs
public Input<bool>? EnableReplaceCRD { get; set; }

/// <summary>
/// If present and set to false, disable Server-Side Apply mode.
/// BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
/// See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
/// This feature is in developer preview, and is disabled by default.
/// </summary>
[Input("enableServerSideApply", json: true)]
public Input<bool>? EnableServerSideApply { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion sdk/go/kubernetes/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions sdk/go/kubernetes/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion sdk/java/src/main/java/com/pulumi/kubernetes/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public Optional<Boolean> enableReplaceCRD() {
return Codegen.booleanProp("enableReplaceCRD").config(config).get();
}
/**
* If present and set to false, disable Server-Side Apply mode.
* BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*
*/
public Optional<Boolean> enableServerSideApply() {
Expand Down
12 changes: 8 additions & 4 deletions sdk/java/src/main/java/com/pulumi/kubernetes/ProviderArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,18 @@ public Optional<Output<Boolean>> enableReplaceCRD() {
}

/**
* If present and set to false, disable Server-Side Apply mode.
* BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*
*/
@Import(name="enableServerSideApply", json=true)
private @Nullable Output<Boolean> enableServerSideApply;

/**
* @return If present and set to false, disable Server-Side Apply mode.
* @return BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*
*/
public Optional<Output<Boolean>> enableServerSideApply() {
Expand Down Expand Up @@ -471,8 +473,9 @@ public Builder enableReplaceCRD(Boolean enableReplaceCRD) {
}

/**
* @param enableServerSideApply If present and set to false, disable Server-Side Apply mode.
* @param enableServerSideApply BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*
* @return builder
*
Expand All @@ -483,8 +486,9 @@ public Builder enableServerSideApply(@Nullable Output<Boolean> enableServerSideA
}

/**
* @param enableServerSideApply If present and set to false, disable Server-Side Apply mode.
* @param enableServerSideApply BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*
* @return builder
*
Expand Down
3 changes: 2 additions & 1 deletion sdk/nodejs/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ export interface ProviderArgs {
*/
enableReplaceCRD?: pulumi.Input<boolean>;
/**
* If present and set to false, disable Server-Side Apply mode.
* BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
* See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
* This feature is in developer preview, and is disabled by default.
*/
enableServerSideApply?: pulumi.Input<boolean>;
/**
Expand Down
9 changes: 6 additions & 3 deletions sdk/python/pulumi_kubernetes/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def __init__(__self__, *,
2. The `PULUMI_K8S_ENABLE_CONFIGMAP_MUTABLE` environment variable.
:param pulumi.Input[bool] enable_dry_run: Deprecated. If present and set to true, enable server-side diff calculations.
:param pulumi.Input[bool] enable_replace_crd: Obsolete. This option has no effect.
:param pulumi.Input[bool] enable_server_side_apply: If present and set to false, disable Server-Side Apply mode.
:param pulumi.Input[bool] enable_server_side_apply: BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
This feature is in developer preview, and is disabled by default.
:param pulumi.Input['HelmReleaseSettingsArgs'] helm_release_settings: Options to configure the Helm Release resource.
:param pulumi.Input['KubeClientSettingsArgs'] kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
:param pulumi.Input[str] kubeconfig: The contents of a kubeconfig file or the path to a kubeconfig file.
Expand Down Expand Up @@ -194,8 +195,9 @@ def enable_replace_crd(self, value: Optional[pulumi.Input[bool]]):
@pulumi.getter(name="enableServerSideApply")
def enable_server_side_apply(self) -> Optional[pulumi.Input[bool]]:
"""
If present and set to false, disable Server-Side Apply mode.
BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
This feature is in developer preview, and is disabled by default.
"""
return pulumi.get(self, "enable_server_side_apply")

Expand Down Expand Up @@ -336,8 +338,9 @@ def __init__(__self__,
2. The `PULUMI_K8S_ENABLE_CONFIGMAP_MUTABLE` environment variable.
:param pulumi.Input[bool] enable_dry_run: Deprecated. If present and set to true, enable server-side diff calculations.
:param pulumi.Input[bool] enable_replace_crd: Obsolete. This option has no effect.
:param pulumi.Input[bool] enable_server_side_apply: If present and set to false, disable Server-Side Apply mode.
:param pulumi.Input[bool] enable_server_side_apply: BETA FEATURE - If present and set to true, enable Server-Side Apply mode.
See https://github.com/pulumi/pulumi-kubernetes/issues/2011 for additional details.
This feature is in developer preview, and is disabled by default.
:param pulumi.Input[pulumi.InputType['HelmReleaseSettingsArgs']] helm_release_settings: Options to configure the Helm Release resource.
:param pulumi.Input[pulumi.InputType['KubeClientSettingsArgs']] kube_client_settings: Options for tuning the Kubernetes client used by a Provider.
:param pulumi.Input[str] kubeconfig: The contents of a kubeconfig file or the path to a kubeconfig file.
Expand Down
2 changes: 1 addition & 1 deletion tests/sdk/python/smoke-test-old/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
]
})

pulumi.export("ip", pod.status.apply(lambda s: s.pod_ip))
pulumi.export("ip", pod.status["pod_ip"])

0 comments on commit 90ba85f

Please sign in to comment.