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

Resource owner now shown in every pane #6237

Closed
wants to merge 2 commits into from

Conversation

marcosdiez
Copy link
Contributor

@marcosdiez marcosdiez commented Jul 7, 2021

image

I am not sure if this is useful anywhere but in a ReplicaSet and in a Job started by a CronJob Also, we have the "problem" of having the info shown twice in Pods.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 7, 2021
@k8s-ci-robot k8s-ci-robot added the language/fr Updates or issues for French translations. label Jul 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marcosdiez
To complete the pull request process, please assign jeefy after the PR has been reviewed.
You can assign the PR to them by writing /assign @jeefy in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added language/ja Updates or issues for Japanese translations. language/ko Updates or issues for Korean translations. language/zh Updates or issues for Chinese translations. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 7, 2021
<div key
i18n>Owner</div>
<div value
*ngFor="let ownerReference of objectMeta?.ownerReferences">
Copy link
Member

Choose a reason for hiding this comment

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

Handling for multiple owner refs is implemented here but I wonder how the view will look like if there will be more than one owner. Can you paste some screenshot?

Copy link
Member

Choose a reason for hiding this comment

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

I'd maybe rely on the controlled by card component that we use i.e. on pod details and try to reuse it for other resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @maciaszczykm,

From my understanding, one can't automatically get two owners, but one can manually set them. This is how you get two of them.

I did it out of curiosity and I got this:
image

But I think @floreks is right. It's better to ditch this and just put the controlled by card everywhere.

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 am thinking again. Do we really need the controller card ? Currently it's just used on the pods page, which has already too much content. Maybe removing it would be better. Just thinking outloud.

Copy link
Member

Choose a reason for hiding this comment

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

I'd still keep it but focus on reorganizing information on the detail pages overall. Use tabs, maybe use some smaller cards that we could put in a single row instead of always using 1 card per row.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@floreks ^^^^

Copy link
Member

@floreks floreks Oct 14, 2021

Choose a reason for hiding this comment

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

Having this kind of generic resource owner information and creating internal links based on name/kind is not a good idea since we do not support every potential resource that might be created this way and it will result in dead/not working links inside the Dashboard.

We should support this explicitly on a per resource basis, similar to what we do for pods.

Copy link
Contributor Author

@marcosdiez marcosdiez Oct 14, 2021

Choose a reason for hiding this comment

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

@floreks you are right. I just added the code. I took the liberty of copying what you did in the "events" pane.

Copy link
Member

Choose a reason for hiding this comment

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

Event list has it's own logic to avoid this kind of situations.

getObjectHref(kind: string, name: string, namespace: string): string {
if (!Object.values(Resource).includes(kind.toLowerCase() as Resource)) {
return '';
}
return this.kdState_.href(kind.toLowerCase(), name, namespace);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@floreks added that code as well. thank you

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2021
@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 27, 2021
@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #6237 (37f5f5d) into master (1cadbf5) will decrease coverage by 1.69%.
The diff coverage is n/a.

❗ Current head 37f5f5d differs from pull request most recent head a8225d6. Consider uploading reports for the commit a8225d6 to get more accurate results

@@            Coverage Diff             @@
##           master    #6237      +/-   ##
==========================================
- Coverage   44.22%   42.53%   -1.70%     
==========================================
  Files          46      217     +171     
  Lines        1282    10627    +9345     
  Branches      179      160      -19     
==========================================
+ Hits          567     4520    +3953     
- Misses        677     5841    +5164     
- Partials       38      266     +228     

@k8s-ci-robot k8s-ci-robot removed the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 27, 2021
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 27, 2021
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 27, 2021
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 30, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 20, 2021
@marcosdiez
Copy link
Contributor Author

@floreks Hi! What's needed for this PR to be merged now?

@marcosdiez
Copy link
Contributor Author

@floreks @maciaszczykm Is there anything I can do for this code to be merged ?

@floreks
Copy link
Member

floreks commented Nov 4, 2021

My original concerns still exist. I'd prefer to have a separate controlled by card that would be added on a per resource basis since there are resources that do not have owner.

Also, we should not display multiple levels of ownership, i.e. pod is controlled by the replica set and replica set is controlled by the deployment. I wouldn't want to see both replica set and deployment (owner of an owner) on the pod details.

We also should not display raw owner information <kind>/<name> (raw string) without any additional information if we do not support such resource in the Dashboard.

@marcosdiez
Copy link
Contributor Author

@floreks I am not sure I understand your concerns:

  • if a resource does not have an owner, the Owner field in Metadata is not shown at all.
  • we do not display multiple levels of ownership unless the metadata contains that. The only object I've ever seen with two owners is the one I manually modified the YAML to see how the UI would behave so I could answer @maciaszczykm 's question. (which is something legal but usually unnecessary per https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/ . So unless you manually modify your pod, you won't see the Deployment, only the replicaset.
  • I personally prefer showing raw owner information <kind>/<name> instead of omitting information. More information is better then omitting information. It's also a nice hint that I should implement another pane :)

Think about it. Even though this is not your dream, the code works, it's helpful, does not consume many resources nor UI space. The kubernetes dashboard is better with it.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2021
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 7, 2021
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 31, 2022
@marcosdiez
Copy link
Contributor Author

Hello @floreks !

I am hoping you changed your mind and now thinks this PR is good to be merged.
An extra card would have to be created per resource and is not as future proof.

Please consider merging this PR as is!

Marcos

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 10, 2022
we only create owner links if we support the object

getObjectHref now verifies if a resource really exists
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 10, 2022
@marcosdiez
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 10, 2022
@marcosdiez
Copy link
Contributor Author

71e611yVKpL AC_SL1300
@maciaszczykm @floreks Happy Birthday to this pull request!

@k8s-ci-robot
Copy link
Contributor

@marcosdiez: PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2022
@floreks
Copy link
Member

floreks commented Sep 23, 2022

Since #7047 has been merged and it introduces major architecture changes we should close this PR. If you are willing to work on it, you can open a new PR against the current master.

/close

@k8s-ci-robot
Copy link
Contributor

@floreks: Closed this PR.

In response to this:

Since #7047 has been merged and it introduces major architecture changes we should close this PR. If you are willing to work on it, you can open a new PR against the current master.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/de Updates or issues for German translations. language/fr Updates or issues for French translations. language/ja Updates or issues for Japanese translations. language/ko Updates or issues for Korean translations. language/zh Updates or issues for Chinese translations. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants