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

fix: additional_disk space and service_integrations fields import (#1820) #1846

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

rriski
Copy link
Contributor

@rriski rriski commented Sep 17, 2024

About this change—what it does

Fix #1820. Previously, we didn't handle additional_disk_space and service_integrations properly during terraform import. This changeset also fixes importing tech_emails field of services.

@rriski rriski changed the title Rriski fix service tf import fix: additional_disk space and service_integrations fields import (#1820) Sep 17, 2024
} else {
if err := d.Set("disk_space", HumanReadableByteSize(diskSpace*units.MiB)); err != nil {
return err
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

if a := diskSpace - servicePlanParams.DiskSizeMBDefault; a > 0 {
    ...
} else if diskSpace > 0 {
    ...
}

}
return &results
Copy link
Contributor

@byashimov byashimov Sep 17, 2024

Choose a reason for hiding this comment

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

nit:

var emails []aiven.ContactEmail
err = Remarshal(valuesInterface.(*schema.Set).List(), &emails)

readReplicaIntegrations = append(readReplicaIntegrations, integrationMap)
}
}
return readReplicaIntegrations, nil
Copy link
Contributor

@byashimov byashimov Sep 17, 2024

Choose a reason for hiding this comment

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

nit: This will swallow an unexpected integration type. I would set an enum validation for the integration_type field, and then the "if" can be removed.

@rriski rriski force-pushed the rriski-fix-service-tf-import branch 3 times, most recently from 97948e1 to 4b64d51 Compare September 18, 2024 14:48
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.

Missing Attributes from Import of avien_pg Resource
2 participants