-
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
feat: Add ability to disable tenants #820
Conversation
@@ -132,8 +144,13 @@ func (t TenantSchema) GetResourceSchema() resourceSchema.Schema { | |||
}, | |||
"description": GetDescriptionResourceSchema("tenant"), | |||
"id": GetIdResourceSchema(), | |||
"name": GetNameResourceSchema(true), | |||
"space_id": GetSpaceIdResourceSchema("tenant"), | |||
"is_disabled": resourceSchema.BoolAttribute{ |
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.
Looking at the project resource schema the is_disabled schema has a boolplanmodifier.UseStateForUnknown()
I think we need it here
UseStateForUnknown(): Copies a known prior state value into the planned value. Use this when it is known that an unconfigured value will remain the same after a resource update.
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.
Can we update either the resource_tenant_migration_test.go
or resource_tenant_test.go
tests to update is_disabled and assert that is_disabled gets set. To run these locally you'll need to set some environment for testing_container_test.go
or set the createSharedContainer flag to true. (Make sure your looking in the framework folder).
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.
LGTM
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.
Nice, looks good!
Thanks for taking on this feature! 😄
Updates
octopusdeploy_tenant (Resource)
andoctopusdeploy_tenants (Data Source)
to includeis_disabled
.#project-disabling-tenants
[sc-96619]