Skip to content

Commit

Permalink
Merge pull request #2540 from stmcginnis/cred-prov-ecr-binary
Browse files Browse the repository at this point in the history
packages: add ecr-credential-provider
  • Loading branch information
stmcginnis authored Nov 3, 2022
2 parents e8a5391 + 4afccde commit 66ea600
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/ecr-credential-provider/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "ecr-credential-provider"
version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"

[lib]
path = "pkg.rs"

[package.metadata.build-package]
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.25.1/cloud-provider-aws-1.25.1.tar.gz"
sha512 = "ceb80d66d9dedaebf8955477837652bde81b2bc3949e8efbc9c4b7b9722fe1c2bd2faa151aaa1a162e3c174424e92e2c2bee9f25f8123e74de2ee7eb7881d40e"
bundle-modules = [ "go" ]

[build-dependencies]
glibc = { path = "../glibc" }
9 changes: 9 additions & 0 deletions packages/ecr-credential-provider/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::process::{exit, Command};

fn main() -> Result<(), std::io::Error> {
let ret = Command::new("buildsys").arg("build-package").status()?;
if !ret.success() {
exit(1);
}
Ok(())
}
5 changes: 5 additions & 0 deletions packages/ecr-credential-provider/clarify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[clarify."sigs.k8s.io/yaml"]
expression = "MIT AND BSD-3-Clause"
license-files = [
{ path = "LICENSE", hash = 0xcdf3ae00 },
]
48 changes: 48 additions & 0 deletions packages/ecr-credential-provider/ecr-credential-provider.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
%global goproject github.com/kubernetes
%global gorepo cloud-provider-aws
%global goimport %{goproject}/%{gorepo}

%global gover 1.25.1
%global rpmver %{gover}

%global _dwz_low_mem_die_limit 0

%global gitrev 704b05de2c8633e4acaae62bd81c5575e1e5c1d6
%global shortrev %(c=%{gitrev}; echo ${c:0:7})

Name: %{_cross_os}ecr-credential-provider
Version: %{rpmver}
Release: 1%{?dist}
Summary: Container image registry credential provider for AWS ECR
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

%description
%{summary}.

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

%build
%set_cross_go_flags

go build -buildmode=pie -ldflags="${GOLDFLAGS}" -o=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/ecr-credential-provider

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

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_attribution_vendor_dir}
%{_cross_libexecdir}/kubernetes/kubelet/plugins/ecr-credential-provider
1 change: 1 addition & 0 deletions packages/ecr-credential-provider/pkg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// not used
1 change: 1 addition & 0 deletions packages/kubernetes-1.21/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
ecr-credential-provider = { path = "../ecr-credential-provider" }
# `conntrack-tools`, `containerd` and `findutils` are only needed at runtime,
# and are pulled in by `release`.
# conntrack-tools = { path = "../conntrack-tools" }
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.21/kubernetes-1.21.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Summary: Container cluster node agent
Requires: %{_cross_os}conntrack-tools
Requires: %{_cross_os}containerd
Requires: %{_cross_os}findutils
Requires: %{_cross_os}ecr-credential-provider

%description -n %{_cross_os}kubelet-1.21
%{summary}.
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.22/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
ecr-credential-provider = { path = "../ecr-credential-provider" }
# `conntrack-tools`, `containerd` and `findutils` are only needed at runtime,
# and are pulled in by `release`.
# conntrack-tools = { path = "../conntrack-tools" }
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.22/kubernetes-1.22.spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Summary: Container cluster node agent
Requires: %{_cross_os}conntrack-tools
Requires: %{_cross_os}containerd
Requires: %{_cross_os}findutils
Requires: %{_cross_os}ecr-credential-provider

%description -n %{_cross_os}kubelet-1.22
%{summary}.
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.23/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
ecr-credential-provider = { path = "../ecr-credential-provider" }
# `conntrack-tools`, `containerd` and `findutils` are only needed at runtime,
# and are pulled in by `release`.
# conntrack-tools = { path = "../conntrack-tools" }
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.23/kubernetes-1.23.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Summary: Container cluster node agent
Requires: %{_cross_os}conntrack-tools
Requires: %{_cross_os}containerd
Requires: %{_cross_os}findutils
Requires: %{_cross_os}ecr-credential-provider

%description -n %{_cross_os}kubelet-1.23
%{summary}.
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.24/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
ecr-credential-provider = { path = "../ecr-credential-provider" }
# `conntrack-tools`, `containerd` and `findutils` are only needed at runtime,
# and are pulled in by `release`.
# conntrack-tools = { path = "../conntrack-tools" }
Expand Down
1 change: 1 addition & 0 deletions packages/kubernetes-1.24/kubernetes-1.24.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Summary: Container cluster node agent
Requires: %{_cross_os}conntrack-tools
Requires: %{_cross_os}containerd
Requires: %{_cross_os}findutils
Requires: %{_cross_os}ecr-credential-provider

%description -n %{_cross_os}kubelet-1.24
%{summary}.
Expand Down
11 changes: 11 additions & 0 deletions variants/Cargo.lock

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

0 comments on commit 66ea600

Please sign in to comment.