-
Notifications
You must be signed in to change notification settings - Fork 100
Ensure that delete jobs run when projects are deleted (#1893) #1886
Conversation
pkg/controller/defaults/testdata/memory/all-set-overwrite/expected.golden
Outdated
Show resolved
Hide resolved
fc30dfe
to
ba0246e
Compare
@@ -10,9 +10,6 @@ spec: | |||
"": sample-compute-class | |||
status: | |||
observedGeneration: 1 | |||
defaults: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a duplicate entry.
736086e
to
0e92484
Compare
pkg/controller/defaults/testdata/region/default/expected.golden
Outdated
Show resolved
Hide resolved
type projectCreater struct { | ||
creater strategy.Creater | ||
client kclient.Client | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I know the underlying typo/misspelling comes from mink, but I think this is worth changing anyway
type projectCreater struct { | |
creater strategy.Creater | |
client kclient.Client | |
} | |
type projectCreator struct { | |
creator strategy.Creater | |
client kclient.Client | |
} |
(Would need to modify other parts of this file too.)
560eb3f
to
e33a983
Compare
pkg/uninstall/uninstall.go
Outdated
if err := c.Get(ctx, kclient.ObjectKey{Namespace: "kube-system", Name: "acorn-controller"}, controllerLease); !apierror.IsNotFound(err) && err != nil { | ||
return nil, err | ||
} | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the err here is not the err in the if statement above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Will fix.
@@ -80,6 +82,14 @@ func baseResources(ctx context.Context, c kclient.Client) (resources []kclient.O | |||
} | |||
} | |||
|
|||
controllerLease := &coordinationv1.Lease{} | |||
if err := c.Get(ctx, kclient.ObjectKey{Namespace: "kube-system", Name: "acorn-controller"}, controllerLease); !apierror.IsNotFound(err) && err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the lease live in acorn-system or kube-system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It lives in the kube-system
namespace.
e33a983
to
0c2ecd4
Compare
0c2ecd4
to
20d54dc
Compare
There are a few situations where we need a buffer between a project being deleted and the corresponding namespace being deleted. One such scenario is ensuring that delete jobs run when a project is deleted. This change adds a project instance, which is this buffer. Using the project instance, we can ensure that all apps are successfully cleaned up before the namespace is deleted. This should also give the user the ability to use the ignore-cleanup functionality when deleting a project. Changes are also made to the integration tests to use project instances instead of namespaces. Signed-off-by: Donnie Adams <[email protected]>
20d54dc
to
0b9b373
Compare
There are a few situations where we need a buffer between a project being deleted and the corresponding namespace being deleted. One such scenario is ensuring that delete jobs run when a project is deleted.
This change adds a project instance, which is this buffer. Using the project instance, we can ensure that all apps are successfully cleaned up before the namespace is deleted. This should also give the user the ability to use the ignore-cleanup functionality when deleting a project.
Checklist
This is a title (#1216)
. Here's an exampleRequires: acorn-io/baaah#90
Issue: #1893