Skip to content

Commit 6d85851

Browse files
committed
Pass the proper object containing devMode to the function populating a new password. cnoe-io#441
Signed-off-by: cmoulliard <[email protected]>
1 parent a9c683f commit 6d85851

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/build/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,6 @@ func isBuildCustomizationSpecEqual(s1, s2 v1alpha1.BuildCustomizationSpec) bool
279279
s1.IngressHost == s2.IngressHost &&
280280
s1.Port == s2.Port &&
281281
s1.UsePathRouting == s2.UsePathRouting &&
282-
s1.SelfSignedCert == s2.SelfSignedCert
282+
s1.SelfSignedCert == s2.SelfSignedCert &&
283+
s1.DevMode == s2.DevMode
283284
}

pkg/controllers/localbuild/gitea.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func giteaAdminSecretObject() corev1.Secret {
5858
}
5959

6060
func newGiteaAdminSecret(devMode bool) (corev1.Secret, error) {
61-
// Reuse the same password when dev mode is enabled
61+
// Use a default password when dev mode is enabled to avoid to recreate a new one each time
6262
pass := giteaDevModePassword
6363
if !devMode {
6464
var err error
@@ -100,7 +100,7 @@ func (r *LocalbuildReconciler) ReconcileGitea(ctx context.Context, req ctrl.Requ
100100

101101
if err != nil {
102102
if k8serrors.IsNotFound(err) {
103-
giteaCreds, err := newGiteaAdminSecret(resource.Spec.BuildCustomization.DevMode)
103+
giteaCreds, err := newGiteaAdminSecret(r.Config.DevMode)
104104
if err != nil {
105105
return ctrl.Result{}, fmt.Errorf("generating gitea admin secret: %w", err)
106106
}

0 commit comments

Comments
 (0)