Skip to content
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

packages: add ecr-credential-provider-1.32 and beta0 source for kubernetes-1.32 #317

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"packages/ecr-credential-provider-1.29",
"packages/ecr-credential-provider-1.30",
"packages/ecr-credential-provider-1.31",
"packages/ecr-credential-provider-1.32",
"packages/ecs-agent",
"packages/ecs-gpu-init",
"packages/ethtool",
Expand Down Expand Up @@ -56,6 +57,7 @@ members = [
"packages/kubernetes-1.29",
"packages/kubernetes-1.30",
"packages/kubernetes-1.31",
"packages/kubernetes-1.32",
"packages/libacl",
"packages/libattr",
"packages/libaudit",
Expand Down
2 changes: 2 additions & 0 deletions kits/bottlerocket-core-kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ecr-credential-provider-1_27 = { path = "../../packages/ecr-credential-provider-
ecr-credential-provider-1_29 = { path = "../../packages/ecr-credential-provider-1.29" }
ecr-credential-provider-1_30 = { path = "../../packages/ecr-credential-provider-1.30" }
ecr-credential-provider-1_31 = { path = "../../packages/ecr-credential-provider-1.31" }
ecr-credential-provider-1_32 = { path = "../../packages/ecr-credential-provider-1.32" }
ecr-credential-provider = { path = "../../packages/ecr-credential-provider" }
ecs-agent = { path = "../../packages/ecs-agent" }
ecs-gpu-init = { path = "../../packages/ecs-gpu-init" }
Expand Down Expand Up @@ -66,6 +67,7 @@ kubernetes-1_28 = { path = "../../packages/kubernetes-1.28" }
kubernetes-1_29 = { path = "../../packages/kubernetes-1.29" }
kubernetes-1_30 = { path = "../../packages/kubernetes-1.30" }
kubernetes-1_31 = { path = "../../packages/kubernetes-1.31" }
kubernetes-1_32 = { path = "../../packages/kubernetes-1.32" }
libacl = { path = "../../packages/libacl" }
libattr = { path = "../../packages/libattr" }
libaudit = { path = "../../packages/libaudit" }
Expand Down
24 changes: 24 additions & 0 deletions packages/ecr-credential-provider-1.32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
# "." is not allowed in crate names, but we want a friendlier name for the
# directory and spec file, so we override it below.
name = "ecr-credential-provider-1_32"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
package-name = "ecr-credential-provider-1.32"
releases-url = "https://github.com/kubernetes/cloud-provider-aws/releases"

[[package.metadata.build-package.external-files]]
url = "https://github.com/kubernetes/cloud-provider-aws/archive/v1.32.0.tar.gz"
path = "cloud-provider-aws-1.32.0.tar.gz"
sha512 = "e85b0c4a79f6c087147a5868520693f7cb98a471d5497dcda27a6e341e719868f5308ccf8d9781e601ff1b52f332a0447033a096c929e768553e937e154db25e"
bundle-modules = [ "go" ]

[build-dependencies]
glibc = { path = "../glibc" }
8 changes: 8 additions & 0 deletions packages/ecr-credential-provider-1.32/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x617d80bc },
{ path = "goyaml.v2/LICENSE", hash = 0xe569d630 },
{ path = "goyaml.v2/LICENSE.libyaml", hash = 0xa2e4ce3 },
{ path = "goyaml.v2/NOTICE", hash = 0x49bceeb9 },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
%global goproject github.com/kubernetes
%global gorepo cloud-provider-aws
%global goimport %{goproject}/%{gorepo}

%global gover 1.32.0
%global rpmver %{gover}

%global _dwz_low_mem_die_limit 0

Name: %{_cross_os}ecr-credential-provider-1.32
Version: %{rpmver}
Release: 1%{?dist}
Summary: Amazon ECR credential provider
License: Apache-2.0
URL: https://github.com/kubernetes/cloud-provider-aws

Source: cloud-provider-aws-%{gover}.tar.gz
Source1: bundled-cloud-provider-aws-%{gover}.tar.gz
Source1000: clarify.toml

BuildRequires: %{_cross_os}glibc-devel
Requires: %{name}(binaries)

%description
%{summary}.

%package bin
Summary: Amazon ECR credential provider binaries
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(no-fips) and %{name})
Conflicts: (%{_cross_os}image-feature(fips) or %{name}-fips-bin)

