Skip to content

Uses new apply function so we don't need kubectl #101

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

Merged
merged 3 commits into from
Jul 2, 2020

Conversation

somtochiama
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 26, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @somtochiama. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Jun 26, 2020
@k8s-ci-robot k8s-ci-robot requested review from atoato88 and droot June 26, 2020 16:53
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 26, 2020
@@ -49,7 +56,8 @@ func (console) Run(c *exec.Cmd) error {
}

// Apply runs the kubectl apply with the provided manifest argument
func (c *Client) Apply(ctx context.Context, namespace string, manifest string, validate bool, extraArgs ...string) error {
func (c *Client) ApplyAlt(ctx context.Context, namespace string, manifest string, validate bool,
extraArgs ...string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit we tend not to split these over lines, or if we do we split all the args, one per line

ErrOut: os.Stderr,
}
restClient := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag()
//f := util.NewFactory(restClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: remove this (I think it's just old code)


b := resource.NewBuilder(restClient)
res := b.Unstructured().Stream(ioReader, "cm").Do()
//infos = append(infos, namespaceObj)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: remove if it's old code

}
applyOpts := apply.NewApplyOptions(ioStreams)
applyOpts.Namespace = namespace
buildApplyOpts(applyOpts, infos, ioStreams)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if splitting this function out is worth it vs just inlining it?

@@ -49,7 +56,8 @@ func (console) Run(c *exec.Cmd) error {
}

// Apply runs the kubectl apply with the provided manifest argument
func (c *Client) Apply(ctx context.Context, namespace string, manifest string, validate bool, extraArgs ...string) error {
func (c *Client) ApplyAlt(ctx context.Context, namespace string, manifest string, validate bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think having two types might be clearer here - e.g. one ExecKubectl and one called DirectApply, that both implement the same interface. We can discuss in our GSoC sync :-)

@justinsb
Copy link
Contributor

/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 Jun 29, 2020
@somtochiama somtochiama requested a review from justinsb June 30, 2020 09:05
@justinsb
Copy link
Contributor

justinsb commented Jul 2, 2020

Thanks @somtochiama - looks great and this is a big win in terms of our kubectl dependency!

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, SomtochiAma

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 Jul 2, 2020
@k8s-ci-robot k8s-ci-robot merged commit f7388b7 into kubernetes-sigs:master Jul 2, 2020
@somtochiama somtochiama deleted the cli-utils branch July 3, 2020 15:32
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. 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/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants