Skip to content

[BUG] With kubernetes/eks 1.30 or higher and sleep lifecycle the controller not restart deployment #754

Open
@mlophez

Description

Describe the bug
When using Kubernetes 1.30 or higher, the Deployment object adds new lifecycle policies, such as sleeplifecycle.
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/

When you add this, the controller throws the following error and not restart deployment:

time="2024-09-26T06:24:29Z" level=error msg="Update for of type 'Deployment' in namespace 'core' failed with error Deployment.apps is invalid: spec.template.spec.containers[0].lifecycle.preStop: Required value: must specify a handler type"

This happens because, in the current project libraries, the Deployment object does not have those properties.
When we updated the project's libraries to version 1.31, the problem was resolved.

´´´
go get k8s.io/[email protected]
go get k8s.io/[email protected]
go get k8s.io/[email protected]
go get k8s.io/[email protected]
´´´

To Reproduce
Use kubernetes 1.30 and use deployment with lifecycle sleep or kubernetes 1.29 with de alpha feature enable

Expected behavior
The controller must be function as normally

Environment

  • Operator Version: master
  • Kubernetes/OpenShift Version: 1.31

Additional context

Activity

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

Metadata

Assignees

No one assigned

    Labels

    good-first-issueA good starting point for new contributorskind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions