-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: auto detect repositoryType #384
Conversation
Codecov Report
@@ Coverage Diff @@
## main #384 +/- ##
==========================================
- Coverage 27.30% 27.10% -0.21%
==========================================
Files 37 37
Lines 4509 4546 +37
==========================================
+ Hits 1231 1232 +1
- Misses 3175 3211 +36
Partials 103 103
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
controllers/repository_controller.go
Outdated
@@ -142,7 +142,7 @@ func (r *RepositoryReconciler) checkInitial(ctx context.Context, logger logr.Log | |||
} | |||
|
|||
if v, ok := instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel]; !ok || v != instanceDeepCopy.Spec.RepositoryType { | |||
instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel] = instanceDeepCopy.Spec.RepositoryType | |||
instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel] = string(instanceDeepCopy.GetRepoType(r.Client)) |
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.
currType := string(instanceDeepCopy.GetRepoType(r.Client))
if v := instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel];v != currType {
instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel]
update = true
}
Signed-off-by: zqq454224016 <[email protected]>
What type of PR is this?
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #362
Special notes for your reviewer