Skip to content

feat: add SkipIncompleteLateInitializeCheck #606

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaelhtm
Copy link
Member

Description of changes:
When a field is marked for lateInitialize, the controller tries to
ensure that field is never nil.
If by chance the field is nil, the controller will reconcile every 5
seconds until the field is no longer nil.

Although we want certain fields lateInitialized, we don't expect them to
be nonNil.

In the example of RDS DBInstance, DBInstance contains
PerformanceInsightsKMSID, that we want to lateInitialize only when
PerformanceInsights is Enabled.

For now this change only allows us the incomplete check, but moving
forward, we may want to add certain conditions, to skip or not to
skip...

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

ack-prow bot commented Jul 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot requested review from a-hilaly and jlbutler July 2, 2025 16:53
@ack-prow ack-prow bot added the approved label Jul 2, 2025
Comment on lines 279 to 282
for fieldName, lateInitConfig := range lateInitConfigs {
if lateInitConfig.SkipIncompleteCheck {
continue
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this mean that we only make a single attempt to read the field after initial creation? Is there any mechanism that would allow us to eventually sync this field is the AWS resource hadn't set a skipped field by the first post-create sync?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now we will rely on the resource status (eg. RDS DBInstance) being ready to know whether or not all fields returned from the initial LateInitialize call are finalized or not.

@michaelhtm michaelhtm force-pushed the feat/skiplateinitializeincompletecheck branch from 1783b55 to d80ea4b Compare July 2, 2025 17:59
@a-hilaly
Copy link
Member

a-hilaly commented Jul 2, 2025

Although we want certain fields lateInitialized, we don't expect them to
be nonNil.
In the example of RDS DBInstance, DBInstance contains
PerformanceInsightsKMSID, that we want to lateInitialize only when
PerformanceInsights is Enabled.

But why make an extra ReadOne API call if you could already get the info from the OG ReadOne call?

When a field is marked for lateInitialize, the controller tries to
ensure that field is never nil.
If by chance the field is nil, the controller will reconcile every 5
seconds until the field is no longer nil.

Although we want certain fields lateInitialized, we don't expect them to
be nonNil.

In the example of RDS DBInstance, DBInstance contains
PerformanceInsightsKMSID, that we want to lateInitialize only when
PerformanceInsights is Enabled.

For now this change only allows us the incomplete check, but moving
forward, we may want to add certain conditions, to skip or not to
skip...
@michaelhtm michaelhtm force-pushed the feat/skiplateinitializeincompletecheck branch from d80ea4b to 19b99ae Compare July 2, 2025 20:01
@michaelhtm
Copy link
Member Author

michaelhtm commented Jul 2, 2025

But why make an extra ReadOne API call if you could already get the info from the OG ReadOne call?

I agree. LateInitialize can be improved in the future.

@michaelhtm michaelhtm requested a review from knottnt July 2, 2025 20:11
@knottnt
Copy link
Contributor

knottnt commented Jul 2, 2025

/retest

@michaelhtm
Copy link
Member Author

/retest-required

1 similar comment
@michaelhtm
Copy link
Member Author

/retest-required

@michaelhtm
Copy link
Member Author

/retest

@michaelhtm
Copy link
Member Author

/retest ec2-controller-test

Copy link

ack-prow bot commented Jul 3, 2025

@michaelhtm: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test acm-controller-test
  • /test apigatewayv2-controller-test
  • /test cloudfront-controller-test
  • /test documentdb-controller-test
  • /test dynamodb-controller-test
  • /test ec2-controller-test
  • /test ecr-controller-test
  • /test efs-controller-test
  • /test eks-controller-test
  • /test eventbridge-controller-test
  • /test iam-controller-test
  • /test lambda-controller-test
  • /test pipes-controller-test
  • /test prometheusservice-controller-test
  • /test s3-controller-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test s3-olm-test
  • /test verify-attribution

Use /test all to run all jobs.

In response to this:

/retest ec2-controller-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

ack-prow bot commented Jul 3, 2025

@michaelhtm: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution 19b99ae link false /test verify-attribution
s3-olm-test 19b99ae link false /test s3-olm-test
ec2-controller-test 19b99ae link true /test ec2-controller-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants