Skip to content
Snippets Groups Projects

Draft: Fix install job creation

Open Konstantinos Samaras-Tsakiris requested to merge fix-install-job into master
1 unresolved thread

After changing the install job name in !137 (merged) , I noticed that the new install job was being created for already-installed sites. This is dangerous!

  • Added a check on the Initialized condition before ensuring the install job.
  • Fixed the Initialized condition. It used to be set to false even if the operator simply failed to exec into the pod, which is unintended. Instead, it should be Unknown.
Edited by Konstantinos Samaras-Tsakiris

Merge request reports

Merge request pipeline #3294179 failed

Merge request pipeline failed for e04d6e0d

Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 469 460 // isDrupalSiteInstalled checks if the drupal site is initialized by running drush status command in the PHP pod
    470 func (r *DrupalSiteReconciler) isDrupalSiteInstalled(ctx context.Context, d *webservicesv1a1.DrupalSite) bool {
    461 func (r *DrupalSiteReconciler) isDrupalSiteInstalled(ctx context.Context, d *webservicesv1a1.DrupalSite) (bool, reconcileError) {
    471 462 if r.isDrupalSiteReady(ctx, d) {
    472 if _, err := r.execToServerPodErrOnStderr(ctx, d, "php-fpm", nil, checkIfSiteIsInstalled()...); err != nil {
    473 return false
    463 _, stderr, err := r.execToServerPod(ctx, d, "php-fpm", nil, checkIfSiteIsInstalled()...)
    464 // Error running exec => condition unknown
    465 if err != nil {
    466 return false, newApplicationError(err, ErrClientK8s)
    474 467 }
    475 return true
    468 // The script executed and returned this error message
    469 // TODO: check error code instead of message!
    470 if stderr == "Drupal is not installed" {
    471 return false, nil
  • added 1 commit

    • e04d6e0d - Apply 3 suggestion(s) to 1 file(s)

    Compare with previous version

  • The test failure is because it won't create the install job immediately now. The pod isn't running in the test env, therefore the condition is unknown and the install job isn't created.

  • mentioned in merge request !139 (merged)

  • Konstantinos Samaras-Tsakiris marked this merge request as draft

    marked this merge request as draft

  • Please register or sign in to reply
    Loading