Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vague Filters Matching First #318

Open
miralgj opened this issue Aug 26, 2020 · 0 comments
Open

Vague Filters Matching First #318

miralgj opened this issue Aug 26, 2020 · 0 comments

Comments

@miralgj
Copy link

miralgj commented Aug 26, 2020

Asset definitions for assets such as sensu-plugins-process-checks and sensu-plugins-disk-checks have more vague filters at the top of the list, instead of at the bottom, making them match first to be downloaded and installed when there are more specific filters that are applicable for the platform available.

I edited the asset for process-checks in my backend to move the more vague filter to the bottom so that it would download the correct one to get around this since the incorrect matching filter was causing the plugin to fail to run on RHEL 6.

For example, the process-checks definition is currently:

  builds:
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_debian9_linux_amd64.tar.gz
    sha512: 76bcad9ffe048447061e86a8d41e7e70b413b23bcded0160635fbf390e351ca37b31fec13719d97a9879807f7d28998f5d359d69818973b01912370851cb4a48
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_debian_linux_amd64.tar.gz
    sha512: 0f484a78b4413a745555b4e7dc8ef6c88233736c9a828a4ea8ead677611abd5dfaaea8e4329459f81daf2daef097a379c0ca30bc3859f1ef7838a512c14ab454
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'debian'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos7_linux_amd64.tar.gz
    sha512: 1c10dda30ecf0298583b186e9b46f8319d18b093d3f6c3b2be7b475b99ba7e281e8af78a3bcc45fedfeca1d498690a894e15fe56efa9dba5d2052134e1b1ab75
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
    - entity.system.platform_version.split('.')[0] == '7'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos6_linux_amd64.tar.gz
    sha512: 0e5b14a429f95dc340217a976a7adb1e06c146e76299731def4a879299ed55e695d1b3f6fdbc0aa50d81db6b414ede7112246178ddeab5d80939b6957fc08497
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
    - entity.system.platform_version.split('.')[0] == '6'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos_linux_amd64.tar.gz
    sha512: 649e15dc32e38f5d35af1c50ec2e473e8355029de2a42baf9ef93ee7def57aee8829b197ce9bdf19271739056677d020eeeb8db3fcf533dcc2999358af500102
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_alpine3.8_linux_amd64.tar.gz
    sha512: a2e67c6b773631c60ca02aa04b6538876502499b0a24af1adfa15bf455a0eb3b92423d21dd30d5df9ed3bca5040d29086ef7b3fb2886e1385aa841d575a038e9
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform == 'alpine'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_alpine_linux_amd64.tar.gz
    sha512: 67c6b4d0c23fa80bab8dc7bc586621f3e9d0f9512d081f94948409c0bf3d7385dce2eac302c416337a34a57d5a160d14d9016e1f3c2b4adf71b85f1ff752eab2
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform == 'alpine'
    - entity.system.platform_version.split('.')[0] == '3'

I feel it should have more vague filters at the bottom so it matches proper platforms. Remember that Sensu uses the very first match that evaluates to true and ignores the rest.

  builds:
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_debian_linux_amd64.tar.gz
    sha512: 0f484a78b4413a745555b4e7dc8ef6c88233736c9a828a4ea8ead677611abd5dfaaea8e4329459f81daf2daef097a379c0ca30bc3859f1ef7838a512c14ab454
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'debian'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos7_linux_amd64.tar.gz
    sha512: 1c10dda30ecf0298583b186e9b46f8319d18b093d3f6c3b2be7b475b99ba7e281e8af78a3bcc45fedfeca1d498690a894e15fe56efa9dba5d2052134e1b1ab75
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
    - entity.system.platform_version.split('.')[0] == '7'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos6_linux_amd64.tar.gz
    sha512: 0e5b14a429f95dc340217a976a7adb1e06c146e76299731def4a879299ed55e695d1b3f6fdbc0aa50d81db6b414ede7112246178ddeab5d80939b6957fc08497
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
    - entity.system.platform_version.split('.')[0] == '6'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_centos_linux_amd64.tar.gz
    sha512: 649e15dc32e38f5d35af1c50ec2e473e8355029de2a42baf9ef93ee7def57aee8829b197ce9bdf19271739056677d020eeeb8db3fcf533dcc2999358af500102
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform_family == 'rhel'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_alpine3.8_linux_amd64.tar.gz
    sha512: a2e67c6b773631c60ca02aa04b6538876502499b0a24af1adfa15bf455a0eb3b92423d21dd30d5df9ed3bca5040d29086ef7b3fb2886e1385aa841d575a038e9
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform == 'alpine'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_alpine_linux_amd64.tar.gz
    sha512: 67c6b4d0c23fa80bab8dc7bc586621f3e9d0f9512d081f94948409c0bf3d7385dce2eac302c416337a34a57d5a160d14d9016e1f3c2b4adf71b85f1ff752eab2
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
    - entity.system.platform == 'alpine'
    - entity.system.platform_version.split('.')[0] == '3'
  - url: https://assets.bonsai.sensu.io/d582eeb357ca2c483cf1dc290640baca8dcd66f5/sensu-plugins-process-checks_4.1.0_debian9_linux_amd64.tar.gz
    sha512: 76bcad9ffe048447061e86a8d41e7e70b413b23bcded0160635fbf390e351ca37b31fec13719d97a9879807f7d28998f5d359d69818973b01912370851cb4a48
    filters:
    - entity.system.os == 'linux'
    - entity.system.arch == 'amd64'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant