Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show provisioner based storage classes #3473

Merged

Conversation

cloudbehl
Copy link
Contributor

  • OCS install flow will use first provisioner based storage class
  • OCS add capacity lists only provisioner based storage class

Signed-off-by: cloudbehl cloudbehl@gmail.com

@openshift-ci-robot openshift-ci-robot added component/ceph Related to ceph-storage-plugin size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 19, 2019
@cloudbehl
Copy link
Contributor Author

/assign @gnehapk @a2batic

@cloudbehl
Copy link
Contributor Author

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 19, 2019
@cloudbehl
Copy link
Contributor Author

/test images
/test e2e-gcp-console

@@ -1,10 +1,11 @@
import * as React from 'react';
import * as _ from 'lodash';
import { Firehose } from '@console/internal/components/utils';
import { InfrastructureModel } from '@console/internal/models';
import { K8sResourceKind, StorageClassResourceKind, k8sGet } from '@console/internal/module/k8s';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpha imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already alpha. capital K and small k diff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohk

setInfrastructureError(error);
}
};
fetchInfrastructure();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we can directly execute the code instead of defining in separate function and the calling it immediately. Also I don't see that fetchInfrastructure is getting used anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Await needs async function.

if (scLoaded && !infrastructureError && !!infrastructurePlatform) {
// find infra supported provisioner
const provisioner = infraProvisionerMap[_.toLower(infrastructurePlatform)];
scConfig.resources.StorageClass.data = _.filter(scData, (sc) => sc.provisioner === provisioner);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add types for both provisioner and scConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack on provisioner. scConfig type is inherited.

});
makeOCSRequest();
// take the first provisioner based storageclass
const firstSC = _.get(scList, '0');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the 0th index of the list will always be picked up or it will be picked when default storage class is not present

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct if sclist is having the default storage class then we should use it otherwise the index 0.

Copy link
Contributor

@a2batic a2batic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working fine for me

- OCS install flow will use first provisioner based storage class
- OCS add capacity lists only provisioner based storage class

Signed-off-by: cloudbehl <cloudbehl@gmail.com>
// take the first storageclass if default not set
if (!storageClass && storageClass.length > 0) {
storageClass = getName(_.get(scList, '0'));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cloudbehl Also we need to handle the scenario, when no storage class is present. UI should throw error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnehapk I want the backend to throw an error on this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to write logic to throw error messages from UI. What you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

@gnehapk
Copy link
Contributor

gnehapk commented Nov 26, 2019

/test e2e-gcp-console

@gnehapk
Copy link
Contributor

gnehapk commented Nov 26, 2019

/approve

@cloudbehl
Copy link
Contributor Author

/test e2e-gcp-console

@gnehapk
Copy link
Contributor

gnehapk commented Dec 5, 2019

Can you please add bugzilla to this PR?

@cloudbehl
Copy link
Contributor Author

This is 4.4 PR doesn't needs bugzilla right now

@gnehapk
Copy link
Contributor

gnehapk commented Dec 5, 2019

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cloudbehl, gnehapk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 675448b into openshift:master Dec 5, 2019
@spadgett spadgett added this to the v4.4 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/ceph Related to ceph-storage-plugin kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants