What is inventory_policy used for in agent config.yaml?

Hi all,

I’ve connected my kubernetes cluster via gitlab agent to gitlab. I’ve tried to change manifest files and after pushing those files to gitlab repository applications redeployed. I’ve done it again on another cluster and it throws this:

{"error":"inventory policy prevented actuation (strategy: Apply, status: Empty, policy: MustMatch)","group":"apps","kind":"Deployment","name":"app1","namespace":"my-ns","status":"Skipped","timestamp":"2023-02-02T15:22:54Z","type":"apply"}

I’ve found this ant here are inventory_policy options that I can set in agents config.yaml

The problem is that I don’t understand what that means. Why is this a problem and why should I change it.

It says:

Sometimes your manifest changes affect resources that aren’t tracked by the GitLab inventory object

But what does that mean, what is Gitlab inventory object?

Thanks in advance

As I understood from link shared in post - adopt_if_no_inventory means that gitlab agent will update applications that were added to cluster before agent was added to cluster