- spec: change hardcoded x86_64 arch to current platform arch;
- spec: bump dependency manager version from 0.5.0 to 0.5.4,
the first golang/dep release to include arm64 (aarch64) bins;
- Dockerfile(s): download arch-specific golang/dep binaries;
- spec: Bump minor RPM version;
Co-authored-by: Jimmy Lafontaine Rivera <lafonj@gmail.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: Ic2d1cf245bb1a2eff6ee508c10a7ccb0d7f135ef
%define COMPONENT custom_metrics
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 0.5.0
%define COMPONENT custom_metrics
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 0.5.0
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
%define go_version 1.12.9
%define go_version 1.12.9
-%define DEP_MAN_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.4
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Name: %{RPM_NAME}
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Name: %{RPM_NAME}
Summary: Containers as a Service Custom Metrics component
License: %{_platform_license} and Apache License
URL: https://github.com/DirectXMan12/k8s-prometheus-adapter
Summary: Containers as a Service Custom Metrics component
License: %{_platform_license} and Apache License
URL: https://github.com/DirectXMan12/k8s-prometheus-adapter
Vendor: %{_platform_vendor} and DirectXMan12/k8s-prometheus-adapter unmodified
Source0: %{name}-%{version}.tar.gz
Vendor: %{_platform_vendor} and DirectXMan12/k8s-prometheus-adapter unmodified
Source0: %{name}-%{version}.tar.gz
%define COMPONENT metrics_server
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 0.3.3
%define COMPONENT metrics_server
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 0.3.3
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
%define go_version 1.12.9
%define go_version 1.12.9
-%define DEP_MAN_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.4
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Name: %{RPM_NAME}
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Name: %{RPM_NAME}
Summary: Containers as a Service Metrics Server component
License: %{_platform_license} and MIT license and BSD and Apache License and GNU LGPLv3
URL: https://github.com/kubernetes-incubator/metrics-server
Summary: Containers as a Service Metrics Server component
License: %{_platform_license} and MIT license and BSD and Apache License and GNU LGPLv3
URL: https://github.com/kubernetes-incubator/metrics-server
Vendor: %{_platform_vendor} and kubernetes-incubator/metrics-server unmodified
Source0: %{name}-%{version}.tar.gz
Vendor: %{_platform_vendor} and kubernetes-incubator/metrics-server unmodified
Source0: %{name}-%{version}.tar.gz
%define COMPONENT prometheus
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 2.11.1
%define COMPONENT prometheus
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 2.11.1
-%define RPM_MINOR_VERSION 1
+%define RPM_MINOR_VERSION 2
%define go_version 1.12.9
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
%define go_version 1.12.9
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Summary: Containers as a Service Prometheus component
License: %{_platform_license} and BSD and Apache License and MIT license and Mozilla Public License and Lesser General Public License and GNU General Public License v2.0 only
URL: https://github.com/prometheus/prometheus
Summary: Containers as a Service Prometheus component
License: %{_platform_license} and BSD and Apache License and MIT license and Mozilla Public License and Lesser General Public License and GNU General Public License v2.0 only
URL: https://github.com/prometheus/prometheus
Vendor: %{_platform_vendor} and prometheus/prometheus unmodified
Source0: %{name}-%{version}.tar.gz
Vendor: %{_platform_vendor} and prometheus/prometheus unmodified
Source0: %{name}-%{version}.tar.gz
&& mkdir -p ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
&& curl -fsSL -k https://github.com/DirectXMan12/k8s-prometheus-adapter/archive/v${CUSTOM_METRICS_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
&& cd ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
&& mkdir -p ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
&& curl -fsSL -k https://github.com/DirectXMan12/k8s-prometheus-adapter/archive/v${CUSTOM_METRICS_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
&& cd ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \
-&& make all \
-&& mv _output/amd64/adapter /adapter \
+&& if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi \
+&& make all ARCH=${HOST_ARCH} \
+&& mv _output/${HOST_ARCH}/adapter /adapter \
&& chmod +x /adapter \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
&& chmod +x /adapter \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
&& curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
&& cd ${go_install_dir}/src/ \
&& ./make.bash \
&& curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
&& cd ${go_install_dir}/src/ \
&& ./make.bash \
-&& curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-amd64 \
+&& if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi \
+&& curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-${HOST_ARCH} \
&& chmod +x /usr/local/bin/dep \
&& mkdir -p ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
&& curl -fsSL -k https://github.com/kubernetes-incubator/metrics-server/archive/v${METRICS_SERVER_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
&& chmod +x /usr/local/bin/dep \
&& mkdir -p ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
&& curl -fsSL -k https://github.com/kubernetes-incubator/metrics-server/archive/v${METRICS_SERVER_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \
&& dep ensure --vendor-only \
# static linking added
&& sed -i "s?LDFLAGS=-w \$(VERSION_LDFLAGS)?LDFLAGS='-extldflags "-static"' -w \$(VERSION_LDFLAGS)?" ./Makefile \
&& dep ensure --vendor-only \
# static linking added
&& sed -i "s?LDFLAGS=-w \$(VERSION_LDFLAGS)?LDFLAGS='-extldflags "-static"' -w \$(VERSION_LDFLAGS)?" ./Makefile \
-&& make \
-&& mv ./_output/amd64/metrics-server /metrics-server \
+&& make ARCH=${HOST_ARCH} \
+&& mv ./_output/${HOST_ARCH}/metrics-server /metrics-server \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
&& rm -rf $go_install_dir \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
&& rm -rf $go_install_dir \