Skip to content

Conversation

soharab-ic
Copy link
Contributor

@soharab-ic soharab-ic commented Jun 21, 2024

Description

  • Set OwnerReferences to Poolmanager and builderManager deployment and service created by environment.
  • Set OwnerReferences to deployment, service and HPA created by newdeploy function.
  • Set OwnerReferences to builderManager deployment and service created by environment.
  • Set OwnerReferences to deployment, service and HPA created by container function.

Which issue(s) this PR fixes:

Fixes #2962

Testing

OwnerReferences are added for poolmanager deployement as follows:

$ kubectl get deploy poolmgr-go-122-default-253070 -oyaml
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    executorInstanceId: lpd23pfg
  creationTimestamp: "2024-06-25T06:09:57Z"
  generation: 1
  labels:
    environmentName: go-122
    environmentNamespace: default
    environmentUid: e833d7f4-27bf-4f0d-9fe5-9d6169246de7
    executorType: poolmgr
    managed: "true"
  name: poolmgr-go-122-default-253070
  namespace: default
  ownerReferences:
  - apiVersion: fission.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: Environment
    name: go-122
    uid: e833d7f4-27bf-4f0d-9fe5-9d6169246de7
  resourceVersion: "253399"
  uid: c29919bf-4541-4c92-af66-696555bae54f

Tried following tests scenarios:
Test 1:
Create env.
Create poolmanager, newdeploy and container function.
Delete poolmanager, newdeploy and container function.
Result:
1. No issues, all resources were deleted.

Test 2:
Create env.
Create poolmanager, newdeploy and container function.
Delete Environment.
Result:
1. Fission-CLI failed to delete environment, env is used by atleast one function.
2. kubectl deleted the environment along with poolmanager deployment, builder deployement and builder service. Poolmanager function is not deleted but it does not work as expected.

Test 3:
Create env.
Create poolmanager, newdeploy and container function.
Update poolmanager, newdeploy and container function.
Result:
1. Successfully updated the functions.

Checklist:

  • I ran tests as well as code linting locally to verify my changes.
  • I have done manual verification of my changes, changes working as expected.
  • I have added new tests to cover my changes.
  • My changes follow contributing guidelines of Fission.
  • I have signed all of my commits.

Set environment as owner to poolmanager deployment.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 89.23077% with 7 lines in your changes missing coverage. Please review.

Project coverage is 44.70%. Comparing base (1985852) to head (a770052).
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/executor/executortype/newdeploy/newdeploy.go 88.23% 2 Missing ⚠️
...kg/executor/executortype/container/containermgr.go 0.00% 1 Missing ⚠️
pkg/executor/executortype/container/deployment.go 87.50% 1 Missing ⚠️
pkg/executor/executortype/container/svc.go 87.50% 1 Missing ⚠️
...kg/executor/executortype/newdeploy/newdeploymgr.go 50.00% 1 Missing ⚠️
pkg/executor/util/hpa/hpa.go 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2964      +/-   ##
==========================================
+ Coverage   44.59%   44.70%   +0.11%     
==========================================
  Files         236      236              
  Lines       24216    24277      +61     
==========================================
+ Hits        10798    10854      +56     
- Misses      12015    12020       +5     
  Partials     1403     1403              
Flag Coverage Δ
unittests 44.70% <89.23%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soharab-ic soharab-ic requested a review from sanketsudake June 21, 2024 12:35
```
Set OwnerReferences to deployment, service and HPA created by newdeploy function.
Set OwnerReferences to builderManager deployment and service created by environment.
Set OwnerReferences to deployment, service and HPA created by container function.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
@soharab-ic soharab-ic changed the title Set OwnerReference to poolmanager deployment Set OwnerReferences to K8s resources created by Fission Jun 25, 2024
@sanketsudake sanketsudake merged commit a34840b into main Jun 25, 2024
@sanketsudake sanketsudake deleted the set-owner-ref-poolmanager-deploy branch June 26, 2024 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing OwnerReference for dynamically created ressoruces like poolmgr
3 participants