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
Bug 1867400: Not allow creation of second storagecluster #7829
Bug 1867400: Not allow creation of second storagecluster #7829
Conversation
@afreen23: An error was encountered adding this pull request to the external tracker bugs for bug 1867400 on the Bugzilla server at https://bugzilla.redhat.com. We were able to detect the following conditions from the error:
Full error message.
JSONRPC error 32000: There was an error reported for the RPC call to Jira: There was an error reported for a GitHub REST call. URL: https://api.github.com/repos/openshift/console/pulls/7829 Error: 403 Forbidden at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 111. at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 111. eval {...} called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 98 Bugzilla::Extension::ExternalBugs::Type::GitHub::_do_rest_call('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x556e2b...', 'https://api.github.com/repos/openshift/console/pulls/7829', 'GET') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 62 Bugzilla::Extension::ExternalBugs::Type::GitHub::get_data('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x556e2b...', 'Bugzilla::Extension::ExternalBugs::Bug=HASH(0x556e2b425128)') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 eval {...} called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 Bugzilla::Extension::ExternalBugs::Bug::update_ext_info('Bugzilla::Extension::ExternalBugs::Bug=HASH(0x556e2b425128)', 1) called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 125 Bugzilla::Extension::ExternalBugs::Bug::create('Bugzilla::Extension::ExternalBugs::Bug', 'HASH(0x556e2b4d8710)') called at /var/www/html/bugzilla/extensions/ExternalBugs/Extension.pm line 940 Bugzilla::Extension::ExternalBugs::bug_start_of_update('Bugzilla::Extension::ExternalBugs=HASH(0x556e2b589598)', 'HASH(0x556e2abda510)') called at /var/www/html/bugzilla/Bugzilla/Hook.pm line 21 Bugzilla::Hook::process('bug_start_of_update', 'HASH(0x556e2abda510)') called at /var/www/html/bugzilla/Bugzilla/Bug.pm line 1173 Bugzilla::Bug::update('Bugzilla::Bug=HASH(0x556e2b583048)') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/WebService.pm line 88 Bugzilla::Extension::ExternalBugs::WebService::add_external_bug('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2ab34480)') called at (eval 2738) line 1 eval ' $procedure->{code}->($self, @params) ;' called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 220 JSON::RPC::Legacy::Server::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2b506738)') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 297 Bugzilla::WebService::Server::JSONRPC::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2b506738)') called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 126 JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 70 Bugzilla::WebService::Server::JSONRPC::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/jsonrpc.cgi line 31 ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_jsonrpc_2ecgi::handler('Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 eval {...} called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x556e2b5781b0)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 173 ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x556e2b5781b0)') called at /usr/lib64/perl5/vendor_perl/ModPerl/Registry.pm line 32 ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at /var/www/html/bugzilla/mod_perl.pl line 139 Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at (eval 2738) line 0 eval {...} called at (eval 2738) line 0 at /var/www/html/bugzilla/Bugzilla/Error.pm line 130. Bugzilla::Error::_throw_error('global/user-error.html.tmpl', 'ext_bz_rest_error', 'HASH(0x556e2b5b7d58)') called at /var/www/html/bugzilla/Bugzilla/Error.pm line 193 Bugzilla::Error::ThrowUserError('ext_bz_rest_error', 'HASH(0x556e2b5b7d58)') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 120 Bugzilla::Extension::ExternalBugs::Type::GitHub::_do_rest_call('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x556e2b...', 'https://api.github.com/repos/openshift/console/pulls/7829', 'GET') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Type/GitHub.pm line 62 Bugzilla::Extension::ExternalBugs::Type::GitHub::get_data('Bugzilla::Extension::ExternalBugs::Type::GitHub=HASH(0x556e2b...', 'Bugzilla::Extension::ExternalBugs::Bug=HASH(0x556e2b425128)') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 eval {...} called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 302 Bugzilla::Extension::ExternalBugs::Bug::update_ext_info('Bugzilla::Extension::ExternalBugs::Bug=HASH(0x556e2b425128)', 1) called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/Bug.pm line 125 Bugzilla::Extension::ExternalBugs::Bug::create('Bugzilla::Extension::ExternalBugs::Bug', 'HASH(0x556e2b4d8710)') called at /var/www/html/bugzilla/extensions/ExternalBugs/Extension.pm line 940 Bugzilla::Extension::ExternalBugs::bug_start_of_update('Bugzilla::Extension::ExternalBugs=HASH(0x556e2b589598)', 'HASH(0x556e2abda510)') called at /var/www/html/bugzilla/Bugzilla/Hook.pm line 21 Bugzilla::Hook::process('bug_start_of_update', 'HASH(0x556e2abda510)') called at /var/www/html/bugzilla/Bugzilla/Bug.pm line 1173 Bugzilla::Bug::update('Bugzilla::Bug=HASH(0x556e2b583048)') called at /loader/0x556e19102468/Bugzilla/Extension/ExternalBugs/WebService.pm line 88 Bugzilla::Extension::ExternalBugs::WebService::add_external_bug('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2ab34480)') called at (eval 2738) line 1 eval ' $procedure->{code}->($self, @params) ;' called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 220 JSON::RPC::Legacy::Server::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2b506738)') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 297 Bugzilla::WebService::Server::JSONRPC::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...', 'HASH(0x556e2b506738)') called at /usr/share/perl5/vendor_perl/JSON/RPC/Legacy/Server.pm line 126 JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm line 70 Bugzilla::WebService::Server::JSONRPC::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::Extension::E...') called at /var/www/html/bugzilla/jsonrpc.cgi line 31 ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_jsonrpc_2ecgi::handler('Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 eval {...} called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 207 ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x556e2b5781b0)') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 173 ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x556e2b5781b0)') called at /usr/lib64/perl5/vendor_perl/ModPerl/Registry.pm line 32 ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at /var/www/html/bugzilla/mod_perl.pl line 139 Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x556e2b1caf48)') called at (eval 2738) line 0 eval {...} called at (eval 2738) line 0
Please contact an administrator to resolve this issue, then request a bug refresh with In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
635e200
to
62ebafa
Compare
/bugzilla refresh |
@spadgett: This pull request references Bugzilla bug 1867400, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
const [csv, csvLoaded, csvError] = useK8sWatchResource<ClusterServiceVersionKind>(csvResource); | ||
const [infra, infraLoaded, infraError] = useK8sGet<any>(InfrastructureModel, 'cluster'); | ||
const [sc, scLoaded, scLoadError] = useK8sGet<ListKind<StorageClusterKind>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use storageCluster
instead of sc
as it matches with storageClass
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, sounds good!
params: { ns, appName }, | ||
} = match; | ||
const { t } = useTranslation(); | ||
const [isOpen, setIsOpen] = React.useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isOpen, setIsOpen] = React.useState(false); | |
const [isOpen, setIsOpen] = React.useState(hasStorageCluster); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed a bit of code now.
This suggestion does not holds now.PTAL again.
@@ -136,6 +144,11 @@ const InstallCluster: React.FC<InstallClusterProps> = ({ match }) => { | |||
{mode === MODES.ATTACHED_DEVICES && ( | |||
<CreateAttachedDevicesCluster match={match} mode={mode} /> | |||
)} | |||
<ExistingClusterModal | |||
match={match} | |||
clusterName={sc?.items?.[0]?.metadata?.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clusterName should be filtered out based on the item which has status != ignored.
Check this:
https://github.com/openshift/console/blob/master/frontend/packages/ceph-storage-plugin/src/features.ts#L116..L119
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to block cluster creation , even if a single item is present.
And this condition is only valid to check when someone fires from CLI a cluster when another cluster is already present. It seems an edge case and i dropped it but no harm in putting a check there !!
62ebafa
to
db62d63
Compare
const clusterName = storageCluster.items.find((sc) => sc.status.phase !== 'Ignored').metadata | ||
.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const clusterName = storageCluster.items.find((sc) => sc.status.phase !== 'Ignored').metadata | |
.name; | |
const clusterName = storageCluster.items.find((sc) => sc.status.phase !== 'Ignored')?.metadata | |
?.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component will be called when at least a cluster is present, hence it will never get to a situation where it can be undefined
params: { ns, appName }, | ||
} = match; | ||
const { t } = useTranslation(); | ||
const [isOpen, setIsOpen] = React.useState(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isOpen, setIsOpen] = React.useState(true); | |
const [isOpen, setOpen] = React.useState(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer full names :)
titleIconVariant="warning" | ||
isOpen={isOpen} | ||
variant="small" | ||
onClose={() => history.goBack()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClose={() => history.goBack()} | |
onClose={() => resourcePathFromModel(ClusterServiceVersionModel, appName, ns)} |
Let's return them back to the OLM page no matter how they reach here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its returning to Opeartor's page when clicked Go to Operator's page.
On cancel, it will just go back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if I come here through a URL link? wouldn't we go back to the last url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, on closing the icon it will go and that's what we need to do. Its on closing the modal.
If you want to go to operator's page then you can click on "Go to operator's page"
Back to OLM page is explicit here. Refer the screenshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
history.goBack()
will refer to the last url, if I am not mistaken, so if I reach here from say the dashboard pages by changing the url. Wouldn't closing it lead me back to dashboard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly my concern. If the user closes it, do we really want to send them to the last URL or to the OLM details page for OCS Operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we want to send them to last url.
If he wants to go to operator page, he will choose operator page
import { StorageClusterKind } from '../../types'; | ||
import { OCSServiceModel } from '../../models'; | ||
|
||
export const ExistingClusterModal: React.FC<ExistingClusterModalProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a default export of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used named because I want the name to be consistent all over.
Do you think we should make it default considering its a single component ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated but as a general rule I prefer to do named exports irrespective of a single file.
It messes with typos and intellisense, automcomplete. If this component want to be reused then anyone can export like ExistingClusterModal from './file'
or existingClusterModal from './file'
onClose={() => history.goBack()} | ||
isFullScreen={false} | ||
actions={[ | ||
<Button key="confirm" variant="primary" onClick={onConfirm}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-label for the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is text in the button so it will be used.
Adding aria-label will be redundant here, since both the text will be remain same. aria-label is good to add where we dont have clue of what button is doing like <button class="burger"></button>
or <button>+</button>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. thanks
<Button key="confirm" variant="primary" onClick={onConfirm}> | ||
{t('ceph-storage-plugin~Back to operator page')} | ||
</Button>, | ||
<Button key="cancel" variant="link" onClick={onCancel}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-label for the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above #7829
db62d63
to
7193e99
Compare
const onConfirm = () => { | ||
setIsOpen(false); | ||
history.push(resourcePathFromModel(ClusterServiceVersionModel, appName, ns)); | ||
}; | ||
|
||
const onCancel = () => { | ||
setIsOpen(false); | ||
history.push(storageClusterPath); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bipuladh here we are setting url to OLM page
/test ceph-storage-plugin |
… mode in a single OCS Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1867400 Signed-off-by: Afreen Rahman <afrahman@redhat.com>
7193e99
to
4e6ee02
Compare
I have removed close button due to the concerns on redirection @bipuladh @cloudbehl @yuvalgalanti . |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, bipuladh 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
@afreen23: All pull requests linked via external trackers have merged: Bugzilla bug 1867400 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1867400