Sensu 7 will change how so-called "wrapped resources" are portrayed and worked with.
In Sensu 6, users can create resources of any type by wrapping them and handing them to sensuctl. The wrapper includes type information so that sensuctl can determine the correct resource URL to apply them to.
To facilitate things like dump/restore, and editing, we decided to allow dumping wrapped resources as well.
But this lead to confusion, since the resource URLs themselves didn't support wrapping. This inconsistency became a common question about how Sensu's API worked.
For Sensu 7, we're going to wrap all resources when they are returned from APIs, instead of wrapping them client side. All APIs will accept wrapped resources as well.
In Sensu 6, the wrapper could house object metadata like labels and annotations. This metadata was then aliased in the resource itself, creating a confusing scenario for users that necessitated weird hacks internally. In Sensu 7, this aliasing will be removed. Object metadata will only exist in the resources themselves, not the wrapper bearing their type information.
For example, here is a Sensu 6 wrapped resource document.
Why do this? Well internally, the metadata is already represented in the resource, and in fact is rendered in there when the resource isn't wrapped. This makes things really confusing when a user is trying to do an HTTP PATCH on a document or something similar.
~Sensu will be providing tooling to convert the Sensu 6 definitions into Sensu 7 definitions, so that users don't have to manually edit all of their existing configuration.~
Unfortunately Sensu will not be providing tooling for this, or, in fact, existing. :cry:
Sensu 7 will change how so-called "wrapped resources" are portrayed and worked with.
In Sensu 6, users can create resources of any type by wrapping them and handing them to sensuctl. The wrapper includes type information so that sensuctl can determine the correct resource URL to apply them to.
To facilitate things like dump/restore, and editing, we decided to allow dumping wrapped resources as well.
But this lead to confusion, since the resource URLs themselves didn't support wrapping. This inconsistency became a common question about how Sensu's API worked.
For Sensu 7, we're going to wrap all resources when they are returned from APIs, instead of wrapping them client side. All APIs will accept wrapped resources as well.
In Sensu 6, the wrapper could house object metadata like labels and annotations. This metadata was then aliased in the resource itself, creating a confusing scenario for users that necessitated weird hacks internally. In Sensu 7, this aliasing will be removed. Object metadata will only exist in the resources themselves, not the wrapper bearing their type information.
For example, here is a Sensu 6 wrapped resource document.
Here is the same document converted to work with Sensu 7. Note that the metadata is now nested underneath the "spec" object.
Why do this? Well internally, the metadata is already represented in the resource, and in fact is rendered in there when the resource isn't wrapped. This makes things really confusing when a user is trying to do an HTTP PATCH on a document or something similar.
~Sensu will be providing tooling to convert the Sensu 6 definitions into Sensu 7 definitions, so that users don't have to manually edit all of their existing configuration.~
Unfortunately Sensu will not be providing tooling for this, or, in fact, existing. :cry: