terraform-provider-openstack icon indicating copy to clipboard operation
terraform-provider-openstack copied to clipboard

L7Policy: Action REDIRECT_PREFIX

Open TheEvilCoder42 opened this issue 2 years ago • 9 comments

Terraform Version

Terraform v1.1.3

Affected Resource(s)

openstack_lb_l7policy_v2

Terraform Configuration Files

resource "openstack_lb_l7policy_v2" "l7policy_1" {
  name         = "test"
  action       = "REDIRECT_PREFIX"
  description  = "test l7 policy"
  position     = 1
  listener_id  = openstack_lb_listener_v2.listener_1.id
  redirect_url = "https://foo.bar"
}

Output

╷
│ Error: expected action to be one of [REDIRECT_TO_POOL REDIRECT_TO_URL REJECT], got REDIRECT_PREFIX
│
│   with openstack_lb_l7policy_v2.l7policy_1,
│   on main.tf line 58, in resource "openstack_lb_l7policy_v2" "l7policy_1":
│   58:   action       = "REDIRECT_PREFIX"
│
╵

Expected Behavior

L7Policy should get created. Action REDIRECT_PREFIX should be supported.

Actual Behavior

An error gets thrown, because REDIRECT_PREFIX action is not implemented.

Steps to Reproduce

terraform apply

References

https://github.com/gophercloud/gophercloud/issues/2322 https://docs.openstack.org/api-ref/load-balancer/v2/?expanded=create-an-l7-policy-detail#create-an-l7-policy

TheEvilCoder42 avatar Jan 17 '22 19:01 TheEvilCoder42

Please implement this now that https://github.com/gophercloud/gophercloud/pull/2324 has enabled it downstream

perbergland avatar Mar 28 '22 20:03 perbergland

Is there an ETA when this will be implemented?

shumbashi avatar Jan 13 '23 20:01 shumbashi

This repo is not maintained so don't expect anything. Openstack is just tumbleweed for devops

perbergland avatar Jan 13 '23 20:01 perbergland

@nikParasyr Sorry to bother you, but would it be possible to implement this ? Thanks!

TheEvilCoder42 avatar Aug 03 '23 15:08 TheEvilCoder42

@nikParasyr i was trying to see how this goes but for some reason the l7policies don't module i see don't have the fix you have

even tho go.mod shows 1.5.1-.... and this was in 1.5.0 -- am i missing something silly?

mnaser avatar Aug 04 '23 16:08 mnaser

@mnaser loadbalancer resources support both lbaas and octavia. The gophercloud libraries used by default are for lbaas. This is why you dont see it available. And also this is why small "small additions" as this one are more complicated. An example PR on how to overcome this is this one.

Let me know if you need more help

( I was actually hoping to get some time to work on lb -- either deprecating lbaas or refactoring the code so that additions for octavia are easier. We have a lot of improvements/additions on octavia that are stalled due to the situation explained above, but i havent been able to allocate time to tackle it :/ and also not sure if ill be able to in the near future )

nikParasyr avatar Aug 05 '23 07:08 nikParasyr

@nikParasyr lbaas started to be deprecated in 2018 and fully removed in 2020...

I think if the maintainers don't have an interest in maintaining that (and I assume no one has stepped up to address this) -- we should move on to the Octavia world.

If we REALLY want to be extra nice we can cut a new major release that drops lbaas support and keep an older stable/1.0 branch maybe?

mnaser avatar Aug 05 '23 14:08 mnaser

lbaas started to be deprecated in 2018 and fully removed in 2020...

I am aware :)

we should move on to the Octavia world.

Agreed. This would still require a refactor of all the LB resources. Well not refactor, but removing all obsolete code etc. My intention was to create a separate issue announcing the potential removal of support for lbaas_v2 and see how people felt about it. Then, given the time and depending on the input of users, either work on removing the code and deprecating lbaas_v2 OR refactor it in a way that is much easier to add octavia features and keep lbaas_v2. My personal opinion would be to completely remove lbaas_v2.

Keep in mind that we dont have any official deprecation policy and we "want" to support all versions

If you have the time to work on this i would propose:

  • open a seperate ticket advocating for the removal of lbaas_v2 where we ask for upvote/downvote
  • give it some time till we gather input
  • in the meantime check how the removal should work etc
  • implement it ( depending on how we plan it i might be able to assist in some resources but not all, for sure i can help on reviews etc to streamline it)

nikParasyr avatar Aug 06 '23 10:08 nikParasyr

Opened related ticket https://github.com/terraform-provider-openstack/terraform-provider-openstack/issues/1638 for deprecation of neutron lbaas

nikParasyr avatar Jan 05 '24 12:01 nikParasyr