|
|
4cb844 |
#
|
|
|
4cb844 |
# spec file for package kyverno
|
|
|
4cb844 |
#
|
|
Bernhard M. Wiedemann |
514c2a |
# Copyright (c) 2023 SUSE LLC
|
|
|
4cb844 |
#
|
|
|
4cb844 |
# All modifications and additions to the file contributed by third parties
|
|
|
4cb844 |
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
4cb844 |
# upon. The license for this file, and modifications and additions to the
|
|
|
4cb844 |
# file, is the same license as for the pristine package itself (unless the
|
|
|
4cb844 |
# license for the pristine package is not an Open Source License, in which
|
|
|
4cb844 |
# case the license is the MIT License). An "Open Source License" is a
|
|
|
4cb844 |
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
4cb844 |
# published by the Open Source Initiative.
|
|
|
4cb844 |
|
|
|
4cb844 |
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
4cb844 |
#
|
|
|
4cb844 |
|
|
|
e86fcf |
|
|
|
4cb844 |
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
|
|
4cb844 |
|
|
|
4cb844 |
Name: kyverno
|
|
Bernhard M. Wiedemann |
514c2a |
Version: 1.9.0
|
|
|
4cb844 |
Release: 0
|
|
|
4cb844 |
Summary: CLI and kubectl plugin for Kyverno
|
|
|
4cb844 |
License: Apache-2.0
|
|
|
4cb844 |
URL: https://github.com/kyverno/kyverno
|
|
|
4cb844 |
Source: %{name}-%{version}.tar.gz
|
|
|
4cb844 |
Source1: vendor.tar.gz
|
|
|
4cb844 |
BuildRequires: go >= 1.17
|
|
|
4cb844 |
|
|
|
4cb844 |
%description
|
|
|
4cb844 |
Kyverno is a policy engine designed for Kubernetes. It can validate, mutate, and generate configurations using admission controls and background scans. Kyverno policies are Kubernetes resources and do not require learning a new language. Kyverno is designed to work nicely with tools you already use like kubectl, kustomize, and Git.
|
|
|
4cb844 |
|
|
|
4cb844 |
%prep
|
|
|
4cb844 |
%setup -q
|
|
|
4cb844 |
%setup -q -T -D -a 1
|
|
|
4cb844 |
|
|
|
4cb844 |
%build
|
|
|
4cb844 |
DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ"
|
|
|
4cb844 |
BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
|
|
|
4cb844 |
go build \
|
|
|
4cb844 |
-mod=vendor \
|
|
|
4cb844 |
-buildmode=pie \
|
|
|
4cb844 |
-ldflags="-s -w -X github.com/kyverno/kyverno/pkg/version.BuildVersion=%{version} -X github.com/kyverno/kyverno/pkg/version.BuildHash=%{version} -X github.com/kyverno/kyverno/pkg/version.BuildTime=$BUILD_DATE" \
|
|
|
4cb844 |
-o bin/kyverno ./cmd/cli/kubectl-kyverno
|
|
|
4cb844 |
|
|
|
4cb844 |
%install
|
|
|
4cb844 |
# Install the binary.
|
|
|
4cb844 |
install -D -m 0755 bin/%{name} %{buildroot}/%{_bindir}/%{name}
|
|
|
4cb844 |
cd %{buildroot}/%{_bindir}/
|
|
|
4cb844 |
ln -s %{name} kubectl-%{name}
|
|
|
4cb844 |
|
|
|
4cb844 |
%files
|
|
|
4cb844 |
%doc README.md
|
|
|
4cb844 |
%license LICENSE
|
|
|
4cb844 |
%{_bindir}/%{name}
|
|
|
4cb844 |
%{_bindir}/kubectl-%{name}
|
|
|
4cb844 |
|
|
|
4cb844 |
%changelog
|