CronJobSource uses fixed names, rather than GenerateName#1640
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Harwayne 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 |
| ra, err := r.KubeClientSet.AppsV1().Deployments(src.Namespace).Get(expected.Name, metav1.GetOptions{}) | ||
| if apierrors.IsNotFound(err) { | ||
| ra, err = r.KubeClientSet.AppsV1().Deployments(src.Namespace).Create(expected) | ||
| msg := "Deployment created" |
There was a problem hiding this comment.
no need for this msg... just use it in the Eventf call. Or use it in both places
There was a problem hiding this comment.
The reason why I added this is I couldn't find a way to get it to look nice otherwise. Initially I had:
r.Recorder.Eventf(src, corev1.EventTypeNormal, cronJobSourceDeploymentCreated, "Deployment created: error %v", err)Which looked fine when there was an error, but looked bad when there wasn't (Deployment created: error <nil>). I like adding the error keyword, which is why I ended up with the current code. Overall, I want two distinct messages, "Deployment created" and "Deployment created, error: %v". Do you have a suggestion on how to accomplish that?
There was a problem hiding this comment.
sorry, my bad... Misread the code, they are indeed different logs...
|
The following is the coverage report on pkg/.
|
|
/lgtm |
…ve#1640) * Different cron times for branches * Wrap function invocations in quotes * Add instructions Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Co-authored-by: Ali Ok <aliok@redhat.com>
Fixes #1250
Proposed Changes
Release Note