-
Notifications
You must be signed in to change notification settings - Fork 67
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
resource id should be readonly. space name on datasource should be optional #770
Conversation
@@ -130,7 +130,6 @@ func GetIdResourceSchema() resourceSchema.Attribute { | |||
return resourceSchema.StringAttribute{ | |||
Description: "The unique ID for this resource.", | |||
Computed: true, | |||
Optional: true, |
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.
This means that the user cannot set the Id and will get an error
"description": GetReadonlyDescriptionDatasourceSchema(spaceDescription), | ||
"name": datasourceSchema.StringAttribute{ | ||
Description: fmt.Sprintf("The name of this resource, no more than %d characters long", 20), | ||
Validators: []validator.String{ | ||
stringvalidator.LengthBetween(1, 20), | ||
}, | ||
Computed: true, | ||
Optional: true, |
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.
Looks like this was broken from #759
Description: "The ID of this resource.", | ||
Computed: true, | ||
}, | ||
SchemaAttributeNames.ID: GetIdResourceSchema(), |
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.
Use the helper function for consistency
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.
Good catch 🪝
setup:
on
0.22.1
Lifecycle resource was created with id of
Lifecycles-1762
. From state:Plan with
0.30.0-beta8
Plan now fails validation as Id is readonly: