-
Notifications
You must be signed in to change notification settings - Fork 666
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
feat: add ibm_event_streams_schema_global_rule #5621
base: master
Are you sure you want to change the base?
Conversation
af9b924
to
0557a7d
Compare
0557a7d
to
684262e
Compare
d3368c0
to
f91740f
Compare
func getSchemaGlobalCompatibilityRuleID(instanceCRN string) string { | ||
crnSegments := strings.Split(instanceCRN, ":") | ||
crnSegments[8] = schemaGlobalCompatibilityRuleResourceType | ||
crnSegments[9] = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are appending empty string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our convention in Event Streams is that the first 8 fields of the CRN identify the service-instance, and the last two identify the resource on the instance. crnSegment[8]
is the type of the resource, and crnSegment[9]
is the identifier for the resource.
The type for the global rule is schema-global-compatibility-rule
. Since the global compatibility rule is global, there is only one instance, so it does not have a unique identifier field. So we set segment 9 to ""
.
Example:
- input instanceCRN is
crn:v1:staging:public:messagehub-vnext-integration:eu-gb:a/6db1b0d0b5c54ee5c201552547febcd8:4088c6f5-6a6b-49e8-a31d-712f09f23058::
- global rule CRN will be
crn:v1:staging:public:messagehub-vnext-integration:eu-gb:a/6db1b0d0b5c54ee5c201552547febcd8:4088c6f5-6a6b-49e8-a31d-712f09f23058:schema-global-compatibility-rule:
In practice, the split segment 9 should already be ""
since it should be coming from a service-instance CRN, in which the last two fields are not set. Setting it to ""
is a precaution in case some other value was provided.
What has been done?
Add a data source and resource for the IBM Event Streams schema-registry global compatibility rule.
The data model used by both data source and resource is:
resource_instance_id
: The CRN of the Event Streams service instance. (Our existing models for topics and schemas also use this to identify the service instance.) Required in data source and resource.config
: The value of the rule. Computed in data source, required in resource.The implementations use the Event Streams SDK client for our schema-registry API.
Community Note
Closes internal Event Streams feature request from BNPP.
Output from acceptance testing: