Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7dd201a
Removed aws from ocs install create form
bipuladh Sep 16, 2019
87ff7ff
Added timestamp to data point labels
bipuladh Sep 16, 2019
ab14e12
Bump kubevirt-web-ui-components to 0.1.43
mareklibra Sep 16, 2019
7de9807
Replaces OLM documentation link
andybraren Sep 17, 2019
102ed58
Fix bug pipeline details page for Pipeline with no tasks throws error
vikram-raj Sep 16, 2019
288d7ad
change PipelineDetails component to FC
vikram-raj Sep 17, 2019
a515e88
Fixed version issue
bipuladh Sep 17, 2019
8363e3e
Bug 1752070: Modify the conditions for health status
Sep 16, 2019
d40158b
Bug 1751178: Added check for specDescriptors before performing any ac…
gnehapk Sep 17, 2019
f250854
Merge pull request #2724 from vikram-raj/fix-odc-1858
openshift-merge-robot Sep 17, 2019
aa7d7d2
Merge pull request #2725 from bipuladh/bug_fix_1749388
openshift-merge-robot Sep 17, 2019
3519f77
Merge pull request #2730 from mareklibra/web-ui-components-0.1.43
openshift-merge-robot Sep 17, 2019
388da3c
Merge pull request #2737 from gnehapk/remove-edit-yaml
openshift-merge-robot Sep 17, 2019
85b70a5
Merge pull request #2726 from bipuladh/timestamp
openshift-merge-robot Sep 17, 2019
884a72f
Merge pull request #2736 from bipuladh/version_patch
openshift-merge-robot Sep 17, 2019
641f705
Add errata link to about dialog and cluster settings page
spadgett Sep 17, 2019
b11db93
fix update strategy modal to be controlled input component
alecmerdler Sep 17, 2019
93da5e5
Merge pull request #2734 from andybraren/fix-olm-doc-link
openshift-merge-robot Sep 17, 2019
9874340
Merge pull request #2747 from alecmerdler/bugzilla-1753018
openshift-merge-robot Sep 17, 2019
110e691
Merge pull request #2745 from spadgett/errata-link
openshift-merge-robot Sep 18, 2019
4d26c64
Bug: Update tooltip Text
Sep 18, 2019
cef08a4
Merge pull request #2750 from a2batic/tooltip-bug
openshift-merge-robot Sep 18, 2019
795f309
Merge pull request #2732 from afreen23/health-card-bugfix
openshift-merge-robot Sep 18, 2019
a9e7ea1
Changed the OCS-installation form explanation.
bipuladh Sep 17, 2019
f074ef1
Merge pull request #2743 from bipuladh/bug_fix_1752829
openshift-merge-robot Sep 18, 2019
6685114
Merge branch 'master' into update-master-4.3
spadgett Sep 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import Spy = jasmine.Spy;

import { ConfigureUpdateStrategy, ConfigureUpdateStrategyProps } from '@console/internal/components/modals/configure-update-strategy-modal';
import { RadioInput } from '@console/internal/components/radio';

