'Update node condition type in status
I am trying to patch, clear Node conditions in OpenShift and/or Kubernetes cluster on a worker node. Patch isn't working, trying even workarounds, maybe update the key in etcd.
Main problem that i created new node conditions and then i removed them but they are not removed from list although they are no longer there or being updated by the controller.
$ oc describe node node1.example.com
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
ExampleToRemove False Wed, 13 Feb 2019 15:09:42 -0500 Wed, 13 Feb 2019 11:05:57 -0500 KubeletHasSufficientDisk kubelet has sufficient disk space available
MemoryPressure False Wed, 13 Feb 2019 15:09:42 -0500 Wed, 13 Feb 2019 11:05:57 -0500 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Wed, 13 Feb 2019 15:09:42 -0500 Wed, 13 Feb 2019 11:05:57 -0500 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Wed, 13 Feb 2019 15:09:42 -0500 Wed, 13 Feb 2019 11:05:57 -0500 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Wed, 13 Feb 2019 15:09:42 -0500
Solution 1:[1]
In the else logic Booking variable is assigned empty object
} else {
this.Booking = <Booking>{};
}
So the Booking variable will always be true; Kindly add a logic to check property inside Booking. something like
<ng-template *ngIf="Booking.PrintBooking">Some content goes here</ng-template>
<h1 *ngIf="!Booking.PrintBooking">Loading</h1>
Also for variable initialisation part you can use
Booking: Booking | {};
Solution 2:[2]
Angular's ng-template tag defines a template that is not rendered by default unless you tell angular to do so. Thats why in your case content inside ng-template is not showing up. So what i did is i instructed angular to show ng-template content by defining an 'else' statement in *ngIf.
<h1 *ngIf="!Booking;else bookingtemplate">Loading</h1>
<p>Print Component</p>
<ng-template #bookingtemplate>
<H1>{{Booking.PrintBooking.Sales_Order.display_value}}</H1>
<h2>{{Booking.PrintBooking.Account.display_value}} - {{Booking.PrintBooking.ContactID.display_value}}</h2>
<div class="card-container" *ngFor="let d of Booking.Dates">
<Button class="card-small" (click)="SelectedDate=(d)">
{{d.publication}} - {{d.pubdate}}
</Button>
</div>
</ng-template>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Prathap Parameswar |
| Solution 2 | Danish Dullu |
