-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate off deprecated trait profile/status attributes #13
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,12 +41,12 @@ func newUserResource(ctx context.Context, user *fastly.User) (*v2.Resource, erro | |
| } | ||
|
|
||
| userTraits := []rs.UserTraitOption{ | ||
| rs.WithUserProfile(profile), | ||
| rs.WithStatus(userStatus), | ||
| rs.WithUserLogin(user.Login), | ||
| } | ||
|
|
||
| resource, err := rs.NewUserResource(user.Name, userResourceType, user.ID, userTraits) | ||
| resource, err := rs.NewUserResource(user.Name, userResourceType, user.ID, userTraits, | ||
| rs.WithResourceProfile(profile), | ||
| rs.WithResourceStatus(v2.Status_ResourceStatus(userStatus), "")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: |
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
🟡 Suggestion: now that the profile option moved out, this empty slice literal only exists to fill the
roleTraitOptsparameter. Passingnildirectly (rs.NewRoleResource(role, roleResourceType, role, nil, rs.WithResourceProfile(profile))) is equivalent —WithRoleTrait()with no options still creates the role trait — and drops the variable entirely.