Skip to content

Corrección: feat(lifecycle): update and uninstall directory targets via recorded ownership (#354) #358

Open

Description

@barbatdev

Source PR: #354
Branch: feat/issue-342-lifecycle
Head reviewed: 12ef26a

Push the fixes to the branch above; do not open a new pull request. Comment on the PR and on this issue when done.

Blocking findings

  • Uninstall of a nonexistent target directory exits OK instead of failing closed (internal/cli/doctor.go:458): runDirectoryUninstall returns exitOK with status=not_installed when deps.rootExists is false, while the same function returns exitConflict for an existing directory with zero ownership records. Issue feat: include directory targets in update and uninstall via recorded ownership #342 acceptance criterion: "Running update/uninstall against a directory with no prior Cortex ownership fails closed with an explicit diagnostic." A nonexistent path trivially has no prior Cortex ownership, yet uninstall reports success, unlike update which refuses with not_applied in the equivalent case (covered by TestUpdateDirectoryTargetFailsClosedOnUnknownState). There is also no test for uninstall against a never-installed target.
    • Failure scenario: Operator runs cortex uninstall --target-dir /home/user/typo-dir where the path does not exist. The command exits 0 reporting not_installed, so an automation script treats the target as cleanly uninstalled; the same command against an existing empty directory exits with conflict. The acceptance criterion requires fail-closed with an explicit diagnostic in both cases.

Acceptance criteria

  • Fixed: Uninstall of a nonexistent target directory exits OK instead of failing closed (internal/cli/doctor.go:458). The scenario below no longer reproduces: Operator runs cortex uninstall --target-dir /home/user/typo-dir where the path does not exist. The command exits 0 reporting not_installed, so an automation script treats the target as cleanly uninstalled; the same command against an existing empty directory exits with conflict. The acceptance criterion requires fail-closed with an explicit diagnostic in both cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions