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

Defered in pools #36

Closed
wants to merge 6 commits into from
Closed

Defered in pools #36

wants to merge 6 commits into from

Conversation

tim-x-y-z
Copy link

attempt at adding #35

@tim-x-y-z
Copy link
Author

hey @DrFaust92 what do you think of adding this toggle to the pools ? :)

Copy link
Owner

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

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

See comments, plus missing documentation.

if err != nil {
return diag.Errorf("failed to create pool `%s` from Airflow: %s", name, err)
}
d.SetId(name)

// Manually manage include_deferred in Terraform state
d.Set("include_deferred", includeDeferred)
Copy link
Owner

Choose a reason for hiding this comment

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

Why? Should be set on read

@@ -89,6 +98,10 @@ func resourcePoolRead(ctx context.Context, d *schema.ResourceData, m interface{}
d.Set("open_slots", pool.OpenSlots)
d.Set("used_slots", pool.UsedSlots)

// Manually manage include_deferred in Terraform state
includeDeferred := d.Get("include_deferred").(bool)
Copy link
Owner

Choose a reason for hiding this comment

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

Extraneous, let's align with other set examples on that are above this do d.Get(...) inline in the set call

if err != nil {
return diag.Errorf("failed to update pool `%s` from Airflow: %s", name, err)
}

// Manually manage include_deferred in Terraform state
d.Set("include_deferred", includeDeferred)
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above in create func

@@ -19,11 +19,12 @@ func TestAccAirflowPool_basic(t *testing.T) {
CheckDestroy: testAccCheckAirflowPoolCheckDestroy,
Steps: []resource.TestStep{
{
Config: testAccAirflowPoolConfigBasic(rName, 2),
Config: testAccAirflowPoolConfigBasic(rName, 2, true),
Copy link
Owner

Choose a reason for hiding this comment

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

Let's not change the existing test and add a new one

@DrFaust92
Copy link
Owner

Ok, I see the problem. This won't work (yet) as the provider is using an older version of the go sdk (2.5.0) and needs 2.7.0 to support this parameter. So we cannot merge this yet, and as far as I recall the go sdk hasn't been built yet for 2.7.0 and requires action upstream.

address the comments for now and I'll take a look at updating the sdk version.

I'm currently on vacation so this won't happen until at least 2 weeks from now. I'll try to get to this asap

@tim-x-y-z tim-x-y-z closed this by deleting the head repository Nov 27, 2023
@kmehkeri
Copy link

Any chance to have this? I would be happy to contribute if needed, just having the baseline would be helpful, is it possible to restore @tim-habitat?

@tim-x-y-z
Copy link
Author

hey @kmehkeri sure, here i reinstated it and rebased off the curreent latest master of this repo.

@kmehkeri
Copy link

Uh... I went into this and only now realized what exactly DrFaust's earlier comment was about (dependency on PRs in Go Airflow client and Airflow itself). So indeed this needs to wait :/

@brokenjacobs
Copy link

Any updates @DrFaust92 ? I tried implementing this and ran into the same issue with the upstream airflow-go sdk... Since it's just generated from the openAPI spec seems we could just make another project for it if they won't maintain it...

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.

4 participants