Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the ownerRef helper in SDK #1060

Closed
cmwylie19 opened this issue Aug 15, 2024 · 0 comments · Fixed by #1104
Closed

Enhance the ownerRef helper in SDK #1060

cmwylie19 opened this issue Aug 15, 2024 · 0 comments · Fixed by #1104
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cmwylie19
Copy link
Collaborator

cmwylie19 commented Aug 15, 2024

Is your feature request related to a problem? Please describe.

Need to add more finalizer support and protect "owned" resources so they don't get deleted unless the owning object is deleted.

  const { name, uid } = instance.metadata!;

  return [
    {
      apiVersion: instance.apiVersion!,
      kind: instance.kind!,
      uid: uid!,
      name: name!,
      controller: true, // add
      blockOwnerDeletion: true, // add
    },
  ];
}

Kubernetes Docs around ownerRefs

Describe the solution you'd like

  • Given a controller deploys a deployment that is owned by a WebApp
  • When someone tries to delete the deployment
  • Then deletion is blocked until the WebApp is deleted

Describe alternatives you've considered

(optional) A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@cmwylie19 cmwylie19 added the enhancement New feature or request label Aug 15, 2024
@cmwylie19 cmwylie19 added this to the v0.36.0 milestone Aug 26, 2024
@cmwylie19 cmwylie19 moved this from 📋 Backlog to 🏗 In progress in Pepr Project Board Aug 29, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Pepr Project Board Sep 12, 2024
itsarijitray pushed a commit to itsarijitray/pepr that referenced this issue Sep 20, 2024
## Description

This PR adds support for optional fields defined in
[ownerReferences](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#System).
It also changes the test block to use a parameterized test.

End to End Test:  N/A

## Related Issue

Fixes defenseunicorns#1060

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Co-authored-by: Case Wylie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants