Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Allow acorn rm --ignore-cleanup on services (#1795) #1878

Merged

Conversation

g-linville
Copy link
Contributor

@g-linville g-linville commented Jun 30, 2023

for #1795

We recently added the --ignore-cleanup flag to acorn rm, which removes some finalizers and ignores the delete event job(s). This was not working for services (and probably wasn't working for nested Acorns either), since the default name validation was blocking names with ., and the logic to find the AppInstance was not checking the public name label. This PR fixes both of those things.

To validate my changes, I am using the following Acornfiles:

// service.Acornfile
containers: "never-ready": {
  image: "nginx:latest"
  probes: readiness: tcp: url: "tcp://localhost:5555"
}

jobs: "fail-on-delete": {
  image: "busybox:latest"
  events: ["create", "delete"]
  entrypoint: ["/script.sh"]
  files: "/script.sh": """
  #!/bin/sh
  echo Starting
  sleep 5
  dne
  """
}
// Acornfile
services: myservice: {
  image: <image built from service.Acornfile>
}

containers: nginx: {
  image: "index.docker.io/nginx:latest"
  ports: ["80/http"]
}

When deploying this app, it is never ready (thanks to the bad container in the service). When you delete the app, it looks like it succeeds in the CLI, but that kicks off the delete job in the service, which fails continuously. Previously, acorn rm --ignore-cleanup <app name>.myservice would fail, but now it works and finishes cleaning everything up.

Checklist

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@g-linville g-linville force-pushed the ignore-cleanup-fix-for-services branch from 78a0bf7 to 92f4e81 Compare July 3, 2023 13:21
@g-linville g-linville merged commit 6aae4d0 into acorn-io:main Jul 3, 2023
@g-linville g-linville deleted the ignore-cleanup-fix-for-services branch July 3, 2023 13:39
cloudnautique pushed a commit to cloudnautique/runtime that referenced this pull request Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants