Skip to content

[multi-container] toggling the default enable-multi-container from true to false will break things #7241

Closed

Description

@dprotaso

What version of Knative?

enable-multi-container flag was introduced in this PR #7167

Expected Behavior

Operators who set enable-multi-container default to true shouldn't be able to set it back to false or even delete the entry in the config map

Actual Behavior

There are no restrictions to how enable-multi-container can be set.

Thus if users create multi-container revisions and then the operator sets the default to false reconciliation of those resources will start to constantly fail.

Steps to Reproduce the Problem

Activity

  1. added
    kind/bug
    on Mar 13, 2020
  2. changed the title [-][multi-container] toggling the default enable-multi-container from true and then to false will break things[/-] [+][multi-container] toggling the default enable-multi-container from true to false will break things[/+] on Mar 13, 2020
  3. added this to the Serving 0.16.x milestone on May 27, 2020
  4. markusthoemmes commented on Jun 24, 2020

    @markusthoemmes
    Contributor

    This might be somewhat non-trivial as our current validation logic for ConfigMaps only gets the state of the update itself, not the "before" state, thus (I think?) it cannot decide whether you're actually toggling or not. As such, this might require significant changes to how we validate ConfigMaps in our webhook. Does that sound right @dprotaso?

  5. dprotaso commented on Jun 24, 2020

    @dprotaso
    MemberAuthor

    Yeah I was thinking about that as well

  6. markusthoemmes commented on Jun 24, 2020

    @markusthoemmes
    Contributor

    We might be lucky because the configmap.Constructors type is map[string]interface{} and the functions are called by reflection already. Maybe we can make it so that it can take both unary and 2-arity functions and depending on which it gets, it passes the correct parameters in?

    We could then create a ValidateABC function for the features configmap that we pass into the webhook here

    configmap.Constructors{
    . That function takes both the old and the new CM, does validation and maybe returns the new CM or an error.

    Does that sound just about feasible? I'd take this issue to mentor a new contributor in :).

  7. vagababov commented on Jun 24, 2020

    @vagababov
    Contributor

    I don't see this working though. I can just delete the CM. Or you're going to block deletion of CM as well?

  8. skonto commented on Jun 27, 2020

    @skonto
    Contributor

    @markusthoemmes regarding update If I read correctly this new enhancement by K8s (immutable configmaps) might be useful so configuration could be split to immutable and mutable parts. @vagababov It will probably cover deletion too.

  9. dprotaso commented on Jun 29, 2020

    @dprotaso
    MemberAuthor

    @markusthoemmes regarding update If I read correctly this new enhancement by K8s (immutable configmaps) might be useful so configuration could be split to immutable and mutable parts. @vagababov It will probably cover deletion too.

    Our current min K8s version is 1.16 so it'll be sometime before we can adopt that feature

  10. vagababov commented on Jun 29, 2020

    @vagababov
    Contributor

    Also we don't want CMs to be immutable. But operators might, i.e. mark the CMs as immutable in the operator deployment.

  11. dprotaso commented on Jun 29, 2020

    @dprotaso
    MemberAuthor

    I also realize this issue applies to other features - ie. enabling and disabling fieldref.

    Maybe the solution for now is operator awareness - maybe via comments in the features configmap

  12. skonto commented on Jun 30, 2020

    @skonto
    Contributor

    Our current min K8s version is 1.16 so it'll be sometime before we can adopt that feature.

    True it will take a few months, but it seems it will go to Beta.

    Also we don't want CMs to be immutable. But operators might.

    If there are settings not meant to be changed once set, then they can be put in a special immutable configmap. This way it would be clear what can or cannot be changed at runtime IMHO.
    An alternative would be to keep critical config replicated at the Knative CR object (eg. in status) or at the operator CR object (if operators are used) since configuration is part of the state of your system anyway. This way you know your past state and you could reject new updates. Of course CR objects can be updated so you dont get much protection but if they are deleted it means your system needs to be reconciled anyway.

  13. markusthoemmes commented on Jun 30, 2020

    @markusthoemmes
    Contributor

    Seems to me as adding a cautionary warning to the configmap setting is sufficient for now?

  14. vagababov commented on Jun 30, 2020

    @vagababov
    Contributor

    Warning is fine.


    If there are settings not meant to be changed once set...

    Not necessarily true, settings might be set by mistake. I might be sure that disabling the setting is going to be safe, etc.

  15. modified the milestones: Serving 0.16.x, 0.17.x on Jul 8, 2020
  16. skonto commented on Jul 9, 2020

    @skonto
    Contributor

    @markusthoemmes afaik the setting has been removed from the defaults.yaml file in #8315, is there some other place to add the warning (or do you mean emit a log msg)?

  17. markusthoemmes commented on Jul 9, 2020

    @markusthoemmes
    Contributor

    features.yaml has it now I believe.

  18. modified the milestones: 0.17.x, 0.18.x on Aug 31, 2020
  19. markusthoemmes commented on Sep 2, 2020

    @markusthoemmes
    Contributor

    /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions