Skip to content
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

Spec hash annotation #52

Merged
merged 11 commits into from
Jun 12, 2024
Merged

Spec hash annotation #52

merged 11 commits into from
Jun 12, 2024

Conversation

afugazzotto
Copy link
Contributor

@afugazzotto afugazzotto commented Jun 10, 2024

Fixes #4

Modifications

Created the function makeChildResourceFromRolloutAndUpdateSpecHash to make a new kubernetes.GenericObject based on the given rolloutObj. The function returns the child resource object ready to be created and an operation to be performed with the returned object. The operations are defined by the RolloutChildOperation constants and are: create the child resource, update the child resource, and do nothing. The returned operation will be used after this function is called to perform create/update operations or to skip create/update.

Verification

Used existing unit tests to make sure PipelineRollout did not change expected behavior. Added unit tests to verify new functions correctness.

NOTE

Additional changes to improve reusability of the functions should be made. However, we should make those changes in a different PR to have smaller incremental changes.

@afugazzotto afugazzotto marked this pull request as ready for review June 11, 2024 21:12
@afugazzotto afugazzotto force-pushed the specHashAnnotation branch 2 times, most recently from 4cacbaa to 316e3e3 Compare June 11, 2024 22:26
Signed-off-by: Antonino Fugazzotto <[email protected]>
…oller': prefer a domain-qualified finalizer name to avoid accidental conflicts with other finalizer writers

Signed-off-by: Antonino Fugazzotto <[email protected]>
.gitignore Show resolved Hide resolved
internal/util/util.go Show resolved Hide resolved
Signed-off-by: Antonino Fugazzotto <[email protected]>
Signed-off-by: Antonino Fugazzotto <[email protected]>
@xdevxy xdevxy merged commit c708d3a into main Jun 12, 2024
4 checks passed
@xdevxy xdevxy deleted the specHashAnnotation branch June 12, 2024 21:20
}
} else {
} else if rolloutChildOp == RolloutChildUpdate {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@afugazzotto @xdevxy So, the logic in here only occurs if the spec of the child object has changed, right? I think there's some logic in here related to pausing that we need to do even if that's not the case, isn't there? Such as calling isPipelinePaused()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I also noticed that we need to call processPipelineStatus to update the status correctly. I'm making those change now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should only set the annotation on the Rollout spec until we truly update the object itself.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tend to think so, right? The annotation should represent that which has actually been deployed.

In the pause logic below we're essentially trying to update the spec. If we don't set the annotation until we've actually deployed the object to that spec, then it is okay to use the conditional "if spec is different" to determine whether to execute that logic.

Copy link
Contributor Author

@afugazzotto afugazzotto Jun 12, 2024

Choose a reason for hiding this comment

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

I think this is a valid point. So, it may be best to set the hash annotation only after a successful call to ApplyCRSpec? Would it make sense to set the hash annotation together with the status (ex: in processPipelineStatus)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, it may be best to set the hash annotation only after a successful call to ApplyCRSpec?

yes

Would it make sense to set the hash annotation together with the status (ex: in processPipelineStatus)?

processPipelineStatus() should be called all the time

Copy link
Contributor Author

@afugazzotto afugazzotto Jun 12, 2024

Choose a reason for hiding this comment

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

PR #56

darshansimha pushed a commit to darshansimha/numaplane that referenced this pull request Jun 25, 2024
Signed-off-by: Antonino Fugazzotto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for Pipeline and ISBService changes prior to trying to update them
3 participants