%description bin
%{summary}.

%package fips-bin
Summary: Amazon ECR credential provider binaries, FIPS edition
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(fips) and %{name})
Conflicts: (%{_cross_os}image-feature(no-fips) or %{name}-bin)

%description fips-bin
%{summary}.

%prep
%setup -n %{gorepo}-%{gover} -q
%setup -T -D -n %{gorepo}-%{gover} -b 1 -q

%build
%set_cross_go_flags

export GOTOOLCHAIN=local
export GO_MAJOR="1.23"

go build -ldflags="${GOLDFLAGS}" -o=ecr-credential-provider cmd/ecr-credential-provider/*.go
gofips build -ldflags="${GOLDFLAGS}" -o=fips/ecr-credential-provider cmd/ecr-credential-provider/*.go

%install
install -d %{buildroot}%{_cross_libexecdir}/kubernetes/kubelet/plugins
install -p -m 0755 ecr-credential-provider %{buildroot}%{_cross_libexecdir}/kubernetes/kubelet/plugins

install -d %{buildroot}%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins
install -p -m 0755 fips/ecr-credential-provider %{buildroot}%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins

%cross_scan_attribution --clarify %{S:1000} go-vendor vendor

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_attribution_vendor_dir}

%files bin
%{_cross_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider

%files fips-bin
%{_cross_fips_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider
1 change: 1 addition & 0 deletions packages/kubernetes-1.32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*-EKS-PATCH-*.patch
21 changes: 21 additions & 0 deletions packages/kubernetes-1.32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
# "." is not allowed in crate names, but we want a friendlier name for the
# directory and spec file, so we override it below.
name = "kubernetes-1_32"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
package-name = "kubernetes-1.32"

[[package.metadata.build-package.external-files]]
url = "https://distro.eks.amazonaws.com/kubernetes-1-32/releases/1/artifacts/kubernetes/v1.32.0-beta.0/kubernetes-src.tar.gz"
sha512 = "b63b89d191593890e0c246a88bde3191b10ba47db47f5c522707c1eca44b74fb295ee1b6fe31410621bb2e46fe30898883e83d42c652d676f75f09183f081ecb"

[build-dependencies]
glibc = { path = "../glibc" }
67 changes: 67 additions & 0 deletions packages/kubernetes-1.32/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[clarify."github.com/JeffAshton/win_pdh"]
expression = "BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xb221dcc9 },
]

[clarify."github.com/daviddengcn/go-colortext"]
expression = "BSD-3-Clause AND MIT"
license-files = [
{ path = "LICENSE", hash = 0x9769fae1 },
]

[clarify."github.com/ghodss/yaml"]
expression = "MIT AND BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xcdf3ae00 },
]

[clarify."github.com/heketi/heketi"]
# kubernetes only uses code that is under LGPLv3+/Apache 2.0, not the code that is GPLv2+/LGPLv3+
expression = "LGPL-3.0-or-later OR Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x3c4b96d1 },
{ path = "LICENSE-APACHE2", hash = 0x438c8616 },
{ path = "COPYING-LGPLV3", hash = 0xf0bccb3a },
]
skip-files = [ "COPYING-GPLV2" ]

[clarify."github.com/go-bindata/go-bindata"]
expression = "CC0-1.0"
license-files = [
{ path = "LICENSE", hash = 0x393fafd6 },
]

[clarify."github.com/miekg/dns"]
expression = "BSD-3-Clause"
license-files = [
{ path = "COPYRIGHT", hash = 0xe41dd36c },
{ path = "LICENSE", hash = 0xfc8f12ff },
]

[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0x617d80bc },
{ path = "goyaml.v2/LICENSE", hash = 0xe569d630 },
{ path = "goyaml.v2/LICENSE.libyaml", hash = 0xa2e4ce3 },
{ path = "goyaml.v2/NOTICE", hash = 0x49bceeb9 },
{ path = "goyaml.v3/LICENSE", hash = 0x176b1f44 },
{ path = "goyaml.v3/NOTICE", hash = 0x49bceeb9 },
]

[clarify."honnef.co/go/tools"]
expression = "MIT AND BSD-3-Clause AND Apache-2.0"
license-files = [
{ path = "LICENSE", hash = 0xad378ed2 },
{ path = "LICENSE-THIRD-PARTY", hash = 0x546425eb },
{ path = "lint/LICENSE", hash = 0xc6b58232 },
{ path = "ssa/LICENSE", hash = 0xe656fb62 },
]

[clarify."github.com/storageos/go-api"]
expression = "MIT AND BSD-2-Clause"
license-files = [
{ path = "LICENCE", hash = 0x67a6861e },
]
skip-files = ["licence.go", "types/licence.go"]
42 changes: 42 additions & 0 deletions packages/kubernetes-1.32/credential-provider-config-yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[required-extensions]
aws = { version = "v1", optional = true }
kubernetes = "v1"
std = { version = "v1", helpers = ["default"] }
+++
apiVersion: kubelet.config.k8s.io/v1
kind: CredentialProviderConfig
providers:
{{#if settings.kubernetes.credential-providers}}
{{#each settings.kubernetes.credential-providers}}
{{#if this.enabled}}
- name: {{@key}}
matchImages:
{{#each this.image-patterns}}
- "{{this}}"
{{/each}}
defaultCacheDuration: "{{default "12h" this.cache-duration}}"
apiVersion: credentialprovider.kubelet.k8s.io/v1
{{#if (eq @key "ecr-credential-provider")}}
env:
{{else}}
{{#if this.environment}}
env:
{{/if}}
{{/if}}
{{#if this.environment}}
{{#each this.environment}}
- name: {{@key}}
value: '{{this}}'
{{/each}}
{{/if}}
{{#if (eq @key "ecr-credential-provider")}}
- name: HOME
value: '/root'
{{#if @root.settings.aws.profile}}
- name: AWS_PROFILE
value: '{{@root.settings.aws.profile}}'
{{/if}}
{{/if}}
{{/if}}
{{/each}}
{{/if}}
2 changes: 2 additions & 0 deletions packages/kubernetes-1.32/dockershim-symlink.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
ExecStartPre=/bin/ln -sf ./containerd/containerd.sock /run/dockershim.sock
16 changes: 16 additions & 0 deletions packages/kubernetes-1.32/etc-kubernetes-pki-private.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Kubernetes PKI private directory (/etc/kubernetes/pki/private)
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=selinux-policy-files.service
Wants=selinux-policy-files.service

[Mount]
What=tmpfs
Where=/etc/kubernetes/pki/private
Type=tmpfs
Options=nosuid,nodev,noexec,noatime,context=system_u:object_r:secret_t:s0,mode=0700

[Install]
WantedBy=preconfigured.target
25 changes: 25 additions & 0 deletions packages/kubernetes-1.32/kubelet-bootstrap-kubeconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[required-extensions]
kubernetes = "v1"
+++
---
apiVersion: v1
kind: Config
clusters:
- cluster:
{{#if settings.kubernetes.api-server}}
certificate-authority: "/etc/kubernetes/pki/ca.crt"
server: "{{settings.kubernetes.api-server}}"
{{/if}}
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubelet
name: kubelet
current-context: kubelet
users:
- name: kubelet
{{#if settings.kubernetes.bootstrap-token}}
user:
token: "{{settings.kubernetes.bootstrap-token}}"
{{/if}}
Loading