Skip to content

Commit

Permalink
Pass the proper object containing devMode to the function populating …
Browse files Browse the repository at this point in the history
…a new password. cnoe-io#441

Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Nov 8, 2024
1 parent a9c683f commit 6d85851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@ func isBuildCustomizationSpecEqual(s1, s2 v1alpha1.BuildCustomizationSpec) bool
s1.IngressHost == s2.IngressHost &&
s1.Port == s2.Port &&
s1.UsePathRouting == s2.UsePathRouting &&
s1.SelfSignedCert == s2.SelfSignedCert
s1.SelfSignedCert == s2.SelfSignedCert &&
s1.DevMode == s2.DevMode
}
4 changes: 2 additions & 2 deletions pkg/controllers/localbuild/gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func giteaAdminSecretObject() corev1.Secret {
}

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

if err != nil {
if k8serrors.IsNotFound(err) {
giteaCreds, err := newGiteaAdminSecret(resource.Spec.BuildCustomization.DevMode)
giteaCreds, err := newGiteaAdminSecret(r.Config.DevMode)
if err != nil {
return ctrl.Result{}, fmt.Errorf("generating gitea admin secret: %w", err)
}
Expand Down

0 comments on commit 6d85851

Please sign in to comment.