Skip to content
Discussion options

You must be logged in to vote

i found the solution, digging in issue/PR and discussion with that

#319 (comment)

@kopf.on.resume(
    "", "v1", "secret", labels=LABELS_MATCH_DEPRECATED, id="crui-deprecated"
)
async def on_deprecated_labels(body: kopf.Body, patch, **_):  # pragma: no cover
    """Handle deprecated label events"""
    patch.metadata.annotations[
        f"{K8S_API_NS_DEPRECATED}/last-handled-configuration"
    ] = None
    patch.metadata.annotations[f"{K8S_API_NS_DEPRECATED}/kopf-managed"] = None
    raise kopf.PermanentError(
        f"deprecated labels detected on secret {body.metadata.name}, please update to use {K8S_API_NS} instead of {K8S_API_NS_DEPRECATED}"
    )

work as expected

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by DrummyFloyd
Comment options

You must be logged in to vote
1 reply
@DrummyFloyd
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants