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

fix: only delete the service #2936

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ]
- 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" ]
Loading