-
Notifications
You must be signed in to change notification settings - Fork 143
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
support namespace in each service #137
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
df3d89f
to
9a4a6df
Compare
36332bb
to
70c7bfd
Compare
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.
Looks good overall 👍
server/handler/pod.go
Outdated
// 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. |
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.
// 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. |
/ok-to-test |
/retitle support namespace in each service |
server/di/interface.go
Outdated
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 |
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.
DeleteCollection
should support namespace as well.
server/di/interface.go
Outdated
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) |
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.
Could you swap the order of pod
and namespace
? (PVC service as well.)
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.
Hi, @sanposhiho thanks for the reviews!
I implemented those proposals. Please re-review it.
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
reset/reset.go
Outdated
schedService SchedulerService | ||
// deleteNamespacedServices has the all services for each namespaced resource. | ||
// key: service name. | ||
deleteWithNamespaceService map[string]DeleteWithNamespaceService |
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.
deleteWithNamespaceService map[string]DeleteWithNamespaceService | |
deleteServicesForNamespacedResources map[string]DeleteWithNamespaceService |
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.
Please change interface name as well. DeleteWithNamespaceService sounds like it will delete resource and namespace.
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.
That's true. Fixed👌
server/di/di.go
Outdated
"storage class": c.storageClassService, | ||
"priority class": c.priorityClassService, | ||
} | ||
deleteWithNamespaceService := map[string]reset.DeleteServicesForNamespacedResources{ |
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.
Rename to deleteForNamespacedResources
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.
oops, thanks!
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.
Thanks for your huge work 👍
/lgtm
/approve
[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 |
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
andPVC
.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
andPVC
's handler./label tide/merge-method-squash
/assign @sanposhiho