Skip to content

[P1] IAM import reports success after failed restore #63

Closed

Description

@Vonng

Summary

The IAM import command can silently convert a V2 restore failure into a successful V1 fallback. It does not surface failed entities from a successful V2 response.

Reproduction

Use an IAM archive containing a V2 failed-user entry, for example an iam-assets/users.json entry that the server rejects:

mcli admin cluster iam import ALIAS /tmp/iam-invalid-user.zip
mcli admin user info ALIAS/review-invalid-user

Observed

The current V2 client cannot decode the server's failed-entity error representation. The command catches that error, retries the legacy import, prints IAM info imported, returns 0, and the user is absent. JSON mode emits no useful failure result.

The fallback is triggered by any V2 error at admin-cluster-iam-import.go, and the V2 result's failed entities are not checked before returning success.

Expected

  • Decode V2 failure entries into a stable, usable client DTO.
  • Fall back to V1 only when the endpoint is genuinely unsupported.
  • Return nonzero when any entity failed, while retaining added/skipped/removed/failed details in text and JSON.
  • Do not claim a restore succeeded when the target state is incomplete.

Acceptance

  • Test failed users, policies, groups, service accounts, and mixed success/failure archives.
  • Test unsupported V2 endpoint fallback independently.
  • Assert text output, JSON output, and process exit status.
  • Verify failed entities are absent or unchanged on the server and are reported explicitly.

Confirmed on current main 07753f7efc5036465bb79dadde031ec07f172505 against isolated SILO IAM APIs.

Activity

  1. Vonng commented on Nov 8, 2026

    @Vonng
    MemberAuthor

    Fixed on main in #74 (bfb58768).

    IAM imports now decode V2 failed-entity reports and return nonzero when any entity fails, preserving the detailed text or JSON result. Legacy fallback is limited to explicit NotImplemented or XMinioAdminVersionMismatch responses. Tests cover all failure categories, mixed results, malformed and truncated responses, JSON/XML fallback, and redaction; a rejected-user import was also verified against SILO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions