-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add schema syncing implementation #273
Conversation
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.
Nothing blocking
} | ||
|
||
// Delete removes the schema in Redpanda. | ||
func (s *Syncer) Delete(ctx context.Context, o *redpandav1alpha2.Schema) error { |
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.
Will this need to be idempotent (Should it eat not found errors)?
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.
The general pattern I've followed most places is to just return the error from the client and then swallow it if we so desire in the controller by saying, "hey this is a non-retryable 'terminal' error while we're trying to clean up, so just ignore it"
This adds a high-level schema syncing client for CRD --> schema creation. Here's how it roughly works:
Sync
with the CRDSchemaHash
field on the CRD status which is just a non-cryptographic hash of the contents of the schema text string that has previously been synced (since the Redpanda schema creation operations have some normalization of the schema string and may no longer be 1-1 comparable with what's in the CRD)Delete operations simply delete every version of the schema by their subject, and since a CRD deletion should leave things in a clean state, it issues both a soft and then hard delete.
This is the second broken-out piece of #263 with only the controller implementation and acceptance test additions remaining.