Coder Social home page Coder Social logo

`terraform destroy` needs extra action while destroying an cluster with some custom annotations about terraform-provider-gardener HOT 5 CLOSED

kyma-incubator avatar kyma-incubator commented on June 16, 2024
`terraform destroy` needs extra action while destroying an cluster with some custom annotations

from terraform-provider-gardener.

Comments (5)

clebs avatar clebs commented on June 16, 2024

Hi @neo-liang-sap,

that is a very interesting finding and from my limited understanding I suspect that it is a bug in gardener.

What might probably happening is that gardener is not able to edit the annotations when destroying (they are usually immutable).

I am afraid this might not be an issue on the terraform provider but on gardener itself.

I would suggest you take this up with the gardener team (https://github.com/gardener/gardener) and see what feedback you can get from them.

from terraform-provider-gardener.

neo-liang-sap avatar neo-liang-sap commented on June 16, 2024

Hi @clebs
Yes the metadata.annotations in gardener is immutable, i will bring up this issue to gardener team to see if any better solution than what i tried.
Thanks!
-Neo

from terraform-provider-gardener.

vpnachev avatar vpnachev commented on June 16, 2024

I suspect that it is a bug in gardener.

@clebs - this is not a bug, it is by design so. For details see gardener/gardener#1816 (comment)

Yes the metadata.annotations in gardener is immutable

@neo-liang-sap , this is not true, too.

from terraform-provider-gardener.

neo-liang-sap avatar neo-liang-sap commented on June 16, 2024

Hi @clebs / @vpnachev

Thanks for the explanation, now i totally understand that adding "confirmation.garden.sapcloud.io/deletion" = true to shoot cluster before deletion is by design.
I have just one question regarding annotation.metadata handling logic in terraform-provider-gardener:

In my test described at this ticket, if i build an shoot without any customized metadata.annotation, the shoot contains "confirmation.garden.sapcloud.io/deletion" = true which could be deleted directly.

If i build an shoot with customized metadata.annotation, this shoot has no annotation of "confirmation.garden.sapcloud.io/deletion" = true

I checked code in terraform-provider-gardener, there are two lines explicitly adding "confirmation.garden.sapcloud.io/deletion" = true no matter whether the metadata.annotation is nil or not

  1. https://github.com/kyma-incubator/terraform-provider-gardener/blob/master/expand/expand_metadata.go#L25
  2. https://github.com/kyma-incubator/terraform-provider-gardener/blob/master/shoot/resource_shoot.go#L97

If i understand correctly, so these two lines didn't work when metadata.annotation is not nil (contains some other annotations)? correct me if i was wrong, if there's any place i can worked on to improve this i'd like to help

Thanks!
-Neo

from terraform-provider-gardener.

neo-liang-sap avatar neo-liang-sap commented on June 16, 2024

close this issue as confirmed by Gardener dev, it's working as design

from terraform-provider-gardener.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.