sensu / sensu-go-chef

Chef Library Cookbook for Sensu Go
https://sensu.io
MIT License
11 stars 22 forks source link

Namespace Specific Resources Should Not Require Namespaces in Their Names #142

Open devinlyons opened 1 year ago

devinlyons commented 1 year ago

Chef Version

$ chef-client --version
Chef: 17.10.3

Input

sensu_secret 'prod_foo' do
    id '/secrets/prod/foo'
    namespace 'prod'
    secrets_provider 'vault'
end

sensu_secret 'test_foo' do
    id '/secrets/test/foo'
    namespace 'test'
    secrets_provider 'vault'
end

Output

This creates a secret called prod_foo in the namespace prod and test_foo in the namespace test.

Impact

This creates a more complicated environment where every asset in Sensu has to be aware of its own namespace.

Expected Behavior

It would be better if they could both be called foo. However, that is impossible because every resource in Chef must have a unique name and that name is used as the name of the resource in Sensu.

sensu_secret 'prod_foo' do
    id '/secrets/prod/foo'
    namespace 'prod'
    secrets_provider 'vault'
    secret_name 'foo'
end

sensu_secret 'test_foo' do
    id '/secrets/prod/foo'
    namespace 'prod'
    secrets_provider 'vault'
    secret_name 'foo'
end

Actual Behavior

As described above.

Steps to Reproduce your problem

As described above.