-
Notifications
You must be signed in to change notification settings - Fork 231
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 labels and annotations to rollouts api #3832
Conversation
cad96be
to
a4e4300
Compare
a4e4300
to
10990ad
Compare
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.
Awesome, this is looking good. Some minor comments.
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.
Excellent. We can merge this, found a few more things that we need to address.
@@ -276,6 +277,14 @@ func (r *RolloutReconciler) getPackageDiscoveryClient(rolloutNamespacedName type | |||
func (r *RolloutReconciler) reconcileRollout(ctx context.Context, rollout *gitopsv1alpha1.Rollout, strategy *gitopsv1alpha1.ProgressiveRolloutStrategy, packageDiscoveryClient *packagediscovery.PackageDiscovery) error { | |||
logger := klog.FromContext(ctx) | |||
|
|||
if rollout != nil && rollout.Spec.SyncTemplate != nil { | |||
if rollout.Spec.SyncTemplate.Type == gitopsv1alpha1.TemplateTypeRepoSync { | |||
err := fmt.Errorf("reposync is not yet supported") |
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.
just a note for us: we will have to start capturing these as errors as conditions in the status part of the API to surface it to the end users. Today, one has to look at the error logs of the controller :)
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.
Filed #3839
if pkg.Revision != rrs.Spec.Template.Spec.Git.Revision { | ||
if pkg.Revision != rrs.Spec.Template.Spec.Git.Revision || | ||
!reflect.DeepEqual(rollout.Spec.SyncTemplate.RootSync.Metadata, | ||
rrs.Spec.Template.Metadata) { |
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.
Note for us: I can see this logic evolving, so would be good to extract it out as a function and have unit tests around it. Something along the lines of:
func DoesPkgNeedUpdate(rollout, pkg, rrs) (bool) {
}
I can see we are not comparing other bits of the template such as git secret ref
etc. Can you file another issue for tracking this bug. I think this seems more critical to be addressed.
c7b1b04
to
72cd9b8
Compare
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.
Awesome! 🚢
Should resolve #3797.
This PR adds labels and annotations to the rollouts api under
syncTemplate
.For example:
The specified annotations and labels get added to spec of
RemoteRootSync
objects that the rollout creates. TheRemoteRootSync
objects add them to the metadata ofRootSync
objects that they create.