Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

PMM-8182 add kubectl 1.21.1 #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion rhel/SPECS/dbaas-controller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ URL: https://github.com/percona-platform/dbaas-controller
Source0: https://github.com/percona-platform/dbaas-controller/archive/%{commit}/dbaas-controller-%{shortcommit}.tar.gz

%if %{install_golang}
BuildRequires: golang >= 1.14.0
BuildRequires: golang >= 1.16.0
%endif

%description
Expand Down
51 changes: 39 additions & 12 deletions rhel/SPECS/dbaas-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@
%global commit_aws d7c0b2e9131faabb2b09dd804a35ee03822f8447
%global shortcommit_aws %(c=%{commit_aws}; echo ${c:0:7})

%global commit_k8s ec6eb119b81be488b030e849b9e64fda4caaf33c
%global shortcommit_k8s %(c=%{commit_k8s}; echo ${c:0:7})
%global version_k8s v1.16.8
%global commit_k8s_116 ec6eb119b81be488b030e849b9e64fda4caaf33c
%global shortcommit_k8s_116 %(c=%{commit_k8s_116}; echo ${c:0:7})
%global version_k8s_116 v1.16.8

%global commit_k8s_121 5e58841cce77d4bc13713ad2b91fa0d961e69192
%global shortcommit_k8s_121 %(c=%{commit_k8s_121}; echo ${c:0:7})
%global version_k8s_121 v1.21.1

%global install_golang 1

%define build_timestamp %(date -u +"%y%m%d%H%M")
%define release 4
%define release 1
%define rpm_release %{release}.%{build_timestamp}%{?dist}

Name: dbaas-tools
Version: 0.5.1
Version: 0.6.0
Release: %{rpm_release}
Summary: A set of tools for Percona DBaaS
License: ASL 2.0
URL: https://github.com/kubernetes-sigs/aws-iam-authenticator
# Git tag can be moved and pointed to different commit hash which may brake reproducibility of the build
# As by using an exact commit hash, we can ensure that each time source will be identical
Source0: https://github.com/kubernetes-sigs/aws-iam-authenticator/archive/%{commit_aws}/aws-iam-authenticator-%{shortcommit_aws}.tar.gz
Source1: https://github.com/kubernetes/kubernetes/archive/%{commit_k8s}/kubernetes-%{shortcommit_k8s}.tar.gz
Source1: https://github.com/kubernetes/kubernetes/archive/%{commit_k8s_116}/kubernetes-%{shortcommit_k8s_116}.tar.gz
Source2: https://github.com/kubernetes/kubernetes/archive/%{commit_k8s_121}/kubernetes-%{shortcommit_k8s_121}.tar.gz

%if %{install_golang}
BuildRequires: golang >= 1.13.0
Copy link
Member

Choose a reason for hiding this comment

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

Should we bump up the version of go as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's not necessary

Expand All @@ -42,10 +47,15 @@ BuildRequires: which
mkdir -p src/github.com/kubernetes-sigs/
mv aws-iam-authenticator-%{commit_aws} src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws}

%setup -T -c -n kubernetes-%{commit_k8s}
%setup -q -c -a 1 -n kubernetes-%{commit_k8s}
%setup -T -c -n kubernetes-%{commit_k8s_116}
%setup -q -c -a 1 -n kubernetes-%{commit_k8s_116}
mkdir -p src/github.com/kubernetes/
mv kubernetes-%{commit_k8s_116} src/github.com/kubernetes/kubernetes-%{commit_k8s_116}

%setup -T -c -n kubernetes-%{commit_k8s_121}
%setup -q -c -a 2 -n kubernetes-%{commit_k8s_121}
mkdir -p src/github.com/kubernetes/
mv kubernetes-%{commit_k8s} src/github.com/kubernetes/kubernetes-%{commit_k8s}
mv kubernetes-%{commit_k8s_121} src/github.com/kubernetes/kubernetes-%{commit_k8s_121}

%build
cd %{_builddir}/aws-iam-authenticator-%{commit_aws}
Expand All @@ -57,25 +67,42 @@ cd src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws}
sed -i '/dockers:/,+35d' .goreleaser.yaml
make build

cd %{_builddir}/kubernetes-%{commit_k8s}/
# build kubectl 1.16.x
cd %{_builddir}/kubernetes-%{commit_k8s_116}/
export GOPATH="$(pwd)"

cd src/github.com/kubernetes/kubernetes-%{commit_k8s}
cd src/github.com/kubernetes/kubernetes-%{commit_k8s_116}
make WHAT="cmd/kubectl"

# build kubectl 1.21.x
cd %{_builddir}/kubernetes-%{commit_k8s_121}/
export GOPATH="$(pwd)"

cd src/github.com/kubernetes/kubernetes-%{commit_k8s_121}
make WHAT="cmd/kubectl"

%install
cd %{_builddir}/aws-iam-authenticator-%{commit_aws}/src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws}
install -D -p -m 0755 dist/authenticator_linux_amd64/aws-iam-authenticator %{buildroot}/opt/dbaas-tools/bin/aws-iam-authenticator

cd %{_builddir}/kubernetes-%{commit_k8s}/src/github.com/kubernetes/kubernetes-%{commit_k8s}
# install kubectl 1.16.x
cd %{_builddir}/kubernetes-%{commit_k8s_116}/src/github.com/kubernetes/kubernetes-%{commit_k8s_116}
install -D -p -m 0775 _output/local/go/bin/kubectl %{buildroot}/opt/dbaas-tools/bin/kubectl-1.16

# install kubectl 1.21.x
cd %{_builddir}/kubernetes-%{commit_k8s_121}/src/github.com/kubernetes/kubernetes-%{commit_k8s_121}
install -D -p -m 0775 _output/local/go/bin/kubectl %{buildroot}/opt/dbaas-tools/bin/kubectl-1.21


%files
/opt/dbaas-tools/bin/aws-iam-authenticator
/opt/dbaas-tools/bin/kubectl-1.16
/opt/dbaas-tools/bin/kubectl-1.21

%changelog
* Sun May 30 2021 Nurlan Moldomurov <[email protected]> - 0.6.0-1
- Added kubectl 1.21.1

* Thu Aug 27 2020 Illia Pshonkin <[email protected]> - 0.5.1-1
- Initial packaging for dbaas-tools