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

Add clusterIdentifier configuration to control provider lifecycle #3068

Merged
merged 7 commits into from
Jul 18, 2024

Conversation

blampe
Copy link
Contributor

@blampe blampe commented Jun 24, 2024

This adds a new clusterIdentifier provider configuration to control replacement behavior.

If this config has been previously set, then we will only replace the provider when clusterIdentifier changes. Additionally, changes to other properties like kubeconfig which currently trigger replacements will now only be updates.

An E2E test is included along with unit tests. The units use txtar to more conveniently express before/after state in YAML -- a sort of middle ground between massive table tests and full-blown integration tests.

Fixes #2745.

Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 61.11111% with 14 lines in your changes missing coverage. Please review.

Project coverage is 36.57%. Comparing base (0de3859) to head (cd5a630).

Files Patch % Lines
provider/pkg/gen/schema.go 0.00% 8 Missing ⚠️
provider/pkg/provider/provider.go 78.57% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3068      +/-   ##
==========================================
- Coverage   36.58%   36.57%   -0.02%     
==========================================
  Files          71       71              
  Lines        9263     9275      +12     
==========================================
+ Hits         3389     3392       +3     
- Misses       5535     5543       +8     
- Partials      339      340       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blampe blampe requested review from EronWright and rquitales June 24, 2024 22:45
Copy link
Contributor

@EronWright EronWright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, have 2 points:

  1. there's already some tests for DiffConfig in provider_diffconfig_test.go; can we add a section to outline the behavior of the clusteridentifer?
  2. The term clusterIdentifier seems a bit long and imprecise, I would advocate for clusterKey.

@blampe blampe requested a review from EronWright July 16, 2024 18:41
Copy link
Contributor

@EronWright EronWright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we should do some manual testing for good measure.

@blampe blampe merged commit 7695266 into master Jul 18, 2024
19 checks passed
@blampe blampe deleted the blampe/2745-clusterid branch July 18, 2024 22:44
@mjeffryes mjeffryes added this to the 0.107 milestone Jul 24, 2024
blampe added a commit that referenced this pull request Aug 7, 2024
### Added

- `clusterIdentifier` configuration can now be used to manually control
the replacement behavior of a provider resource.
(#3068)

- Pod errors now include the pod's last termination state, as well as
the pod's termination message if available.
(#3091)

The pod's termination message can be helpful in `CrashLoopBackOff`
situations but will only be reported if it was correctly configured.

By default, the pod's termination message is read from
`/dev/termination-log`. This location can be configured with
`terminationMessagePath`.

Use `terminationMessagePolicy: FallbackToLogsOnError` to use the pod's
logs as its termination message.

- Documentation is now generated for all languages supported by overlay
types. (#3107)

### Fixed

- Updated logic to accurately detect if a resource is a Patch variant.
(#3102)
- Added Java as a supported language for `CustomResource` overlays.
(#3120)
- Status messages reported during updates are now more accurately scoped
to the
affected resource.
(#3128)
- `PersistentVolumeClaims` with a bind mode of `WaitForFirstConsumer`
will no
longer hang indefinitely.
(#3130)
- [java] Fixed an issue where child resources could not be registered by
Chart v4. (#3119)
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Aug 8, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@pulumi/kubernetes](https://pulumi.com)
([source](https://togithub.com/pulumi/pulumi-kubernetes)) | dependencies
| minor | [`4.15.0` ->
`4.16.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.15.0/4.16.0)
|

---

### Release Notes

<details>
<summary>pulumi/pulumi-kubernetes (@&#8203;pulumi/kubernetes)</summary>

###
[`v4.16.0`](https://togithub.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#4160-August-7-2024)

[Compare
Source](https://togithub.com/pulumi/pulumi-kubernetes/compare/v4.15.0...v4.16.0)

##### Added

- `clusterIdentifier` configuration can now be used to manually control
the
replacement behavior of a provider
resourc[https://github.com/pulumi/pulumi-kubernetes/pull/3068](https://togithub.com/pulumi/pulumi-kubernetes/pull/3068)ull/3068)

- Pod errors now include the pod's last termination state, as well as
the pod's
termination message if
availabl[https://github.com/pulumi/pulumi-kubernetes/pull/3091](https://togithub.com/pulumi/pulumi-kubernetes/pull/3091)ull/3091)

The pod's termination message can be helpful in `CrashLoopBackOff`
situations but
    will only be reported if it was correctly configured.

    By default, the pod's termination message is read from
    `/dev/termination-log`. This location can be configured with
    `terminationMessagePath`.

Use `terminationMessagePolicy: FallbackToLogsOnError` to use the pod's
logs
    as its termination message.

- Documentation is now generated for all languages supported by overlay
types.

[https://github.com/pulumi/pulumi-kubernetes/pull/3107](https://togithub.com/pulumi/pulumi-kubernetes/pull/3107)3107)

##### Fixed

- Updated logic to accurately detect if a resource is a Patch variant.
([https://github.com/pulumi/pulumi-kubernetes/pull/3102](https://togithub.com/pulumi/pulumi-kubernetes/pull/3102))
- Added Java as a supported language for `CustomResource` overlays.
([https://github.com/pulumi/pulumi-kubernetes/pull/3120](https://togithub.com/pulumi/pulumi-kubernetes/pull/3120))
- Status messages reported during updates are now more accurately scoped
to the
affected
resourc[https://github.com/pulumi/pulumi-kubernetes/pull/3128](https://togithub.com/pulumi/pulumi-kubernetes/pull/3128)3128)
- `PersistentVolumeClaims` with a bind mode of `WaitForFirstConsumer`
will no
longer hang
indefinitel[https://github.com/pulumi/pulumi-kubernetes/pull/3130](https://togithub.com/pulumi/pulumi-kubernetes/pull/3130)3130)
- \[java] Fixed an issue where child resources could not be registered
by Chart v4.
[https://github.com/pulumi/pulumi-kubernetes/pull/3119](https://togithub.com/pulumi/pulumi-kubernetes/pull/3119)9)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMS4zIiwidXBkYXRlZEluVmVyIjoiMzguMjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternative way of detecting cluster changes instead of kubeconfig
4 participants