[v1.1.4] Metadata not working as expected

Here’s my rancher-compose.yml:

db:
    scale: 1
    metadata:
        backup:
            data:
                include:
                    - 'var/lib/postgresql/data'
web:
    scale: 1
    metadata:
        backup:
            public:
                include:
                    - 'public'
            local:
                include:
                    - 'code/local'
nginx:
    scale: 1
    metadata:
        backup:
            config:
                include:
                    - 'etc/nginx/conf.d'
backup:
    scale: 1

Here’s what the UI is showing me for my rancher-compose.yml:

nginx:
  scale: 1
  metadata:
    backup: &id001
      local:
        include:
        - code/local
      public:
        include:
        - public
db:
  scale: 1
  metadata:
    backup: *id001
web:
  scale: 1
  metadata:
    backup: *id001
backup:
  scale: 1
  metadata:
    backup: *id001

Is there a problem with each service having its own backup metadata?

Is part of the yaml you’re not showing that these are sidekicks of each other? Only the primary service can have metadata.

(YAML has something like pointers… “&id001” is a label definition and “*id001” is a reference to that label, so the this says that the value for “backup” for all 4 are the same).

Yes, one is a primary service and the rest are sidekicks. web is the primary service – I figured that if only the primary service could have metadata, then the metadata would only appear on the primary service. Is having the same metadata repeated across all services intentional? If it’s intentional for it all to appear everywhere, I’ll put it all on one (probably backup for ease of comprehension six months from now).

Another question – how can I update the metadata on the stack? The only way I know for sure is to remove the entire stack and push it up again.

Ah, I can just rancher-compose up -d and it works now. I had to put it on the primary container, as you said, but now it’s working.