Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: avoid sending template metadata update ifmax_port_share_level is default#190

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/fix-default-port-level-error
Feb 26, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedFeb 25, 2025
edited
Loading

Closes#188.

For context, theMaxPortShareLevel template metadata value was not present on thecoderd create template request prior to 2.15. As such, during template creation we need to send an update request for backwards compatibility (though we could probably remove this soon), see#110.

Whilst we don't send this update request is the attribute is omitted on the resource, we were sending a spurious update request if the value was explicitly configured to the default value ('owner' for enterprise+, 'public' otherwise). This was causing the error in the linked issue. An example is seen in the newly added test.

The fix is to just not send that update request if the configured value is:

  • Unknown
  • Equal to the value on the newly created template.

note: I'd recommend hiding the whitespace when reviewing the diff

@ethanndicksonGraphite App
Copy link
MemberAuthor

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ethanndicksonethanndickson marked this pull request as ready for reviewFebruary 25, 2025 03:02
@@ -573,6 +573,8 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
// deployment running `v2.15.0` or later.
if data.MaxPortShareLevel.IsUnknown() {
data.MaxPortShareLevel = types.StringValue(string(templateResp.MaxPortShareLevel))
} else if data.MaxPortShareLevel.ValueString() == string(templateResp.MaxPortShareLevel) {
tflog.Info(ctx, "max port share level set to default, not updating")
Copy link
Member

Choose a reason for hiding this comment

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

not necessarily the default, just the current value

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

this only runs onCreate, so the current value is always the default

@ethanndicksonethanndickson merged commit1d19415 intomainFeb 26, 2025
14 checks passed
@ethanndicksonethanndickson deleted the ethan/fix-default-port-level-error branchFebruary 26, 2025 01:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Resourcecoderd_template setting port share level issues
2 participants
@ethanndickson@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp