Skip to content

sdk/action: implement kube delete#61

Merged
hasbro17 merged 1 commit intooperator-framework:masterfrom
hasbro17:haseeb/add-kube-delete
Feb 26, 2018
Merged

sdk/action: implement kube delete#61
hasbro17 merged 1 commit intooperator-framework:masterfrom
hasbro17:haseeb/add-kube-delete

Conversation

@hasbro17
Copy link
Copy Markdown
Contributor

@hasbro17 hasbro17 commented Feb 26, 2018

Part [2/2] of #57
/cc @hongchaodeng @fanminshi

@fanminshi fanminshi mentioned this pull request Feb 26, 2018
21 tasks
Comment thread pkg/sdk/action/action.go
}

// KubeDelete deletes an object
// KubeDelete deletes an object if it still exists
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if it still exists -> if exists?
seems more concise

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree but I'm pretty sure the latter statement is grammatically incorrect. So probably have to keep it as it is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

on a second thought, i think you are right.

Comment thread pkg/sdk/action/action.go
apiVersion, kind := gvk.ToAPIVersionAndKind()
objectInfo := objectInfoString(kind, name, namespace)

resourceClient, _, err := k8sclient.GetResourceClient(apiVersion, kind, namespace)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just curious if GetResourceClient caches resource client based on type? if not , maybe we can cache client based on type in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes the dynamic ClientPool implementation already does that.
https://github.com/kubernetes/client-go/blob/master/dynamic/client_pool.go#L93-L104

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice!

@fanminshi
Copy link
Copy Markdown
Contributor

lgtm after a small suggestion and some question.

@hasbro17 hasbro17 merged commit 3e995a9 into operator-framework:master Feb 26, 2018
@hasbro17 hasbro17 deleted the haseeb/add-kube-delete branch February 26, 2018 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants