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

Feature: Commitments support for Azure's reservations #302

Merged

Conversation

maxtwardowski
Copy link
Member

No description provided.

@maxtwardowski maxtwardowski self-assigned this Apr 25, 2024
@maxtwardowski maxtwardowski requested a review from a team as a code owner April 25, 2024 16:55
@ivanstankovcast ivanstankovcast self-requested a review April 26, 2024 11:52
* working assignments

* add example

* adjust tests

* more test adjustments

* add config nil check

* priority computed field

* regenerate docs

* fix replacing assignments

* working acceptance tests with assignments for gke

* add assignment checks

* azure assignments acc tests

* rearrange acc tests

* use common fields for cast ai commitment fields

* flatten the structure, get rid of the separate commitments package

* renames

* renames

* imports fix

* renames

* dont export field names

---------

Co-authored-by: Max Twardowski <[email protected]>
@maxtwardowski maxtwardowski merged commit 2649d00 into max/PRICE-32/commitments May 7, 2024
4 checks passed
@maxtwardowski maxtwardowski deleted the max/PRICE-175/azure-commitments branch May 7, 2024 10:49
maxtwardowski added a commit that referenced this pull request May 8, 2024
* generate sdk for commitments api

* boilerplate

* more helper methods adjustments

* get rid of organization id field, implement mapCUDsJSONToCommitmentResources

* backup

* get rid of errors

* generatable diff for gcp cuds

* renames

* making fields more consistent

* move fields to the commitments package

* fix info logging in reservations resource

* working destroying

* sort cuds when populating the state

* get rid of azure stuff, will bring back later

* make the sorting fn a generic

* add schema fields descriptions

* configs

* separate functions for manipulating the state

* config mappings

* wip updating

* more

* fix deleting

* TestMapCommitmentToCUDResource

* TestMapCUDImportToResource

* TestMapConfigsToCUDs

* TestSortResources

* TestMapCUDImportWithConfigToUpdateRequest

* more TestSortResources cases for azure

* TestMapConfiguredCUDImportsToResources

* config schema descriptions

* oneofs and diff impl fixes

* working first two steps of tests

* fix tests

* properly support url-based regions

* add SchemaConfigModeAttr to cud configs

* add status config validation

* fix imports

* more acc tests

* comments cleanup

* more

* CheckDestroy

* imports order

* tweaks

* imports

* imports order

* use golang.org/x/exp/slices instead of stdlib

* fix ineff assignment

* regenerate sdk

* regenerate docs

* regenerate docs with 0.14.1 version of the tfdocsplugin

* add commitment examples

* fix

* use default org id

* regenerate docs

* getCommitmentsImportID util fn

* unnest matcher fields to enforce types

* regen docs

* format tf

* regenerate sdk

* enhance MapConfigsToCUDs impl

* regenerate docs

* get rid of attr schema config

* rename acc tests

* flatten the structure, get rid of the separate commitments package

* regenerate docs

* renames

* dont export mapping functions

* dont export field names

* Feature: Commitments support for Azure's reservations (#302)

* types preparation

* more mapping impls for azure

* working import + update

* fix getReservationResources

* add term mapping to MapReservationImportToResource to mimic API's behavior

* fix tests

* TestMapCommitmentToReservationResource

* rename

* mapping functions tests

* working first step of acc test

* CheckDestroy

* working state import step

* working azure acceptance tests

* get rid of the dummy test

* add usage examples

* fix populateCommitmentsResourceData

* full acc tests

* get rid of productname from the matcher

* flatten matcher

* regenerate docs

* format tf

* regenerate docs

* add descriptions

* MapConfigsToCommitments impl

* regenerate docs

* newline

* return err from MapReservationImportToResource

* get rid of attr schema config

* use common fields for cast ai commitment fields

* flatten the structure, get rid of the separate commitments package

* regenerate sdk

* renames

* renames

* dont export mapping functions

* dont export field names

* Feature: Commitment assignments support (#304)

* working assignments

* add example

* adjust tests

* more test adjustments

* add config nil check

* priority computed field

* regenerate docs

* fix replacing assignments

* working acceptance tests with assignments for gke

* add assignment checks

* azure assignments acc tests

* rearrange acc tests

* use common fields for cast ai commitment fields

* flatten the structure, get rid of the separate commitments package

* renames

* renames

* imports fix

* renames

* dont export field names

---------

Co-authored-by: Max Twardowski <[email protected]>

---------

Co-authored-by: Max Twardowski <[email protected]>

* fix reservations tests

* unexport iface method

* export CASTCommitmentFields

* use schema.ImportStatePassthroughContext

* cleanup

* try using custom commitmentsStateImporter

* revert config mode change

* dont pass tenant_id to azuread provider

* fix floats

---------

Co-authored-by: Max Twardowski <[email protected]>
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.

2 participants