Skip to content

Commit

Permalink
fix: only delete the service
Browse files Browse the repository at this point in the history
owner refs will cascade the delete
  • Loading branch information
stuartwdouglas committed Oct 1, 2024
1 parent 53d08d1 commit 88fe0d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ func (r *DeploymentProvisioner) handleSchemaChange(ctx context.Context, msg *ftl
// Nasty hack, we want all the controllers to have updated their route tables before we kill the runner
// so we add a slight delay here
time.Sleep(time.Second * 10)
logger.Debugf("Deleting deployment %s", msg.ModuleName)
err := deploymentClient.Delete(ctx, msg.DeploymentKey, v1.DeleteOptions{})
if err != nil {
logger.Errorf(err, "Failed to delete deployment %s", msg.ModuleName)
}
// TODO: we only need to delete the services once this new ownership structure has been deployed to production
// Existing deployments don't have this though
logger.Debugf("Deleting service %s", msg.ModuleName)
err = r.Client.CoreV1().Secrets(r.Namespace).Delete(ctx, msg.DeploymentKey, v1.DeleteOptions{})
Expand Down
9 changes: 6 additions & 3 deletions deployment/base/ftl-controller/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ metadata:
rules:
- apiGroups: [ "apps" ]
resources: [ "deployments" ]
verbs: [ "get", "list", "watch", "delete", "create", "update", "patch" ]
verbs: [ "get", "list", "watch", "create", "update", "patch" ]
- apiGroups: [ "" ]
resources: [ "services" , "serviceaccounts"]
resources: [ "services" ]
verbs: [ "get", "list", "watch", "delete", "create", "update", "patch" ]
- apiGroups: [ "" ]
resources: [ "serviceaccounts"]
verbs: [ "get", "list", "watch", "create", "update", "patch" ]
- apiGroups: [ "" ]
resources: [ "pods" ]
verbs: [ "get", "list", "watch" ]
Expand All @@ -22,4 +25,4 @@ rules:
verbs: [ "get"]
- apiGroups: [ "security.istio.io" ]
resources: [ "authorizationpolicies" ]
verbs: [ "get", "list", "watch", "delete", "create", "update", "patch" ]
verbs: [ "get", "list", "watch", "create", "update", "patch" ]

0 comments on commit 88fe0d0

Please sign in to comment.