Skip to content

Prune has undocumented "keepDaily 14" default #1106

Description

@mogol07

Description

I try to create two prune jobs, where first must delete every "daily" snapshots older than 30 days, and second must delete every "intradaily" snapshots older than 24 hours. First task is working as expected, but second is leaving last snapshot of the previous days.
When I try to check logs, I see that it's running with two conditions: keepHourly 24 + keepDaily 14. But I don't define keepDaily for this job. I check code, and I found in \operator\prunecontroller\executor.go

if prune.Spec.Retention.KeepDaily > 0 {

		vars.SetString("KEEP_DAILY", strconv.Itoa(prune.Spec.Retention.KeepDaily))

	} else {

		vars.SetString("KEEP_DAILY", "14")

	}

i.e. keepDaily is always set to 14, if it's not defined in job.

But this behavior is never described.

Additional Context

No response

Logs

Expected Behavior

At least this default value must be clearly described in documentation. And mention what it need to be put as value (0 / null / "") to completely disable it.

More correct way: default value is sill documented but if any condition are defined, then keepDaily has no default value.

Steps To Reproduce

Create a prune job without keepDaily and check log or pod definition. You would see, it has keepDaily 14 in it.

Version of K8up

4.8.6

Version of Kubernetes

1.34

Distribution of Kubernetes

SAP BTP KYMA

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions