Skip to content

Add supports for non DF storage backends #2155

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vbnrh
Copy link
Member

@vbnrh vbnrh commented Jul 17, 2025

Copy link
Contributor

openshift-ci bot commented Jul 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vbnrh
Once this PR has been reviewed and has the lgtm label, please assign gowthamshanmugam for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@vbnrh
Copy link
Member Author

vbnrh commented Jul 17, 2025

There is some issue with ACM search query and couple of issues with CSS due to patternfly version mismatch.

Trying to fix that ASAP

@vbnrh vbnrh changed the title WIP: Add supports for non DF storage backends Add supports for non DF storage backends Jul 22, 2025
@vbnrh vbnrh force-pushed the dfbugs-6793 branch 4 times, most recently from d2a98b8 to 5ae745e Compare July 23, 2025 11:36
Copy link
Contributor

openshift-ci bot commented Jul 23, 2025

@vbnrh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 1bb4b0d link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

updated.metadata = {
...(current as T).metadata,
...(updated.metadata || {}),
resourceVersion: (current as T).metadata?.resourceVersion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to pass resourceVersion ?? Is it required for k8sUpdate ??

@@ -12640,7 +12640,7 @@ string-length@^4.0.1, string-length@^4.0.2:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0":
Copy link
Collaborator

Choose a reason for hiding this comment

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

yarn.lock file shouldn't get updated without changes to package.json, can u plz revert this back to what's on latest master ??

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tested locally on latest master, I don't see this file getting automatically updated...

@@ -1397,6 +1398,7 @@
"Protection name:": "Protection name:",
"Protection type": "Protection type",
"Protection type:": "Protection type:",
"Provide S3 bucket connection details for each managed cluster. If an s3 bucket is not already configured for cluster, create one and then continue.": "Provide S3 bucket connection details for each managed cluster. If an s3 bucket is not already configured for cluster, create one and then continue.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"Provide S3 bucket connection details for each managed cluster. If an s3 bucket is not already configured for cluster, create one and then continue.": "Provide S3 bucket connection details for each managed cluster. If an s3 bucket is not already configured for cluster, create one and then continue.",
"Provide S3 bucket connection details for each managed cluster. If a S3 bucket is not already configured for cluster, create one and then continue.": "Provide S3 bucket connection details for each managed cluster. If a S3 bucket is not already configured for cluster, create one and then continue.",

Comment on lines +26 to +35
export function fnv1a32(str: string): string {
/* eslint-disable no-bitwise */
let h = 0x811c9dc5;
for (let i = 0; i < str.length; i++) {
h ^= str.charCodeAt(i);
h = (h * 0x01000193) >>> 0;
}
/* eslint-enable no-bitwise */
return h.toString(16).padStart(8, '0');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

use murmurhash-js, we are already using it at other places...
u can also use getRandomChars utils from common...

Suggested change
export function fnv1a32(str: string): string {
/* eslint-disable no-bitwise */
let h = 0x811c9dc5;
for (let i = 0; i < str.length; i++) {
h ^= str.charCodeAt(i);
h = (h * 0x01000193) >>> 0;
}
/* eslint-enable no-bitwise */
return h.toString(16).padStart(8, '0');
}

Comment on lines +55 to +66
const areS3ProfileFieldsEqual = (
a: S3StoreProfile,
b: S3StoreProfile
): boolean => {
return (
a.S3Bucket === b.S3Bucket &&
a.S3Region === b.S3Region &&
a.S3CompatibleEndpoint === b.S3CompatibleEndpoint &&
a.S3SecretRef.Name === b.S3SecretRef.Name &&
(a.S3SecretRef.Namespace || '') === (b.S3SecretRef.Namespace || '')
);
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

use isEqual from lodash-es...

Suggested change
const areS3ProfileFieldsEqual = (
a: S3StoreProfile,
b: S3StoreProfile
): boolean => {
return (
a.S3Bucket === b.S3Bucket &&
a.S3Region === b.S3Region &&
a.S3CompatibleEndpoint === b.S3CompatibleEndpoint &&
a.S3SecretRef.Name === b.S3SecretRef.Name &&
(a.S3SecretRef.Namespace || '') === (b.S3SecretRef.Namespace || '')
);
};

<Alert
variant={AlertVariant.danger}
isInline
title="Error loading storage classes"
Copy link
Collaborator

Choose a reason for hiding this comment

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

externalise...

Comment on lines +108 to +118
if (!loaded) return <Spinner size="md" />;

if (error) {
return (
<Alert
variant={AlertVariant.danger}
isInline
title="Error loading storage classes"
/>
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nits (optional): use StatusBox...

<Alert
className={className}
variant={AlertVariant.warning}
title="Before you use Third-party storage"
Copy link
Collaborator

Choose a reason for hiding this comment

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

externalise...

Comment on lines +23 to +32
actionLinks={
<AlertActionLink
component="a"
href={docHref}
target="_blank"
rel="noopener noreferrer"
>
View documentation
</AlertActionLink>
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have ViewDocumentation and ExternalLink, plz use any one of them...

Comment on lines +34 to +36
Ensure the storage backend supports replication. Carefully validate the
configured replication storage class supports failover, replication, and
recovery and then proceed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

externalise...

const [show2, setShow2] = React.useState(false);

const [errors1, setErrors1] = React.useState<
Partial<Record<keyof S3Details, string>>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Partial<Record<keyof S3Details, string>>
Partial<S3Details>

Wouldn't this be the same?

Partial<Record<keyof S3Details, string>>
>({});
const [errors2, setErrors2] = React.useState<
Partial<Record<keyof S3Details, string>>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Partial<Record<keyof S3Details, string>>
Partial<S3Details>

same?

Partial<Record<keyof S3Details, string>>
>({});

const name1 = selectedClusters[0]?.metadata?.name || 'cluster-1';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const name1 = selectedClusters[0]?.metadata?.name || 'cluster-1';
const name1 = getName(selectedClusters[0]) || 'cluster-1';

>({});

const name1 = selectedClusters[0]?.metadata?.name || 'cluster-1';
const name2 = selectedClusters[1]?.metadata?.name || 'cluster-2';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const name2 = selectedClusters[1]?.metadata?.name || 'cluster-2';
const name2 = getName(selectedClusters[1]) || 'cluster-2';


const validate = (cluster: 1 | 2, details: S3Details) => {
const errs: Partial<Record<keyof S3Details, string>> = {};
if (!details.bucketName.trim()) errs.bucketName = 'Bucket name is required';
Copy link
Contributor

Choose a reason for hiding this comment

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

Translations for all these texts.

const inputPadding = 'pf-v5-u-p-sm pf-v5-u-w-75';

return (
<div className="pf-v5-u-p-md">
Copy link
Contributor

Choose a reason for hiding this comment

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

Either use form here or let the parent where this is used be a form with limitedWidth. forms have limited width prop.

return (
<div className="pf-v5-u-p-md">
<ExpandableSection
toggleText={`S3 bucket for ${name1}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

translate

className={inputPadding}
>
{key === 'secretKey' ? (
<div style={{ display: 'flex', alignItems: 'center' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Flex component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants