Skip to content
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

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

grace-rehn
Copy link
Collaborator

@grace-rehn grace-rehn commented Nov 20, 2024

Updates octopusdeploy_tenant (Resource) and octopusdeploy_tenants (Data Source) to include is_disabled.

#project-disabling-tenants

[sc-96619]

@@ -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{
Copy link
Collaborator

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.

Copy link
Collaborator

@IsaacCalligeros95 IsaacCalligeros95 left a 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).

Copy link
Collaborator

@IsaacCalligeros95 IsaacCalligeros95 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@domenicsim1 domenicsim1 left a 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! 😄

@grace-rehn grace-rehn merged commit c9bab2c into main Nov 22, 2024
22 checks passed
@grace-rehn grace-rehn deleted the grace/add-ability-to-disable-tenants branch November 22, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants