-
Notifications
You must be signed in to change notification settings - Fork 185
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
chore: Adds support for plan modifier on replication_specs changed #3083
Open
EspenAlbert
wants to merge
45
commits into
master
Choose a base branch
from
CLOUDP-300282_plan_minimize_replication_specs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
chore: Adds support for plan modifier on replication_specs changed #3083
EspenAlbert
wants to merge
45
commits into
master
from
CLOUDP-300282_plan_minimize_replication_specs
+1,009
−106
Conversation
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
…ould be kept unknown
…es that are unknown
…keepUnknown logic for changed replication specs
13 tasks
…management and error diagnostics
… unused clusterUseISS function
… sending `UseStateForUnknown` values
…urce and destination TFModels
…e changes and clean up unused functions
…r better list change detection
…mproved change detection
…ify related logic by using AttributeChanges
EspenAlbert
commented
Feb 20, 2025
@@ -95,8 +95,8 @@ func newReplicationSpec20240805(ctx context.Context, input types.List, diags *di | |||
for i := range elements { | |||
item := &elements[i] | |||
resp[i] = admin.ReplicationSpec20240805{ | |||
Id: conversion.NilForUnknown(item.ExternalId, item.ExternalId.ValueStringPointer()), | |||
ZoneId: conversion.NilForUnknown(item.ZoneId, item.ZoneId.ValueStringPointer()), | |||
Id: conversion.NilForUnknownOrEmptyString(item.ExternalId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't make sense to send an empty string for the id
EspenAlbert
commented
Feb 20, 2025
EspenAlbert
commented
Feb 20, 2025
|
||
// FindAttributeChanges: Iterates through TFModel of state+plan and returns AttributeChanges for querying changed attributes | ||
// The implementation is similar to KeepUnknown, no support for types.Set or types.Tuple yet | ||
func FindAttributeChanges(ctx context.Context, src, dest any) AttributeChanges { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why another reflect function?
- Use the same names as TF and therefore simplify call to CopyUnknowns.
- Could re-use the major parts of KeepUnknown
- Could have tried to modify
PatchPayload
to send back attributes changed, but it wasn't a good fit. PatchPayload does 2 things:- (1) Checking for changes on an attribute and for changed attributes
- (2) Copies values from state
- (3) Require Structs with
json
annotations to work
- Had an attempt at using the path package, but I was unsuccessful.
lantoli
reviewed
Feb 21, 2025
lantoli
reviewed
Feb 21, 2025
lantoli
reviewed
Feb 21, 2025
lantoli
reviewed
Feb 21, 2025
lantoli
reviewed
Feb 21, 2025
lantoli
reviewed
Feb 21, 2025
lantoli
approved these changes
Feb 21, 2025
…upgrade (goes from "" --> x.x)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds support for plan modifier on replication_specs changed
Link to any related issue(s): CLOUDP-300282
Full Runs in TPF:
Type of change:
Required Checklist:
Further comments