-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add parser for subscription application #1114
Add parser for subscription application #1114
Conversation
TimothyAsirJeyasing
commented
Dec 1, 2023
•
edited
Loading
edited
- Create a generic dashboard object. (right now it is appset specific)
- Create two parsers one for subscription, and one for ApplicationSet.
- dashboard.tsx will call these two parsers and collect the dashboard objects.
- Aggregate these dashboard object and pass it to the dashboard context
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/acm-action-callback.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/modals/app-manage-policies/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
510f00f
to
a2a16cb
Compare
packages/mco/components/mco-dashboard/data-policy/application-parser/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/application-parser/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/application-parser/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/application-parser/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/application-parser/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/hooks/subscription.ts
Outdated
applicationDeploymentInfo.push({ | ||
application, | ||
subscriptionGroupInfo, | ||
managedClusters: filerManagedClusterUsingDRClusters( |
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.
Every subscription will have a different managed cluster, so the managed cluster should be part of subscriptionGroupInfo.
af9d76c
to
c3fefff
Compare
@@ -108,6 +107,6 @@ export const SnapshotSection: React.FC<CommonProps> = ({ selectedAppSet }) => { | |||
}; | |||
|
|||
type CommonProps = { | |||
selectedAppSet: ProtectedAppSetsMap; | |||
selectedApp: ProtectedAppMap; |
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.
selectedApp: ProtectedAppMap; | |
selectedApplication: ProtectedApplicationMap; |
}; | ||
|
||
type AppWiseCardProps = { | ||
protectedPVCData: ProtectedPVCData[]; | ||
selectedAppSet: ProtectedAppSetsMap; | ||
selectedApp: ProtectedAppMap; |
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.
selectedApp: ProtectedAppMap; | |
selectedApplication: ProtectedApplicationMap; |
packages/mco/components/mco-dashboard/data-policy/cluster-app-card/cluster-app-card.tsx
Outdated
Show resolved
Hide resolved
c3fefff
to
a893e44
Compare
Sure i will rename all app into application, There are few merge conflicts, i will fix on the next patch update |
packages/mco/components/mco-dashboard/data-policy/cluster-app-card/cluster-app-card.tsx
Outdated
Show resolved
Hide resolved
const placementInfo: PlacementInfo = | ||
protectedAppSetsMap?.placementInfo?.[0]; | ||
protectedAppMap?.placementInfo?.[0]; |
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 here, You need to loop through each protectedAppMap?.placementInfo, Fetch syncInterval from each DRPC of the application to find the affected app count. If any one DRPC of application has replication issue then consider the application as affected.
packages/mco/components/mco-dashboard/data-policy/cluster-app-card/common.tsx
Outdated
Show resolved
Hide resolved
@@ -61,7 +61,7 @@ export const StatusText: React.FC<StatusTextProps> = ({ children }) => { | |||
|
|||
export const VolumeSummarySection: React.FC<VolumeSummarySectionProps> = ({ | |||
protectedPVCData, | |||
selectedAppSet, | |||
selectedApp, |
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.
selectedApp, | |
selectedApplication, |
@@ -153,7 +153,7 @@ const ClusterDropdown: React.FC<Partial<ClusterAppDropdownProps>> = ({ | |||
clusterResources, | |||
clusterName, | |||
setCluster, | |||
setAppSet, | |||
setApp, |
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.
setApp, | |
setApplication, |
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
a893e44
to
e00b837
Compare
e00b837
to
7ac903b
Compare
packages/mco/components/mco-dashboard/data-policy/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/applicationset-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
packages/mco/components/mco-dashboard/data-policy/parsers/subscription-parser.tsx
Outdated
Show resolved
Hide resolved
loaded: true, | ||
loadError: '', |
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.
why are u always assuming it to be true
without any error ??
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 are not having the appResource load status, Its already loaded this time and i can make this optional param or Shall i pass !!appResource to the loaded, or Could you please give some light / suggestion ?
appResource received from the callback which invoked by useArgoApplicationSetResourceWatch which uses useK8sWatchResources and that does not return the loaded and loadError state.
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.
For this similar thing it's used like this at line 74 at /home/timothyasir/Project/odf-console/packages/mco/components/modals/app-manage-policies/parsers/application-set-parser.tsx So i used the same way.
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.
appResource received from the callback which invoked by useArgoApplicationSetResourceWatch which uses useK8sWatchResources and that does not return the loaded and loadError state.
>> I don't think that's the reason why we don't have any loading/error state 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.
useK8sWatchResources
always returns loading/error state...
Signed-off-by: Timothy Asir Jeyasingh <[email protected]>
3fbe1d0
to
a19e8df
Compare
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GowthamShanmugam, SanjalKatiyar, TimothyAsirJeyasing 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 |
f7e9a93
into
red-hat-storage:master
/cherry-pick release-4.15 |
@TimothyAsirJeyasing: #1114 failed to apply on top of branch "release-4.15":
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. |
/cherry-pick release-4.15 |
@GowthamShanmugam: new pull request created: #1135 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. |