Add a kubectl command to delete the HNC configuration of a specific type #606
/assign @adrianludwin
/assign @yiqigao217
cc: @adrianchung
I feel like the more Go-idiomatic way of doing this would be:
newTypes := []api.Whatever{}
found := false
for _, t := range config.Spec.Types {
if t.APIVersion == apiVersion && t.Kind == kind {
found := true
} else {
newTypes = append(newTypes, t)
}
}
if !found { ... error ... }
config.Spec.Types = newTypes
The current way has a "loop" variable that isn't really incremented all the time plus you're modifying a list as you step over it, which I'm pretty sure works fine but always makes me closely re-read it to make sure I'm not missing something important.
Thanks so much for the suggestion and explanation! Changed to more Go-idiomatic way.
/approve
/lgtm
/hold
/assign @rjbez17
I changed the commit and PR message to refer to the correct issue (454 instead of 545).
/lgtm
/approve
@sophieliu15 does this need to merge after #595 ?
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/606#pullrequestreview-388442293" title="LGTM">adrianludwin</a>, <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/606#issuecomment-610024711" title="Approved">rjbez17</a>, <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/606#" title="Author self-approved">sophieliu15</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
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
</details>
<!-- META={"approvers":[]} -->
/lgtm
/approve
> @sophieliu15 does this need to merge after #595 ?
Hi @rjbez17 ! No it doesn't need to be merged after #595. Both are independent.
/hold cancel
adrianludwin
sophieliu15
This PR adds a kubectl command to delete the HNC configuration of a specific type.
Example usage:
kubectl hns config delete-type --apiVersion v1 --kind SecretIssue: #454