Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Documentation & refactoring for custom kubectl from source #251

Merged
merged 3 commits into from
Dec 19, 2018

Conversation

smukherj1
Copy link
Contributor

Addresses #245

Copy link
Contributor

@nlopezgi nlopezgi left a comment

Choose a reason for hiding this comment

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

can you try to do this setup with version 1.10 (i.e., to double check it works as customers want to use that version #245)

If no `kubectl` tool is found, trying to execute `bazel run` for any targets
will not work.
By default, the kubectl sources pulled in is defined [here](defaults.bzl).
However, if you wanted to use release v1.13.1, call `kubectl_configure` as
Copy link
Contributor

Choose a reason for hiding this comment

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

to use e.g., release v1.13.1

_k8s_repo_tools_commit
),
urls = ["https://github.com/{}/{}/archive/{}.tar.gz".format(
_k8s_org,
Copy link
Contributor

Choose a reason for hiding this comment

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

lets enable overriding these values as well

@smukherj1
Copy link
Contributor Author

@nlopezgi Unfortunately, with v1.10.0 I get

E1218 16:38:19.395878       2 main.go:51] Error: Failed making a parser: unable to add directory "./vendor/k8s.io/apimachinery/pkg/util/sets/types": unable to import "./vendor/k8s.io/apimachinery/pkg/util/sets/types": cannot find package "./vendor/k8s.io/apimachinery/pkg/util/sets/types" in:
        /usr/local/google/home/suvanjan/.cache/bazel/_bazel_suvanjan/a1bcb3b63a242c66f0c6010821551247/sandbox/linux-sandbox/31/execroot/io_bazel_rules_k8s/vendor/k8s.io/apimachinery/pkg/util/sets/types

Seems to be because https://github.com/kubernetes/kubernetes/blob/fc32d2f3698e36b93322a3465f63a14e9f0eaead/vendor/k8s.io/apimachinery points to an invalid target?

Verified it works with v1.13.1 though. Addressed other comments. ptal

Copy link
Contributor

@nlopezgi nlopezgi left a comment

Choose a reason for hiding this comment

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

minor doc nit

Note that by default the `k8s_repositories()` calls `kubectl_configure` if it
hasn't already been called. This configures a `kubectl_toolchain` that looks for
the `kubectl` tool in the sytem path. If no `kubectl` tool is found, trying to
execute `bazel run` for any targets will not work.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add note user must find out the right version of repository infrastructure tools that works with the version of kubectl sources they want to use by looking at the io_kubernetes_build target in https://github.com/kubernetes/kubernetes/blob/{k8s_commit}/build/root/WORKSPACE

@smukherj1
Copy link
Contributor Author

@nlopezgi Doc added. ptal

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nlopezgi, smukherj1

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

@smukherj1 smukherj1 merged commit 59b62a9 into bazelbuild:master Dec 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants