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

kubectl defaults seem to be stale/broken #716

Open
skyl opened this issue Oct 25, 2022 · 4 comments
Open

kubectl defaults seem to be stale/broken #716

skyl opened this issue Oct 25, 2022 · 4 comments

Comments

@skyl
Copy link
Contributor

skyl commented Oct 25, 2022

Using the 0.7 release of rules_k8s, attempting

kubectl_configure(
    name = "k8s_config",
    build_srcs = True,
)
WARNING: Download from https://github.com/kubernetes/kubernetes/archive/v1.13.0-beta.1.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was c59a078069e0fa268eb806bd8f8d95e41c4c985422c1a77a53507c756c46a929 but wanted dfb39ce36284c1ce228954ca12bf016c09be61e40a875e8af4fff84e116bd3a7

Full output:

Repository rule http_archive defined at:
  /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
WARNING: Download from https://github.com/kubernetes/kubernetes/archive/v1.13.0-beta.1.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was c59a078069e0fa268eb806bd8f8d95e41c4c985422c1a77a53507c756c46a929 but wanted dfb39ce36284c1ce228954ca12bf016c09be61e40a875e8af4fff84e116bd3a7
ERROR: An error occurred during the fetch of repository 'io_kubernetes':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/bazel_tools/tools/build_defs/repo/http.bzl", line 125, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/kubernetes/kubernetes/archive/v1.13.0-beta.1.tar.gz] to /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/io_kubernetes/temp381103092853336142/v1.13.0-beta.1.tar.gz: Checksum was c59a078069e0fa268eb806bd8f8d95e41c4c985422c1a77a53507c756c46a929 but wanted dfb39ce36284c1ce228954ca12bf016c09be61e40a875e8af4fff84e116bd3a7
ERROR: /WORKSPACE:101:18: fetching http_archive rule //external:io_kubernetes: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/bazel_tools/tools/build_defs/repo/http.bzl", line 125, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/kubernetes/kubernetes/archive/v1.13.0-beta.1.tar.gz] to /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/io_kubernetes/temp381103092853336142/v1.13.0-beta.1.tar.gz: Checksum was c59a078069e0fa268eb806bd8f8d95e41c4c985422c1a77a53507c756c46a929 but wanted dfb39ce36284c1ce228954ca12bf016c09be61e40a875e8af4fff84e116bd3a7
ERROR: /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/k8s_config/BUILD:22:18: @k8s_config//:toolchain depends on @io_kubernetes//cmd/kubectl:kubectl in repository @io_kubernetes which failed to fetch. no such package '@io_kubernetes//cmd/kubectl': java.io.IOException: Error downloading [https://github.com/kubernetes/kubernetes/archive/v1.13.0-beta.1.tar.gz] to /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/io_kubernetes/temp381103092853336142/v1.13.0-beta.1.tar.gz: Checksum was c59a078069e0fa268eb806bd8f8d95e41c4c985422c1a77a53507c756c46a929 but wanted dfb39ce36284c1ce228954ca12bf016c09be61e40a875e8af4fff84e116bd3a7
ERROR: Analysis of target '//:deploy.apply' failed; build aborted: 
INFO: Elapsed time: 7.140s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 39 targets configured)
@skyl
Copy link
Contributor Author

skyl commented Oct 25, 2022

I'm going to try this as 1.25.3 is the latest stable it looks like

kubectl_configure(
    name = "k8s_config",
    build_srcs = True,
    k8s_commit = "v1.25.3",
    # The name of the top level directory in that archive.
    k8s_prefix = "kubernetes-1.25.3",
    # Run wget https://github.com/kubernetes/kubernetes/archive/v1.25.3.tar.gz
    # run sha256sum on the downloaded archive to get the sum here
    k8s_sha256 = "957428759c846ed6a71453ce39b9bd7a91501209c222dcae5d73348b90d68ced",
)

@skyl
Copy link
Contributor Author

skyl commented Oct 25, 2022

Interesting, changing the call to kubectl_configure resulted in:

ERROR: /private/var/tmp/_bazel_skyl/23e9e6ba44989dcf9e3596ada2bdeecb/external/k8s_config/BUILD:22:18: no such package '@io_kubernetes//cmd/kubectl': BUILD file not found in directory 'cmd/kubectl' of external repository @io_kubernetes. Add a BUILD file to a directory to mark it as a package. and referenced by '@k8s_config//:toolchain'

This is with the 0.7 release of rules_k8s.

@skyl
Copy link
Contributor Author

skyl commented Oct 25, 2022

left #717 to update to 1.25.3 in case it saves someone some time; I don't know what the other defaults are though

@loeffel-io
Copy link

Why got #717 merged?

kubectl_configure(
    name = "k8s_config",
    build_srcs = True,
    k8s_commit = "v1.25.3",
    # The name of the top level directory in that archive.
    k8s_prefix = "kubernetes-1.25.3",
    # Run wget https://github.com/kubernetes/kubernetes/archive/v1.25.3.tar.gz
    # run sha256sum on the downloaded archive to get the sum here
    k8s_sha256 = "957428759c846ed6a71453ce39b9bd7a91501209c222dcae5d73348b90d68ced",
)

is not working - i am not sure but i think its not possible to build it from source anyways since they removed bazel: kubernetes/kubernetes#99561

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants