feat(table): Add Keyspace reference for keyspaceName - #71
Closed
gustavodiaz7722 wants to merge 3 commits into
Closed
feat(table): Add Keyspace reference for keyspaceName#71gustavodiaz7722 wants to merge 3 commits into
gustavodiaz7722 wants to merge 3 commits into
Conversation
Picks up code-generator v0.62.1, which adds ACKGenerateVersion and ACKGenerateBuildDate to pkg/version/version.go and a debug-level build details line to cmd/controller/main.go (code-generator #728). This controller had not been regenerated since that release, so the churn is unrelated to any functional change and is separated out to keep the following commit reviewable.
Table.keyspaceName names the Keyspace the table is created in, a Kind this
same controller manages, so a user previously had to hardcode a value that
does not exist until the Keyspace is created.
Path is Spec.KeyspaceName rather than an ARN: the field's pattern
(^[a-zA-Z0-9][a-zA-Z0-9_]{0,47}$) admits no arn: prefix, GetTable echoes the
bare name back, and Keyspace exposes no name in its status. service_name is
omitted because the target is same-service.
Generates keyspaceRef, resolveReferenceForKeyspaceName, and relaxes
keyspaceName out of the CRD required list.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gustavodiaz7722 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…nces # Conflicts: # apis/v1alpha1/ack-generate-metadata.yaml # pkg/version/version.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds cross-resource references to 1 top-level field on
Tableinkeyspaces-controller.Every field here is a top-level spec field (not nested in a struct or list) whose target Kind is confirmed ACK-managed. None needs
set: ignore,late_initialize, orskip_resource_state_validations.Fields Added
generator.yamlpath)pathTable.KeyspaceNameKeyspace(same-service)Spec.KeyspaceNameVerification
Deployed this branch to a dev EKS cluster (
us-west-2) withack-workspace deploy keyspaces --resync-period 60and exercised the references against real AWS resources.This is the lightweight check: the reference resolves and the resource reaches
Synced. It is deliberately not the full pass matrix — no multi-resync delta count and no reference-preservation check — so rows below say nothing about long-run delta behaviour.*RefpresentTable.keyspaceRefSummary: 1 PASS of 1.
Table.keyspaceRef— table created in AWS inside the referenced keyspaceA pre-existing reconcile loop is worth knowing about, though it is not caused by this
change and does not block the reference. The reference itself works:
ACK.ReferencesResolved=True,keyspaceNameabsent from.spec,keyspaceRefpresent, and the table was created in AWSinside the referenced keyspace — a value never supplied literally:
On later reconciles the Table drops to
ACK.ResourceSynced=UnknownwithValidationException: No option is provided to update in the request. The delta driving thatis not on
keyspaceRef— it is on server-defaulted fields the user never set:I confirmed it is pre-existing with a control: a second Table created with a literal
keyspaceNameand no reference at all fails identically. Supplying those five server-defaultedfields explicitly clears the delta and the reference-backed Table reaches
Synced=True, whichis what the
PASSabove reflects. The control Table, left without them, is still looping — sothe two are cleanly separable: the loop belongs to those unconfigured defaults, not to
keyspaceRef. A separatelate_initializefix on those fields would remove the sharp edge.What was checked mechanically
ack-workspace build keyspacesagainst code-generatorv0.62.1.*Refcompanion is emitted on the spec for every field above.resolveReferenceFor<Field>is emitted for every field above, confirmed by diffing the set of resolver names againstmain(regeneration reorders the file, so a naive line diff over-reports).requiredlist are relaxed out of it.service_nameomitted for same-service targets, set for cross-service.go build ./cmd/controllerpasses.go.moddependency, soATTRIBUTION.mdis unchanged.Commit layout
mainnow carries the code-generatorv0.62.1regeneration (from the auto-generated release PR), and this branch is merged up to date with it, so the Files changed diff is limited to the reference change itself plus the recorded ack-generate stamp. The earlier regeneration commit on this branch is therefore redundant with main and contributes nothing to the diff.