Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-6639

Integrated update does not detect all container types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.11.0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      0
    • Sprint:
      Platform Sprint 26
    • Needs QA:
      Yes

      Description

      The Ansible playbook used to execute upgrades via the UI expects all containers to report virtualisation as docker.

      This is an invalid assumption for containers created with podman and thus unwanted tasks are executed, thus right now it is essential to not perform UI-initiated updates and instead recreate the container with the new version.

      Running directly with runc or similar will also report the host virtualisation (e.g. kvm).

      Containers created using podman will set an environment variable (container) and set its value to podman, so it would be possible to use that workaround for runc etc.

      Example play
      - hosts: localhost
        become: yes
        gather_facts: yes
        pre_tasks:
          - name: detect containers
            set_fact:
              is_container: '{{ True if (ansible_virtualization_type == "docker" or (ansible_env["container"] is defined and ansible_env["container"] == "podman")) else False }}'
      
        tasks:
        - debug:
            msg: '{{ ansible_virtualization_type }} = {{ is_container }} (ansible_env.container: ({{ ansible_env.container | default("unknown") }})'
      
      Extracted output
      # Container created by podman
      TASK [debug] ******************************************************************************************************************************************************************************************************
      ok: [localhost] => {
          "msg": "kvm = True (ansible_env.container: (podman)"
      }
      
      # Container created by Docker
      TASK [debug] ******************************************************************************************************************************************************************************************************
      ok: [localhost] => {
          "msg": "docker = True (ansible_env.container: (unknown)"
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ceri.williams Ceri Williams
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 20 minutes
                  20m

                    Smart Checklist