Compare commits

..

1 Commits

Author SHA1 Message Date
Anthony Lapenna
8eb432b0b0 fix(k8s/volumes): fix an issue with the system volume filter not working 2020-08-31 12:54:22 +12:00
4 changed files with 13 additions and 18 deletions

View File

@@ -130,10 +130,10 @@
</td>
</tr>
<tr ng-if="!$ctrl.dataset">
<td colspan="7" class="text-center text-muted">Loading...</td>
<td colspan="6" class="text-center text-muted">Loading...</td>
</tr>
<tr ng-if="$ctrl.state.filteredDataSet.length === 0">
<td colspan="7" class="text-center text-muted">No pod available.</td>
<td colspan="6" class="text-center text-muted">No pod available.</td>
</tr>
</tbody>
</table>

View File

@@ -33,7 +33,7 @@ class KubernetesVolumesDatatableController {
}
isDisplayed(item) {
return !this.isSystemNamespace(item) || this.showSystem;
return !this.isSystemNamespace(item) || this.settings.showSystem;
}
isExternalVolume(item) {
@@ -48,6 +48,7 @@ class KubernetesVolumesDatatableController {
this.setDefaults();
this.prepareTableFromDataset();
this.isAdmin = this.Authentication.isAdmin();
this.settings.showSystem = false;
this.state.orderBy = this.orderBy;
var storedOrder = this.DatatableService.getDataTableOrder(this.tableKey);
@@ -76,8 +77,6 @@ class KubernetesVolumesDatatableController {
this.settings.open = false;
}
this.onSettingsRepeaterChange();
this.settings.showSystem = false;
}
$onInit() {

View File

@@ -3,14 +3,14 @@ import { KubernetesPortMapping, KubernetesPortMappingPort } from 'Kubernetes/mod
import { KubernetesServiceTypes } from 'Kubernetes/models/service/models';
import { KubernetesConfigurationTypes } from 'Kubernetes/models/configuration/models';
import {
KubernetesApplicationAutoScalerFormValue,
KubernetesApplicationConfigurationFormValue,
KubernetesApplicationConfigurationFormValueOverridenKey,
KubernetesApplicationConfigurationFormValueOverridenKeyTypes,
KubernetesApplicationEnvironmentVariableFormValue,
KubernetesApplicationConfigurationFormValue,
KubernetesApplicationConfigurationFormValueOverridenKey,
KubernetesApplicationPersistedFolderFormValue,
KubernetesApplicationPlacementFormValue,
KubernetesApplicationPublishedPortFormValue,
KubernetesApplicationAutoScalerFormValue,
KubernetesApplicationPlacementFormValue,
} from 'Kubernetes/models/application/formValues';
import {
KubernetesApplicationEnvConfigMapPayload,
@@ -23,13 +23,13 @@ import {
KubernetesApplicationVolumeSecretPayload,
} from 'Kubernetes/models/application/payloads';
import KubernetesVolumeHelper from 'Kubernetes/helpers/volumeHelper';
import { KubernetesApplicationDeploymentTypes, KubernetesApplicationPlacementTypes } from 'Kubernetes/models/application/models';
import { KubernetesPodAffinity, KubernetesPodNodeAffinityNodeSelectorRequirementOperators } from 'Kubernetes/pod/models';
import { KubernetesApplicationPlacementTypes, KubernetesApplicationDeploymentTypes } from 'Kubernetes/models/application/models';
import { KubernetesPodNodeAffinityNodeSelectorRequirementOperators, KubernetesPodAffinity } from 'Kubernetes/pod/models';
import {
KubernetesNodeSelectorRequirementPayload,
KubernetesNodeSelectorTermPayload,
KubernetesPodNodeAffinityPayload,
KubernetesPreferredSchedulingTermPayload,
KubernetesPodNodeAffinityPayload,
KubernetesNodeSelectorRequirementPayload,
} from 'Kubernetes/pod/payloads/affinities';
class KubernetesApplicationHelper {
@@ -65,7 +65,7 @@ class KubernetesApplicationHelper {
}
static associateContainersAndApplication(app) {
if (!app.Pods || app.Pods.length === 0) {
if (!app.Pods) {
return [];
}
const containers = app.Pods[0].Containers;

View File

@@ -40,10 +40,6 @@ function computeTolerations(nodes, application) {
// Some operators require empty "values" field, some only one element in "values" field, etc
function computeAffinities(nodes, application) {
if (!application.Pods || application.Pods.length === 0) {
return nodes;
}
const pod = application.Pods[0];
_.forEach(nodes, (n) => {
if (pod.NodeSelector) {