Skip to content

Commit

Permalink
Merge pull request ceph#53022 from rhcs-dashboard/upgrade-start-enhan…
Browse files Browse the repository at this point in the history
…cement

mgr/dashboard: support cluster upgrade even if the check for upgrade fails

Reviewed-by: cloudbehl <NOT@FOUND>
Reviewed-by: Nizamudeen A <[email protected]>
  • Loading branch information
avanthakkar authored Aug 17, 2023
2 parents 9640080 + 014421e commit 82e2614
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
spacingClass="mb-3"
*ngIf="showImageField"
i18n>Make sure to put the correct image. Passing an incorrect image can lead the cluster into an undesired state.</cd-alert-panel>
<div class="form-group row">
<div *ngIf="versions"
class="form-group row">
<label class="cd-col-form-label"
[ngClass]="{'required': !showImageField}"
for="availableVersions"
Expand Down Expand Up @@ -42,7 +43,8 @@
</div>
</div>

<div class="form-group row">
<div *ngIf="versions"
class="form-group row">
<div class="cd-col-form-offset">
<div class="custom-control custom-checkbox">
<input type="checkbox"
Expand All @@ -60,7 +62,7 @@

<!-- Custom image name input-->
<div class="form-group row"
*ngIf="showImageField">
*ngIf="showImageField || !versions">
<label class="cd-col-form-label required"
for="customImageName"
i18n>Image</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export class UpgradeStartModalComponent implements OnInit {
useImage: new FormControl(false),
customImageName: new FormControl(null)
});
if (this.versions === undefined) {
const availableVersionsControl = this.upgradeForm.get('availableVersions');
availableVersionsControl.clearValidators();
const customImageNameControl = this.upgradeForm.get('customImageName');
customImageNameControl.setValidators(Validators.required);
customImageNameControl.updateValueAndValidity();
}
}

startUpgrade() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ <h5>
class="text-success"></i>
Cluster is up-to-date
</span>
<a class="link-primary mb-2"
(click)="startUpgradeModal()"
i18n>Upgrade using custom image...</a>
</ng-template>

<ng-template #warningIcon>
Expand Down Expand Up @@ -197,6 +200,9 @@ <h5>
<i [ngClass]="[icons.danger]"></i>
{{ errorMessage }}
</span>
<a class="link-primary mb-2"
(click)="startUpgradeModal()"
i18n>Upgrade using custom image...</a>
</div>
</ng-template>

Expand Down

0 comments on commit 82e2614

Please sign in to comment.