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

support namespace in each service #137

Merged
merged 11 commits into from
Apr 24, 2022

Conversation

196Ikuchil
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR allows us to specify namespace on manipulation of Pod and PVC.

In PR #111, we implemented the feature to import from the existing cluster.
But it is only for the default namespace default.
Therefore, we support the different namespace in import/export.

Which issue(s) this PR fixes:

Fixes #116

Special notes for your reviewer:

In PR #127
Since in the WebUI calls the apiserver directly, in this issue, I didn't change that logic. But we must specify a namespace to support this PR's changes. So, I specified a default namespace in Pod and PVC's handler.

/label tide/merge-method-squash
/assign @sanposhiho

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 25, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @196Ikuchil. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 25, 2022
@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Mar 25, 2022
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Looks good overall 👍

export/export.go Outdated Show resolved Hide resolved
Comment on lines 19 to 21
// In PR #137, we require the specification of namespace on pod manipulation.
// But this handler will be deprecate in the future.
// So, this is a temporary solution.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// In PR #137, we require the specification of namespace on pod manipulation.
// But this handler will be deprecate in the future.
// So, this is a temporary solution.
// Handlers support only default namespace.
// The previous web UI had supported only default namespace,
// and we deprecated all handlers to support namespaces in Web UI.

@sanposhiho
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 28, 2022
@sanposhiho
Copy link
Member

/retitle support namespace in each service

@k8s-ci-robot k8s-ci-robot changed the title Namespace specify support namespace in each service Mar 28, 2022
Get(ctx context.Context, name string, namespace string) (*corev1.Pod, error)
List(ctx context.Context, namespace string) (*corev1.PodList, error)
Apply(ctx context.Context, pod *configv1.PodApplyConfiguration, namespace string) (*corev1.Pod, error)
Delete(ctx context.Context, name string, namespace string) error
DeleteCollection(ctx context.Context, lopts metav1.ListOptions) error
Copy link
Member

Choose a reason for hiding this comment

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

DeleteCollection should support namespace as well.

Delete(ctx context.Context, name string) error
Get(ctx context.Context, name string, namespace string) (*corev1.Pod, error)
List(ctx context.Context, namespace string) (*corev1.PodList, error)
Apply(ctx context.Context, pod *configv1.PodApplyConfiguration, namespace string) (*corev1.Pod, error)
Copy link
Member

Choose a reason for hiding this comment

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

Could you swap the order of pod and namespace? (PVC service as well.)

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, @sanposhiho thanks for the reviews!
I implemented those proposals. Please re-review it.

reset/reset.go Outdated
schedService SchedulerService
// deleteNamespacedServices has the all services for each namespaced resource.
// key: service name.
deleteWithNamespaceService map[string]DeleteWithNamespaceService
Copy link
Member

@sanposhiho sanposhiho Apr 2, 2022

Choose a reason for hiding this comment

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

Suggested change
deleteWithNamespaceService map[string]DeleteWithNamespaceService
deleteServicesForNamespacedResources map[string]DeleteWithNamespaceService

Copy link
Member

Choose a reason for hiding this comment

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

Please change interface name as well. DeleteWithNamespaceService sounds like it will delete resource and 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.

That's true. Fixed👌

server/di/di.go Outdated
"storage class": c.storageClassService,
"priority class": c.priorityClassService,
}
deleteWithNamespaceService := map[string]reset.DeleteServicesForNamespacedResources{
Copy link
Member

Choose a reason for hiding this comment

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

Rename to deleteForNamespacedResources

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, thanks!

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Thanks for your huge work 👍

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 196Ikuchil, sanposhiho

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2022
@k8s-ci-robot k8s-ci-robot merged commit e584f17 into kubernetes-sigs:master Apr 24, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

namespace is specified only as default.
3 participants