describe(ConfigureUpdateStrategy.displayName, () => {
let wrapper: ShallowWrapper<ConfigureUpdateStrategyProps>;
let onChangeStrategyType: Spy;
let onChangeMaxSurge: Spy;
let onChangeMaxUnavailable: Spy;

beforeEach(() => {
onChangeStrategyType = jasmine.createSpy('onChangeStrategyType');
onChangeMaxSurge = jasmine.createSpy('onChangeMaxSurge');
onChangeMaxUnavailable = jasmine.createSpy('onChangeMaxUnavailable');

wrapper = shallow(<ConfigureUpdateStrategy onChangeStrategyType={onChangeStrategyType} onChangeMaxSurge={onChangeMaxSurge} onChangeMaxUnavailable={onChangeMaxUnavailable} strategyType="Recreate" maxSurge={null} maxUnavailable={null} />);
});

it('renders two choices for different update strategy types', () => {
expect(wrapper.find(RadioInput).at(0).props().value).toEqual('RollingUpdate');
expect(wrapper.find(RadioInput).at(1).props().value).toEqual('Recreate');
expect(wrapper.find(RadioInput).at(1).props().checked).toBe(true);
});

it('is a controlled component', () => {
wrapper.find(RadioInput).at(0).dive().find('input[type="radio"]').simulate('change', {target: {value: 'RollingUpdate'}});
wrapper.find('#input-max-unavailable').simulate('change', {target: {value: '25%'}});
wrapper.find('#input-max-surge').simulate('change', {target: {value: '50%'}});

expect(onChangeStrategyType.calls.argsFor(0)[0]).toEqual('RollingUpdate');
expect(onChangeMaxUnavailable.calls.argsFor(0)[0]).toEqual('25%');
expect(onChangeMaxSurge.calls.argsFor(0)[0]).toEqual('50%');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const CapacityCard: React.FC<DashboardItemProps & WithFlagsProps> = ({
const statUsed: React.ReactText = getLastStats(storageUsed, getInstantVectorStats);
const statTotal: React.ReactText = getLastStats(storageTotal, getInstantVectorStats);
const infoText =
'Total capacity reflects the actual raw capacity of the OpenShift Container Storage cluster. Used capacity reflects provisioned capacity which factors capacity being used to store user data and overhead from ensuring redundancy and reliability of the data.';
'Capacity includes the capacity being used to store user data and overhead from ensuring redundancy and reliability of the data.';

return (
<DashboardCard className="ceph-capacity-card__dashboard-card">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
withDashboardResources,
} from '@console/internal/components/dashboards-page/with-dashboard-resources';
import { DetailsBody } from '@console/internal/components/dashboard/details-card/details-body';
import { FirehoseResource } from '@console/internal/components/utils/index';
import { FirehoseResource, FirehoseResult } from '@console/internal/components/utils/index';
import { InfrastructureModel, SubscriptionModel } from '@console/internal/models/index';
import { K8sResourceKind } from '@console/internal/module/k8s/index';
import { getName } from '@console/shared/src/selectors/common';
import { referenceForModel } from '@console/internal/module/k8s/k8s';
import { CephClusterModel } from '../../../models';
import { getOCSVersion } from '../../../selectors';

const infrastructureResource: FirehoseResource = {
kind: referenceForModel(InfrastructureModel),
Expand All @@ -37,8 +38,7 @@ const SubscriptionResource: FirehoseResource = {
kind: referenceForModel(SubscriptionModel),
namespaced: false,
prop: 'subscription',
name: 'ocs-subscription',
isList: false,
isList: true,
};

const DetailsCard: React.FC<DashboardItemProps> = ({
Expand Down Expand Up @@ -67,9 +67,9 @@ const DetailsCard: React.FC<DashboardItemProps> = ({
const cephClusterData = _.get(cephCluster, 'data') as K8sResourceKind[];
const cephClusterName = getName(_.get(cephClusterData, 0));

const subscription = _.get(resources, 'subscription');
const subscription = _.get(resources, 'subscription') as FirehoseResult;
const subscriptionLoaded = _.get(subscription, 'loaded');
const ocsVersion = _.get(subscription, 'data.status.currentCSV');
const ocsVersion = getOCSVersion(subscription);

return (
<DashboardCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const TopConsumersBody: React.FC<TopConsumerBodyProps> = React.memo(
padding={{ top: 20, bottom: 20, left: 40, right: 20 }}
containerComponent={
<ChartVoronoiContainer
labels={(datum) => `${datum.y} ${maxCapacityConverted.unit}`}
labels={(datum) =>
`${datum.y} ${maxCapacityConverted.unit} at ${twentyFourHourTime(datum.x)}`
}
labelComponent={<ChartTooltip style={{ fontSize: 8, padding: 5 }} />}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ export const CreateOCSServiceForm: React.FC<CreateOCSServiceFormProps> = (props)
<div className="form-group co-create-route__name">
<label htmlFor="select-node-help">Select Nodes</label>
<p className="co-m-pane__explanation">
A minimum of 3 nodes needs to be labeled with{' '}
<code>cluster.ocs.openshift.io/openshift-storage=&quot;&quot;</code> in order to create
the OCS Service.
Selected nodes will be labeled with
<code>cluster.ocs.openshift.io/openshift-storage=&quot;&quot;</code> to create the OCS
Service. These nodes will also be tainted with
<code>node.ocs.openshift.io/storage=true:NoSchedule</code> to dedicate these nodes to
allow only OCS components to be scheduled on them. Note: Ensure you have additional
worker nodes that are not tainted to run other workloads in your OpenShift cluster.
</p>
<Alert
className="co-alert"
variant="info"
title="An AWS bucket will be created to provide the OCS Service."
title="A bucket will be created to provide the OCS Service."
isInline
/>
<p className="co-legend co-required ceph-ocs-desc__legend">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export const STORAGE_CLASSES = 'Storage Classes';
export const PODS = 'Pods';
export const BY_USED = 'By Used Capacity';
export const BY_REQUESTED = 'By Requested Capacity';
export const OCS_OPERATOR = 'ocs-operator';
11 changes: 11 additions & 0 deletions frontend/packages/ceph-storage-plugin/src/selectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as _ from 'lodash';
import { Alert } from '@console/internal/components/monitoring';
import { K8sResourceKind } from '@console/internal/module/k8s';
import { FirehoseResult } from '@console/internal/components/utils';
import { OCS_OPERATOR } from '../constants';

const cephStorageProvisioners = ['ceph.rook.io/block', 'cephfs.csi.ceph.com', 'rbd.csi.ceph.com'];
const cephStorageLabel = 'cluster.ocs.openshift.io/openshift-storage';
Expand Down Expand Up @@ -32,3 +34,12 @@ export const getCephSC = (scData: K8sResourceKind[]): K8sResourceKind[] =>
_.get(sc, 'provisioner', '').includes(provisioner),
);
});

export const getOCSVersion = (items: FirehoseResult): string => {
const itemsData: K8sResourceKind[] = _.get(items, 'data');
const operator: K8sResourceKind = _.find(
itemsData,
(item) => _.get(item, 'spec.name') === OCS_OPERATOR,
);
return _.get(operator, 'status.currentCSV');
};
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
import * as React from 'react';
import { SectionHeading, ResourceSummary, ResourceLink } from '@console/internal/components/utils';
import { referenceForModel } from '@console/internal/module/k8s';
import { referenceForModel, K8sResourceKind } from '@console/internal/module/k8s';
import { TaskModel } from '../../models';
import { PipelineVisualization } from './PipelineVisualization';

const PipelineDetails = ({ obj: pipeline }) => (
interface PipelineDetailsProps {
obj: K8sResourceKind;
}

const PipelineDetails: React.FC<PipelineDetailsProps> = ({ obj: pipeline }) => (
<div className="co-m-pane__body">
<SectionHeading text="Pipeline Overview" />
<PipelineVisualization pipeline={pipeline} />
<div className="row">
<div className="col-sm-6">
<ResourceSummary resource={pipeline} />
</div>
<div className="col-sm-6">
<SectionHeading text="Tasks" />
<dl>
{pipeline.spec.tasks.map((task) => {
return (
<React.Fragment key={task.name}>
<dt>Name: {task.name}</dt>
<dd>
Ref:{' '}
<ResourceLink
kind={referenceForModel(TaskModel)}
name={task.taskRef.name}
namespace={pipeline.metadata.namespace}
title={task.taskRef.name}
inline
/>
</dd>
</React.Fragment>
);
})}
</dl>
</div>
{pipeline.spec &&
(pipeline.spec.tasks && (
<div className="col-sm-6">
<SectionHeading text="Tasks" />
<dl>
{pipeline.spec.tasks.map((task) => {
return (
<React.Fragment key={task.name}>
<dt>Name: {task.name}</dt>
<dd>
Ref:{' '}
<ResourceLink
kind={referenceForModel(TaskModel)}
name={task.taskRef.name}
namespace={pipeline.metadata.namespace}
title={task.taskRef.name}
inline
/>
</dd>
</React.Fragment>
);
})}
</dl>
</div>
))}
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/kubevirt-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@console/internal": "0.0.0-fixed",
"@console/plugin-sdk": "0.0.0-fixed",
"@console/shared": "0.0.0-fixed",
"kubevirt-web-ui-components": "~0.1.42"
"kubevirt-web-ui-components": "~0.1.43"
},
"consolePlugin": {
"entry": "src/plugin.tsx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {
DashboardItemProps,
withDashboardResources,
} from '@console/internal/components/dashboards-page/with-dashboard-resources';
import { FirehoseResource, ExternalLink } from '@console/internal/components/utils';
import { FirehoseResource, ExternalLink, FirehoseResult } from '@console/internal/components/utils';
import { InfrastructureModel, SubscriptionModel } from '@console/internal/models/index';
import { referenceForModel, K8sResourceKind } from '@console/internal/module/k8s';
import { getOCSVersion } from '@console/ceph-storage-plugin/src/selectors';
import { getMetric } from '../../utils';

const NOOBAA_SYSTEM_NAME_QUERY = 'NooBaa_system_info';
Expand All @@ -31,8 +32,7 @@ const SubscriptionResource: FirehoseResource = {
kind: referenceForModel(SubscriptionModel),
namespaced: false,
prop: 'subscription',
name: 'ocs-subscription',
isList: false,
isList: true,
};

export const ObjectServiceDetailsCard: React.FC<DashboardItemProps> = ({
Expand Down Expand Up @@ -66,9 +66,9 @@ export const ObjectServiceDetailsCard: React.FC<DashboardItemProps> = ({
const infrastructureData = _.get(infrastructure, 'data') as K8sResourceKind;
const infrastructurePlatform = getInfrastructurePlatform(infrastructureData);

const subscription = _.get(resources, 'subscription');
const subscription = _.get(resources, 'subscription') as FirehoseResult;
const subscriptionLoaded = _.get(subscription, 'loaded');
const ocsVersion = _.get(subscription, 'data.status.currentCSV');
const ocsVersion = getOCSVersion(subscription);

return (
<DashboardCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import { NooBaaSystemModel } from '../../models';

const noobaaSystemResource: FirehoseResource = {
kind: referenceForModel(NooBaaSystemModel),
namespaced: false,
isList: false,
isList: true,
prop: 'noobaa',
};

Expand All @@ -36,11 +35,26 @@ const getObjectStorageHealthState = (
unhealthyBucketsResponse,
poolsResponse,
unhealthyPoolResponse,
noobaaSystemData,
noobaaSystem,
): ObjectStorageHealth => {
const loadError = _.get(noobaaSystem, 'loadError');
const loaded = _.get(noobaaSystem, 'loaded');
const noobaaSystemData = _.get(noobaaSystem, 'data[0]', null) as K8sResourceKind;
const noobaaPhase = _.get(noobaaSystemData, 'status.phase');

const buckets = getGaugeValue(bucketsResponse);
const unhealthyBuckets = getGaugeValue(unhealthyBucketsResponse);
const pools = getGaugeValue(poolsResponse);
const unhealthyPools = getGaugeValue(unhealthyPoolResponse);

const result: ObjectStorageHealth = {
message: 'Object Storage is healthy',
state: HealthState.OK,
};

if (
!(
noobaaSystemData &&
(loaded || loadError) &&
bucketsResponse &&
unhealthyBucketsResponse &&
poolsResponse &&
Expand All @@ -49,17 +63,10 @@ const getObjectStorageHealthState = (
) {
return { state: HealthState.LOADING };
}
const buckets = getGaugeValue(bucketsResponse);
const unhealthyBuckets = getGaugeValue(unhealthyBucketsResponse);
const pools = getGaugeValue(poolsResponse);
const unhealthyPools = getGaugeValue(unhealthyPoolResponse);
const result: ObjectStorageHealth = {
message: 'Object Storage is healthy',
state: HealthState.OK,
};

let value;
if (_.isEmpty(noobaaSystemData)) {
if (loadError || !(buckets && unhealthyBuckets && pools && unhealthyPools)) {
return { message: null };
}
if (!noobaaSystemData || noobaaPhase !== 'Ready') {
result.message = 'Multi cloud gateway is not running';
result.state = HealthState.ERROR;
return result;
Expand All @@ -72,7 +79,7 @@ const getObjectStorageHealthState = (
}
}
if (!_.isNil(buckets) && !_.isNil(unhealthyBuckets)) {
value = Number(unhealthyBuckets) / Number(buckets);
const value = Number(unhealthyBuckets) / Number(buckets);
if (value >= 0.5) {
result.message = 'Many buckets have issues';
result.state = HealthState.ERROR;
Expand Down Expand Up @@ -126,14 +133,14 @@ const HealthCard: React.FC<DashboardItemProps> = ({
'result',
]);

const noobaaSystemData = _.get(resources.noobaa, 'data', null) as K8sResourceKind;
const noobaaSystem = _.get(resources, 'noobaa');

const objectServiceHealthState = getObjectStorageHealthState(
bucketsQueryResult,
unhealthyBucketsQueryResult,
poolsQueryResult,
unhealthyPoolsQueryResult,
noobaaSystemData,
noobaaSystem,
);
const alerts = filterNooBaaAlerts(getAlerts(alertsResults));

Expand All @@ -144,10 +151,14 @@ const HealthCard: React.FC<DashboardItemProps> = ({
</DashboardCardHeader>
<DashboardCardBody isLoading={objectServiceHealthState.state === HealthState.LOADING}>
<HealthBody>
<HealthItem
state={objectServiceHealthState.state}
message={objectServiceHealthState.message}
/>
{objectServiceHealthState.message ? (
<HealthItem
state={objectServiceHealthState.state}
message={objectServiceHealthState.message}
/>
) : (
<span className="text-muted">Unavailable</span>
)}
</HealthBody>
</DashboardCardBody>
{alerts.length > 0 && (
Expand All @@ -171,6 +182,6 @@ const HealthCard: React.FC<DashboardItemProps> = ({
export default withDashboardResources(HealthCard);

type ObjectStorageHealth = {
state: HealthState;
state?: HealthState;
message?: string;
};
Loading