Compare commits
46 Commits
v3.2.0-alp
...
release-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12af25f3f7 | ||
|
|
5c1f73134a | ||
|
|
20cb04aedf | ||
|
|
e029adfb84 | ||
|
|
7a8712bda1 | ||
|
|
f1a99bd1d8 | ||
|
|
a8b93b9abf | ||
|
|
0efb3c671f | ||
|
|
a8b79e85b6 | ||
|
|
579d45465a | ||
|
|
fab6336e91 | ||
|
|
18527f895e | ||
|
|
8ab489c51b | ||
|
|
5a855a8306 | ||
|
|
d865305983 | ||
|
|
64a4b65d66 | ||
|
|
d341e55b8b | ||
|
|
8657cd31b2 | ||
|
|
20163dd795 | ||
|
|
3a50e1c244 | ||
|
|
738a451433 | ||
|
|
744233b3a3 | ||
|
|
dae7d92dab | ||
|
|
2eeb7262c6 | ||
|
|
840a3d25f8 | ||
|
|
9720aa9806 | ||
|
|
0e3159e1e8 | ||
|
|
edcd8e1449 | ||
|
|
98b9009a58 | ||
|
|
e82236366d | ||
|
|
776593001e | ||
|
|
6dc99e181e | ||
|
|
735f0c7731 | ||
|
|
2af76aff79 | ||
|
|
7a0dafd59d | ||
|
|
813c341574 | ||
|
|
59e03a0c19 | ||
|
|
2d066f86d4 | ||
|
|
b94c7966d1 | ||
|
|
6b3af2d19d | ||
|
|
d8fc168948 | ||
|
|
1641b9920b | ||
|
|
1956f83af0 | ||
|
|
22a8bebcae | ||
|
|
d0ae0f210f | ||
|
|
8ef0605858 |
6
.github/workflows/build-multiarch.yaml
vendored
6
.github/workflows/build-multiarch.yaml
vendored
@@ -24,13 +24,13 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Set up QEMU"
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: "Set up Docker buildx"
|
||||
uses: "docker/setup-buildx-action@v1"
|
||||
- name: Set up Docker buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and push docker images
|
||||
env:
|
||||
|
||||
8
.github/workflows/nightly-builds.yml
vendored
8
.github/workflows/nightly-builds.yml
vendored
@@ -26,6 +26,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Set up Docker buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and push docker images
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
|
||||
@@ -171,6 +171,6 @@ The [user case studies](https://kubesphere.io/case/) page includes the user list
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"/> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200"/>
|
||||
<br/><br/>
|
||||
KubeSphere is a member of CNCF and a <a href="https://www.cncf.io/certification/software-conformance/#logos">Kubernetes Conformance Certified platform
|
||||
</a>, which enriches the <a href="https://landscape.cncf.io/landscape=observability-and-analysis&license=apache-license-2-0">CNCF CLOUD NATIVE Landscape.
|
||||
</a>, which enriches the <a href="https://landscape.cncf.io/?landscape=observability-and-analysis&license=apache-license-2-0">CNCF CLOUD NATIVE Landscape.
|
||||
</a>
|
||||
</p>
|
||||
|
||||
171
README_zh.md
171
README_zh.md
@@ -1,10 +1,20 @@
|
||||
# KubeSphere 容器平台
|
||||
<p align="center">
|
||||
<img src="docs/images/kubesphere-logo.png" alt="banner" width="200px">
|
||||
</p>
|
||||
|
||||
[](https://github.com/KubeSphere/KubeSphere/blob/master/LICENSE)
|
||||
[](https://travis-ci.org/kubesphere/kubesphere)
|
||||
[](https://github.com/kubesphere/kubesphere/releases/tag/v3.1.0)
|
||||
<p align="center">
|
||||
<b>为<i> Kubernetes 多云、数据中心和边缘 </i>管理而定制的容器平台</b>
|
||||
</p>
|
||||
|
||||
<p align=center>
|
||||
<a href="https://goreportcard.com/report/github.com/kubesphere/kubesphere"><img src="https://goreportcard.com/badge/github.com/kubesphere/kubesphere" alt="A+"></a>
|
||||
<a href="https://hub.docker.com/r/kubesphere/ks-installer"><img src="https://img.shields.io/docker/pulls/kubesphere/ks-installer"></a>
|
||||
<a href="https://github.com/search?q=user%3Akubesphere+user%3Akubesphere-sigs+label%3A%22good+first+issue%22+state%3Aopen&type=Issues&ref=advsearch&l=&l="><img src="https://img.shields.io/github/issues/badges/shields/good%20first%20issue" alt="good first"></a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=KubeSphere"><img src="https://img.shields.io/twitter/follow/KubeSphere?style=social" alt="follow on Twitter"></a>
|
||||
<a href="https://join.slack.com/t/kubesphere/shared_invite/enQtNTE3MDIxNzUxNzQ0LTZkNTdkYWNiYTVkMTM5ZThhODY1MjAyZmVlYWEwZmQ3ODQ1NmM1MGVkNWEzZTRhNzk0MzM5MmY4NDc3ZWVhMjE"><img src="https://img.shields.io/badge/Slack-600%2B-blueviolet?logo=slack&logoColor=white"></a>
|
||||
<a href="https://www.youtube.com/channel/UCyTdUQUYjf7XLjxECx63Hpw"><img src="https://img.shields.io/youtube/channel/subscribers/UCyTdUQUYjf7XLjxECx63Hpw?style=social"></a>
|
||||
</p>
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
@@ -12,9 +22,9 @@
|
||||
|
||||
> [English](README.md) | 中文
|
||||
|
||||
[KubeSphere](https://kubesphere.com.cn) 是在 [Kubernetes](https://kubernetes.io) 之上构建的面向云原生应用的 **容器混合云**,支持多云与多集群管理,提供全栈的 IT 自动化运维的能力,简化企业的 DevOps 工作流。KubeSphere 提供了运维友好的向导式操作界面,帮助企业快速构建一个强大和功能丰富的容器云平台。KubeSphere 愿景是打造一个基于 Kubernetes 的云原生分布式操作系统,它的架构可以很方便地与云原生生态进行即插即用(plug-and-play)的集成。
|
||||
[KubeSphere](https://kubesphere.io/zh/) 愿景是打造一个以 [Kubernetes](https://kubernetes.io/zh/) 为内核的 **云原生分布式操作系统**,它的架构可以非常方便地使第三方应用与云原生生态组件进行即插即用(plug-and-play)的集成,支持云原生应用在多云与多集群的统一分发和运维管理。 KubeSphere 也是一个多租户容器平台,提供全栈的 IT 自动化运维的能力,简化企业的 DevOps 工作流。KubeSphere 提供了运维友好的向导式操作界面,帮助企业快速构建一个强大和功能丰富的容器云平台,详情请参阅 [平台功能](#平台功能) 。
|
||||
|
||||
KubeSphere 目前最新的版本为 3.1.0,所有版本 100% 开源,关于 KubeSphere 更详细的介绍与说明请参阅 [什么是 KubeSphere](https://kubesphere.com.cn/docs/introduction/what-is-kubesphere/)。
|
||||
下面的屏幕截图让我们进一步了解 KubeSphere,关于 KubeSphere 更详细的介绍与说明请参阅 [什么是 KubeSphere](https://kubesphere.io/zh/docs/introduction/what-is-kubesphere/) 。
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -35,89 +45,134 @@ KubeSphere 目前最新的版本为 3.1.0,所有版本 100% 开源,关于 Ku
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 快速体验
|
||||
## Demo 环境
|
||||
|
||||
使用体验账号 `demo1 / Demo123` 登录 [Demo 环境](https://demo.kubesphere.io/),该账号仅授予了 view 权限,建议自行安装体验完整的管理功能。您还可以访问 Youtube 查看 [KubeSphere Demo 视频](https://youtu.be/u5lQvhi_Xlc)。
|
||||
🎮 使用账号 `demo1 / Demo123` 登录 [Demo 环境](https://demo.kubesphere.io/) 。请注意,该帐户仅授予了 view 权限。
|
||||
|
||||
## 架构
|
||||
🖥 您还可以快速查看[Demo 视频](https://youtu.be/YxZ1YUv0CYs) 。
|
||||
|
||||
KubeSphere 采用了前后端分离的架构设计,后端的各个功能组件可通过 REST API 对接外部系统,详见 [架构说明](https://kubesphere.com.cn/docs/introduction/architecture/)。本仓库仅包含后端代码,前端代码参考 [Console 项目](https://github.com/kubesphere/console)。
|
||||
## 平台功能
|
||||
|
||||
<details>
|
||||
<summary><b>🕸 部署 Kubernetes 集群</b></summary>
|
||||
支持在任何基础设施上部署 Kubernetes,支持在线安装和离线安装,<a href="https://kubesphere.io/zh/docs/installing-on-linux/introduction/intro/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🔗 Kubernetes 多集群管理</b></summary>
|
||||
提供集中控制平台来管理多个 Kubernetes 集群,支持将应用程序发布到跨不同云供应商的多个k8集群上。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🤖 Kubernetes DevOps</b></summary>
|
||||
提供开箱即用的基于 Jenkins 的 CI/CD,并内置自动化流水线插件,包括Binary-to-Image (B2I) 和Source-to-Image (S2I),<a href="https://kubesphere.io/zh/devops/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🔎 云原生可观测性</b></summary>
|
||||
支持多维度监控、事件和审计日志;内置多租户日志查询和收集,告警和通知,<a href="https://kubesphere.io/zh/observability/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🧩 基于 Istio 的微服务治理</b></summary>
|
||||
为分布式微服务应用程序提供细粒度的流量管理、可观测性和服务跟踪,支持可视化的流量拓扑,<a href="https://kubesphere.io/zh/service-mesh/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>💻 应用商店</b></summary>
|
||||
为基于 Helm 的应用程序提供应用商店,并在 Kubernetes 平台上提供应用程序生命周期管理功能,<a href="https://kubesphere.io/zh/docs/pluggable-components/app-store/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>💡 Kubernetes 边缘节点管理</b></summary>
|
||||
基于 <a href="https://kubeedge.io/zh/">KubeEdge</a> 实现应用与工作负载在云端与边缘节点的统一分发与管理,解决在海量边、端设备上完成应用交付、运维、管控的需求,<a href= "https://kubesphere.io/zh/docs/pluggable-components/kubeedge/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>📊 多维度计量与计费</b></summary>
|
||||
提供基于集群与租户的多维度资源计量与计费的监控报表,让 Kubernetes 运营成本更透明,<a href="https://kubesphere.io/zh/docs/toolbox/metering-and-billing/view-resource-consumption/">了解更多</a> 。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🗃 支持多种存储和网络解决方案</b></summary>
|
||||
<li>支持 GlusterFS、CephRBD、NFS、LocalPV ,并提供多个 CSI 插件对接公有云与企业级存储。</li><li>提供Kubernetes在裸机、边缘和虚拟化中的负载均衡器实现 <a href="https://github.com/kubesphere/openelb">OpenELB</a> 。</li><li>提供网络策略和容器组 IP 池管理,支持 Calico、Flannel、Kube-OVN。</li>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>🏘 多租户</b></summary>
|
||||
提供统一的认证鉴权与细粒度的基于角色的授权系统,支持对接 AD/LDAP 。
|
||||
</details>
|
||||
|
||||
## 架构说明
|
||||
|
||||
KubeSphere 使用前后端分离的架构,将 [前端](https://github.com/kubesphere/console) 与 [后端](https://github.com/kubesphere/kubesphere) 分开。后端的各个功能组件可通过 REST API 对接外部系统。
|
||||
|
||||

|
||||
|
||||
## 核心功能
|
||||
|
||||
|功能 |介绍 |
|
||||
| --- | ---|
|
||||
|多云与多集群管理|提供多云与多集群的中央管理面板,支持集群导入,支持应用在多云与多集群一键分发|
|
||||
| Kubernetes 集群搭建与运维 | 支持在线 & 离线安装、升级与扩容 K8s 集群,支持安装 “云原生全家桶” |
|
||||
| Kubernetes 资源可视化管理 | 可视化纳管原生 Kubernetes 资源,支持向导式创建与管理 K8s 资源 |
|
||||
| 基于 Jenkins 的 DevOps 系统 | 支持图形化与脚本两种方式构建 CI/CD 流水线,内置 Source to Image(S2I)和 Binary to Image(B2I)等 CD 工具 |
|
||||
| 应用商店与应用生命周期管理 | 提供应用商店,内置 Redis、MySQL 等 15 个常用应用,支持应用的生命周期管理 |
|
||||
| 基于 Istio 的微服务治理 (Service Mesh) | 提供可视化无代码侵入的 **灰度发布、熔断、流量治理与流量拓扑、分布式 Tracing** |
|
||||
| 多租户管理 | 提供基于角色的细粒度多租户统一认证,支持 **对接企业 LDAP/AD**,提供多层级的权限管理 |
|
||||
| 丰富的可观察性功能 | 提供集群/工作负载/Pod/容器等多维度的监控,提供基于多租户的日志查询与日志收集,支持节点与应用层级的告警与通知 |
|
||||
|基础设施管理|支持 Kubernetes 节点管理,支持节点扩容与集群升级,提供基于节点的多项监控指标与告警规则 |
|
||||
| 存储管理 | 支持对接 Ceph、GlusterFS、NFS、Local PV,支持可视化运维管理 PVC、StorageClass,提供 CSI 插件对接云平台存储 |
|
||||
| 网络管理 | 提供租户网络隔离与 K8s [Network Policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) 管理,支持 Calico、Flannel,提供 [Porter LB](https://github.com/kubesphere/porter) 用于暴露物理环境 K8s 集群的 LoadBalancer 服务 |
|
||||
| GPU support | 集群支持添加 GPU 与 vGPU,可运行 TensorFlow 等 ML 框架 |
|
||||
|
||||
以上功能说明详见 [产品功能](https://kubesphere.com.cn/docs/introduction/features/)。
|
||||
|
||||
----
|
||||
|
||||
## 最新发布
|
||||
## 最新版本
|
||||
|
||||
KubeSphere 3.1.0 已于 2021 年 4 月 29 日正式 GA!点击 [Release Notes For 3.1.0](https://kubesphere.com.cn/docs/release/release-v310/) 查看 3.1.0 版本的更新详情。
|
||||
🎉 KubeSphere 3.1.1 全新发布!相关更新信息,请参阅 [Release Notes For 3.1.1](https://kubesphere.io/zh/docs/release/release-v311/) 。
|
||||
|
||||
## 安装 3.1.0
|
||||
## 安装
|
||||
|
||||
KubeSphere 支持在任意平台运行,从本地数据中心到混合多云再走向边缘。此外,KubeSphere 可以部署在任何版本兼容的 Kubernetes 集群上。
|
||||
|
||||
### 快速入门
|
||||
|
||||
[快速入门系列](https://kubesphere.com.cn/docs/quick-start/) 提供了快速安装与入门示例,供初次安装体验参考。
|
||||
1. 运行以下命令以在现有 Kubernetes 集群上安装 KubeSphere:
|
||||
|
||||
### 在已有 Kubernetes 之上安装 KubeSphere
|
||||
```yaml
|
||||
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/kubesphere-installer.yaml
|
||||
|
||||
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/cluster-configuration.yaml
|
||||
```
|
||||
|
||||
- [基于 Kubernetes 的安装介绍](https://kubesphere.com.cn/docs/installing-on-kubernetes/introduction/overview/)
|
||||
- [在阿里云 ACK 安装 KubeSphere](https://kubesphere.com.cn/forum/d/1745-kubesphere-v3-0-0-dev-on-ack)
|
||||
- [在腾讯云 TKE 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-ks-on-tencent-tke/)
|
||||
- [在华为云 CCE 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-huaweicloud-cce/)
|
||||
- [在 AWS EKS 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-eks/)
|
||||
- [在 Google GKE 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-gke/)
|
||||
- [在 Azure AKS 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-aks/)
|
||||
- [在 DigitalOcean 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-do/)
|
||||
- [在 Oracle OKE 安装 KubeSphere](https://kubesphere.com.cn/docs/installing-on-kubernetes/hosted-kubernetes/install-kubesphere-on-oke/)
|
||||
2. 您可以运行以下命令查看安装日志。 KubeSphere 安装成功后,您可以使用`http://IP:30880` 以默认账号和密码(admin/P@88w0rd)访问KubeSphere 控制台。
|
||||
|
||||
### 基于 Linux 安装 KubeSphere
|
||||
```yaml
|
||||
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
|
||||
```
|
||||
|
||||
- [多节点安装介绍(以三节点为例)](https://kubesphere.com.cn/docs/installing-on-linux/introduction/multioverview/)
|
||||
- [在 VMware vSphere 安装高可用集群](https://kubesphere.com.cn/docs/installing-on-linux/on-premises/install-kubesphere-on-vmware-vsphere/)
|
||||
- [在青云QingCloud 安装高可用集群](https://kubesphere.com.cn/docs/installing-on-linux/public-cloud/install-kubesphere-on-qingcloud-vms/)
|
||||
- [在阿里云 ECS 部署高可用集群](https://kubesphere.com.cn/docs/installing-on-linux/public-cloud/install-kubesphere-on-ali-ecs/)
|
||||
> 👨💻 没有 Kubernetes 集群? 可以尝试在 Linux 上以[All-in-one](https://kubesphere.io/zh/docs/quick-start/all-in-one-on-linux/) 模式来安装单节点 Kubernetes 和 KubeSphere。
|
||||
|
||||
- [在华为云 VM 部署高可用集群](https://kubesphere.com.cn/docs/installing-on-linux/public-cloud/install-kubesphere-on-huaweicloud-ecs/)
|
||||
- [在 Azure VM 安装高可用集群](https://kubesphere.com.cn/docs/installing-on-linux/public-cloud/install-kubesphere-on-azure-vms/)
|
||||
### 在托管 Kubernetes 上部署 KubeSphere
|
||||
|
||||
## 技术社区
|
||||
KubeSphere 托管在以下云供应商上,您可以通过在其托管的 Kubernetes 服务上一键安装来部署 KubeSphere。
|
||||
|
||||
[KubeSphere 社区](https://github.com/kubesphere/community) 包含所有社区的信息,包括如何开发,兴趣小组(SIG)等。比如[开发指南](https://github.com/kubesphere/community/tree/master/developer-guide/development) 详细说明了如何从源码编译、KubeSphere 的 GitHub 工作流、如何贡献代码以及如何测试等。
|
||||
- [在 Amazon EKS 上部署 KubeSphere](https://aws.amazon.com/quickstart/architecture/qingcloud-kubesphere/)
|
||||
- [在 Azure AKS 上部署 KubeSphere](https://market.azure.cn/marketplace/apps/qingcloud.kubesphere)
|
||||
- [在 DigitalOcean 上部署 KubeSphere](https://marketplace.digitalocean.com/apps/kubesphere)
|
||||
- [在青云QingCloud QKE 上部署 KubeSphere](https://www.qingcloud.com/products/kubesphereqke)
|
||||
|
||||
您还可以在几分钟内在其他托管的 Kubernetes 服务上安装 KubeSphere,请参阅 [官方文档](https://kubesphere.io/zh/docs/installing-on-kubernetes/) 以开始使用。
|
||||
|
||||
> 👨💻 不能访问网络?参考 [在Kubernetes上离线安装](https://kubesphere.io/zh/docs/installing-on-kubernetes/on-prem-kubernetes/install-ks-on-linux-airgapped/) 或者 [在 Linux 上离线安装](https://kubesphere.io/zh/docs/installing-on-linux/introduction/air-gapped-installation/) 了解如何使用私有仓库来安装 KubeSphere。
|
||||
|
||||
## 贡献、支持、讨论和社区
|
||||
|
||||
我们 :heart: 您的贡献。[社区](https://github.com/kubesphere/community) 将引导您了解如何开始贡献 KubeSphere。[开发指南](https://github.com/kubesphere/community/tree/master/developer-guide/development) 说明了如何安装开发环境。
|
||||
|
||||
- [中文论坛](https://kubesphere.com.cn/forum/)
|
||||
- [Slack Channel](https://join.slack.com/t/kubesphere/shared_invite/enQtNTE3MDIxNzUxNzQ0LTZkNTdkYWNiYTVkMTM5ZThhODY1MjAyZmVlYWEwZmQ3ODQ1NmM1MGVkNWEzZTRhNzk0MzM5MmY4NDc3ZWVhMjE)
|
||||
- [社区微信群(见官网底部)](https://kubesphere.com.cn/)
|
||||
- [Bug 与建议反馈(GitHub Issue)](https://github.com/kubesphere/kubesphere/issues)
|
||||
- [Slack Channel](https://join.slack.com/t/kubesphere/shared_invite/enQtNTE3MDIxNzUxNzQ0LTZkNTdkYWNiYTVkMTM5ZThhODY1MjAyZmVlYWEwZmQ3ODQ1NmM1MGVkNWEzZTRhNzk0MzM5MmY4NDc3ZWVhMjE)
|
||||
- [Youtube](https://www.youtube.com/channel/UCyTdUQUYjf7XLjxECx63Hpw)
|
||||
- [在推特上关注我们](https://twitter.com/KubeSphere)
|
||||
|
||||
请将任何 KubeSphere 错误、问题和功能请求提交到 [KubeSphere GitHub Issue](https://github.com/kubesphere/kubesphere/issues) 。
|
||||
|
||||
## 谁在使用 KubeSphere
|
||||
|
||||
[Powered by KubeSphere](https://kubesphere.com.cn/case/) 列出了哪些企业在使用 KubeSphere,如果您所在的企业已安装使用了 KubeSphere,欢迎[提交 PR](https://github.com/kubesphere/kubesphere/blob/master/docs/powered-by-kubesphere.md)。
|
||||
[用户案例学习](https://kubesphere.com.cn/case/) 列出了哪些企业在使用 KubeSphere。欢迎 [发表评论](https://github.com/kubesphere/kubesphere/issues/4123) 来分享您的使用案例。
|
||||
|
||||
## Landscapes
|
||||
|
||||
<p align="center">
|
||||
<br/><br/>
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"/> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200"/> <img src="https://www.cncf.io/wp-content/uploads/2017/11/certified_kubernetes_color.png" height="40" width="30"/>
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"/> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200"/>
|
||||
<br/><br/>
|
||||
KubeSphere 是 CNCF 基金会成员并且通过了 <a href="https://www.cncf.io/certification/software-conformance/#logos">Kubernetes 一致性认证
|
||||
</a>,进一步丰富了 <a href="https://landscape.cncf.io/landscape=observability-and-analysis&license=apache-license-2-0">CNCF 云原生的生态。
|
||||
</a>,进一步丰富了 <a href="https://landscape.cncf.io/?landscape=observability-and-analysis&license=apache-license-2-0">CNCF 云原生的生态。
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -315,12 +315,11 @@ func run(s *options.KubeSphereControllerManagerOptions, ctx context.Context) err
|
||||
klog.Fatalf("Unable to create ResourceQuota controller: %v", err)
|
||||
}
|
||||
|
||||
helmReconciler := helm.Reconciler{}
|
||||
if !s.GatewayOptions.IsEmpty() {
|
||||
helmReconciler.WatchFiles = append(helmReconciler.WatchFiles, s.GatewayOptions.WatchesPath)
|
||||
}
|
||||
if err := helmReconciler.SetupWithManager(mgr); err != nil {
|
||||
klog.Fatalf("Unable to create helm controller: %v", err)
|
||||
helmReconciler := helm.Reconciler{GatewayOptions: s.GatewayOptions}
|
||||
if err := helmReconciler.SetupWithManager(mgr); err != nil {
|
||||
klog.Fatalf("Unable to create helm controller: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(jeff): refactor config with CRD
|
||||
|
||||
@@ -97,7 +97,7 @@ func Run(s *options.ServerRunOptions, ctx context.Context) error {
|
||||
|
||||
err = apiserver.PrepareRun(ctx.Done())
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
return apiserver.Run(ctx)
|
||||
|
||||
@@ -14,6 +14,7 @@ controller:
|
||||
repository: kubesphere/nginx-ingress-controller
|
||||
tag: "v0.48.1"
|
||||
pullPolicy: IfNotPresent
|
||||
digest: ""
|
||||
|
||||
|
||||
service:
|
||||
|
||||
20
go.mod
20
go.mod
@@ -56,7 +56,7 @@ require (
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.4
|
||||
github.com/json-iterator/go v1.1.11
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/jszwec/csvutil v1.5.0
|
||||
github.com/kelseyhightower/envconfig v1.4.0 // indirect
|
||||
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
|
||||
@@ -107,26 +107,26 @@ require (
|
||||
istio.io/api v0.0.0-20201113182140-d4b7e3fc2b44
|
||||
istio.io/client-go v0.0.0-20201113183938-0734e976e785
|
||||
istio.io/gogo-genproto v0.0.0-20201113182723-5b8563d8a012 // indirect
|
||||
k8s.io/api v0.21.3
|
||||
k8s.io/apiextensions-apiserver v0.21.3
|
||||
k8s.io/apimachinery v0.21.3
|
||||
k8s.io/api v0.21.4
|
||||
k8s.io/apiextensions-apiserver v0.21.4
|
||||
k8s.io/apimachinery v0.21.4
|
||||
k8s.io/apiserver v0.21.2
|
||||
k8s.io/cli-runtime v0.21.2
|
||||
k8s.io/client-go v12.0.0+incompatible
|
||||
k8s.io/code-generator v0.21.2
|
||||
k8s.io/component-base v0.21.2
|
||||
k8s.io/component-base v0.21.4
|
||||
k8s.io/klog v1.0.0
|
||||
k8s.io/klog/v2 v2.8.0
|
||||
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e
|
||||
k8s.io/kubectl v0.21.2
|
||||
k8s.io/metrics v0.21.2
|
||||
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b
|
||||
k8s.io/utils v0.0.0-20210802155522-efc7438f0176
|
||||
kubesphere.io/api v0.0.0
|
||||
kubesphere.io/client-go v0.0.0
|
||||
kubesphere.io/monitoring-dashboard v0.2.2
|
||||
rsc.io/letsencrypt v0.0.1 // indirect
|
||||
sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0
|
||||
sigs.k8s.io/controller-runtime v0.9.3
|
||||
sigs.k8s.io/controller-runtime v0.9.8-0.20211019125639-aa2b3e68a52d
|
||||
sigs.k8s.io/controller-tools v0.6.2
|
||||
sigs.k8s.io/kubefed v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.8.8
|
||||
@@ -474,7 +474,7 @@ replace (
|
||||
github.com/jonboulle/clockwork => github.com/jonboulle/clockwork v0.1.0
|
||||
github.com/jpillora/backoff => github.com/jpillora/backoff v1.0.0
|
||||
github.com/jsimonetti/rtnetlink => github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4
|
||||
github.com/json-iterator/go => github.com/json-iterator/go v1.1.10
|
||||
github.com/json-iterator/go => github.com/json-iterator/go v1.1.12
|
||||
github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v0.9.1
|
||||
github.com/jsternberg/zap-logfmt => github.com/jsternberg/zap-logfmt v1.0.0
|
||||
github.com/jszwec/csvutil => github.com/jszwec/csvutil v1.5.0
|
||||
@@ -553,7 +553,7 @@ replace (
|
||||
github.com/moby/spdystream => github.com/moby/spdystream v0.2.0
|
||||
github.com/moby/term => github.com/moby/term v0.0.0-20201216013528-df9cb8a40635
|
||||
github.com/modern-go/concurrent => github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
|
||||
github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v1.0.1
|
||||
github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v1.0.2
|
||||
github.com/monochromegane/go-gitignore => github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00
|
||||
github.com/montanaflynn/stats => github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe
|
||||
github.com/morikuni/aec => github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c
|
||||
@@ -813,7 +813,7 @@ replace (
|
||||
rsc.io/sampler => rsc.io/sampler v1.3.0
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19
|
||||
sigs.k8s.io/application => sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0
|
||||
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.9.3
|
||||
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.9.8-0.20211019125639-aa2b3e68a52d
|
||||
sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.6.2
|
||||
sigs.k8s.io/kind => sigs.k8s.io/kind v0.8.1
|
||||
sigs.k8s.io/kubebuilder/v3 => sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210716121009-fde793f20067
|
||||
|
||||
12
go.sum
12
go.sum
@@ -484,8 +484,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ=
|
||||
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
|
||||
github.com/jszwec/csvutil v1.5.0 h1:ErLnF1Qzzt9svk8CUY7CyLl/W9eET+KWPIZWkE1o6JM=
|
||||
@@ -597,8 +597,8 @@ github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0
|
||||
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
@@ -996,8 +996,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19 h1:0jaDAAxtqIrrq
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
|
||||
sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0 h1:cH3Q4uNycL9LgzlyU+/UikIM1T6tx9LKc/Ie/QVIRM8=
|
||||
sigs.k8s.io/application v0.8.4-0.20201016185654-c8e2959e57a0/go.mod h1:wdTrELsIgKk8lnlRaoKWao9YpLelXpABdEgCM1aEEE4=
|
||||
sigs.k8s.io/controller-runtime v0.9.3 h1:n075bHQ1wb8hpX7C27pNrqsb0fj8mcfCQfNX+oKTbYE=
|
||||
sigs.k8s.io/controller-runtime v0.9.3/go.mod h1:TxzMCHyEUpaeuOiZx/bIdc2T81vfs/aKdvJt9wuu0zk=
|
||||
sigs.k8s.io/controller-runtime v0.9.8-0.20211019125639-aa2b3e68a52d h1:6S7UHwijq5QDvhmo+dmkdvyo2a6sMnz9ilLbMUEgJ28=
|
||||
sigs.k8s.io/controller-runtime v0.9.8-0.20211019125639-aa2b3e68a52d/go.mod h1:nExcHcQ2zvLMeoO9K7rOesGCmgu32srN5SENvpAEbGA=
|
||||
sigs.k8s.io/controller-tools v0.6.2 h1:+Y8L0UsAugDipGRw8lrkPoAi6XqlQVZuf1DQHME3PgU=
|
||||
sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aeawbt3xTgJ8=
|
||||
sigs.k8s.io/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4=
|
||||
|
||||
@@ -80,7 +80,8 @@ kube::version::get_version_vars() {
|
||||
# the "major" and "minor" versions and whether this is the exact tagged
|
||||
# version or whether the tree is between two tagged versions.
|
||||
if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?([+].*)?$ ]]; then
|
||||
# KUBE_GIT_MAJOR=${BASH_REMATCH[1]}
|
||||
# shellcheck disable=SC2034
|
||||
KUBE_GIT_MAJOR=${BASH_REMATCH[1]}
|
||||
KUBE_GIT_MINOR=${BASH_REMATCH[2]}
|
||||
if [[ -n "${BASH_REMATCH[4]}" ]]; then
|
||||
KUBE_GIT_MINOR+="+"
|
||||
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
rt "runtime"
|
||||
"time"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/utils/iputil"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authentication/token"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authorization"
|
||||
@@ -107,7 +109,6 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/s3"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
|
||||
"kubesphere.io/kubesphere/pkg/utils/metrics"
|
||||
utilnet "kubesphere.io/kubesphere/pkg/utils/net"
|
||||
)
|
||||
|
||||
type APIServer struct {
|
||||
@@ -596,7 +597,7 @@ func logRequestAndResponse(req *restful.Request, resp *restful.Response, chain *
|
||||
}
|
||||
|
||||
logWithVerbose.Infof("%s - \"%s %s %s\" %d %d %dms",
|
||||
utilnet.GetRequestIP(req.Request),
|
||||
iputil.RemoteIp(req.Request),
|
||||
req.Request.Method,
|
||||
req.Request.URL,
|
||||
req.Request.Proto,
|
||||
|
||||
@@ -25,6 +25,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/utils/iputil"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/validation/path"
|
||||
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
||||
metainternalversionscheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme"
|
||||
@@ -36,7 +38,6 @@ import (
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/api"
|
||||
"kubesphere.io/kubesphere/pkg/constants"
|
||||
netutils "kubesphere.io/kubesphere/pkg/utils/net"
|
||||
)
|
||||
|
||||
type RequestInfoResolver interface {
|
||||
@@ -127,7 +128,7 @@ func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, er
|
||||
},
|
||||
Workspace: api.WorkspaceNone,
|
||||
Cluster: api.ClusterNone,
|
||||
SourceIP: netutils.GetRequestIP(req),
|
||||
SourceIP: iputil.RemoteIp(req),
|
||||
UserAgent: req.UserAgent(),
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ type fixture struct {
|
||||
fedgroupBindingLister []*fedv1beta1types.FederatedGroupBinding
|
||||
userLister []*v1alpha2.User
|
||||
// Actions expected to happen on the client.
|
||||
kubeactions []core.Action
|
||||
actions []core.Action
|
||||
k8sactions []core.Action
|
||||
ksactions []core.Action
|
||||
// Objects from here preloaded into NewSimpleFake.
|
||||
kubeobjects []runtime.Object
|
||||
objects []runtime.Object
|
||||
@@ -185,32 +185,32 @@ func (f *fixture) runController(groupBinding string, startInformers bool, expect
|
||||
|
||||
actions := filterInformerActions(f.ksclient.Actions())
|
||||
for i, action := range actions {
|
||||
if len(f.actions) < i+1 {
|
||||
f.t.Errorf("%d unexpected actions: %+v", len(actions)-len(f.actions), actions[i:])
|
||||
if len(f.ksactions) < i+1 {
|
||||
f.t.Errorf("%d unexpected actions: %+v", len(actions)-len(f.ksactions), actions[i:])
|
||||
break
|
||||
}
|
||||
|
||||
expectedAction := f.actions[i]
|
||||
expectedAction := f.ksactions[i]
|
||||
checkAction(expectedAction, action, f.t)
|
||||
}
|
||||
|
||||
if len(f.actions) > len(actions) {
|
||||
f.t.Errorf("%d additional expected actions:%+v", len(f.actions)-len(actions), f.actions[len(actions):])
|
||||
if len(f.ksactions) > len(actions) {
|
||||
f.t.Errorf("%d additional expected actions:%+v", len(f.ksactions)-len(actions), f.ksactions[len(actions):])
|
||||
}
|
||||
|
||||
k8sActions := filterInformerActions(f.k8sclient.Actions())
|
||||
for i, action := range k8sActions {
|
||||
if len(f.kubeactions) < i+1 {
|
||||
f.t.Errorf("%d unexpected actions: %+v", len(k8sActions)-len(f.kubeactions), k8sActions[i:])
|
||||
if len(f.k8sactions) < i+1 {
|
||||
f.t.Errorf("%d unexpected actions: %+v", len(k8sActions)-len(f.k8sactions), k8sActions[i:])
|
||||
break
|
||||
}
|
||||
|
||||
expectedAction := f.kubeactions[i]
|
||||
expectedAction := f.k8sactions[i]
|
||||
checkAction(expectedAction, action, f.t)
|
||||
}
|
||||
|
||||
if len(f.kubeactions) > len(k8sActions) {
|
||||
f.t.Errorf("%d additional expected actions:%+v", len(f.kubeactions)-len(k8sActions), f.kubeactions[len(k8sActions):])
|
||||
if len(f.k8sactions) > len(k8sActions) {
|
||||
f.t.Errorf("%d additional expected actions:%+v", len(f.k8sactions)-len(k8sActions), f.k8sactions[len(k8sActions):])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,18 +269,12 @@ func checkAction(expected, actual core.Action, t *testing.T) {
|
||||
func filterInformerActions(actions []core.Action) []core.Action {
|
||||
var ret []core.Action
|
||||
for _, action := range actions {
|
||||
if len(action.GetNamespace()) == 0 &&
|
||||
(action.Matches("list", "groupbindings") ||
|
||||
action.Matches("watch", "groupbindings") ||
|
||||
action.Matches("list", "federatedgroupbindings") ||
|
||||
action.Matches("list", "users") ||
|
||||
action.Matches("watch", "users") ||
|
||||
action.Matches("get", "users")) {
|
||||
// filter out read action
|
||||
if action.GetVerb() == "watch" || action.GetVerb() == "list" || action.GetVerb() == "get" {
|
||||
continue
|
||||
}
|
||||
ret = append(ret, action)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -289,14 +283,14 @@ func (f *fixture) expectUpdateGroupsFinalizerAction(groupBinding *v1alpha2.Group
|
||||
expect.Finalizers = []string{"finalizers.kubesphere.io/groupsbindings"}
|
||||
expect.Labels = map[string]string{constants.KubefedManagedLabel: "false"}
|
||||
action := core.NewUpdateAction(schema.GroupVersionResource{Group: "iam.kubesphere.io", Version: "v1alpha2", Resource: "groupbindings"}, "", expect)
|
||||
f.actions = append(f.actions, action)
|
||||
f.ksactions = append(f.ksactions, action)
|
||||
}
|
||||
|
||||
func (f *fixture) expectUpdateGroupsDeleteAction(groupBinding *v1alpha2.GroupBinding) {
|
||||
expect := groupBinding.DeepCopy()
|
||||
expect.Finalizers = []string{}
|
||||
action := core.NewUpdateAction(schema.GroupVersionResource{Group: "iam.kubesphere.io", Version: "v1alpha2", Resource: "groupbindings"}, "", expect)
|
||||
f.actions = append(f.actions, action)
|
||||
f.ksactions = append(f.ksactions, action)
|
||||
}
|
||||
|
||||
func (f *fixture) expectPatchUserAction(user *v1alpha2.User, groups []string) {
|
||||
@@ -305,16 +299,16 @@ func (f *fixture) expectPatchUserAction(user *v1alpha2.User, groups []string) {
|
||||
patch := client.MergeFrom(user)
|
||||
patchData, _ := patch.Data(newUser)
|
||||
|
||||
f.actions = append(f.actions, core.NewPatchAction(schema.GroupVersionResource{Group: "iam.kubesphere.io", Resource: "users", Version: "v1alpha2"}, user.Namespace, user.Name, patch.Type(), patchData))
|
||||
f.ksactions = append(f.ksactions, core.NewPatchAction(schema.GroupVersionResource{Group: "iam.kubesphere.io", Resource: "users", Version: "v1alpha2"}, user.Namespace, user.Name, patch.Type(), patchData))
|
||||
}
|
||||
|
||||
func (f *fixture) expectCreateFederatedGroupBindingsAction(groupBinding *v1alpha2.GroupBinding) {
|
||||
b := newFederatedGroupBinding(groupBinding)
|
||||
|
||||
controllerutil.SetControllerReference(groupBinding, b, scheme.Scheme)
|
||||
_ = controllerutil.SetControllerReference(groupBinding, b, scheme.Scheme)
|
||||
|
||||
actionCreate := core.NewCreateAction(schema.GroupVersionResource{Group: "types.kubefed.io", Version: "v1beta1", Resource: "federatedgroupbindings"}, "", b)
|
||||
f.actions = append(f.actions, actionCreate)
|
||||
f.ksactions = append(f.ksactions, actionCreate)
|
||||
}
|
||||
|
||||
func getKey(groupBinding *v1alpha2.GroupBinding, t *testing.T) string {
|
||||
@@ -341,9 +335,9 @@ func TestCreatesGroupBinding(t *testing.T) {
|
||||
|
||||
f.objects = append(f.objects, user)
|
||||
|
||||
excepctGroups := []string{"test"}
|
||||
expectGroups := []string{"test"}
|
||||
|
||||
f.expectPatchUserAction(user, excepctGroups)
|
||||
f.expectPatchUserAction(user, expectGroups)
|
||||
f.expectCreateFederatedGroupBindingsAction(groupbinding)
|
||||
|
||||
f.run(getKey(groupbinding, t))
|
||||
|
||||
@@ -23,25 +23,26 @@ import (
|
||||
"k8s.io/klog"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/gateway"
|
||||
|
||||
"github.com/operator-framework/helm-operator-plugins/pkg/annotation"
|
||||
"github.com/operator-framework/helm-operator-plugins/pkg/reconciler"
|
||||
"github.com/operator-framework/helm-operator-plugins/pkg/watches"
|
||||
)
|
||||
|
||||
type Reconciler struct {
|
||||
WatchFiles []string
|
||||
GatewayOptions *gateway.Options
|
||||
}
|
||||
|
||||
// SetupWithManager creates reconilers for each helm package that defined in the WatchFiles.
|
||||
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
var watchKinds []watches.Watch
|
||||
for _, file := range r.WatchFiles {
|
||||
ws, err := watches.Load(file)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
watchKinds = append(watchKinds, ws...)
|
||||
|
||||
ws, err := watches.Load(r.GatewayOptions.WatchesPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
watchKinds = append(watchKinds, ws...)
|
||||
|
||||
for _, w := range watchKinds {
|
||||
// Register controller with the factory
|
||||
@@ -58,7 +59,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
r, err := reconciler.New(
|
||||
reconciler.WithChart(*w.Chart),
|
||||
reconciler.WithGroupVersionKind(w.GroupVersionKind),
|
||||
reconciler.WithOverrideValues(w.OverrideValues),
|
||||
reconciler.WithOverrideValues(r.defaultConfiguration()),
|
||||
reconciler.SkipDependentWatches(w.WatchDependentResources != nil && !*w.WatchDependentResources),
|
||||
reconciler.WithMaxConcurrentReconciles(maxConcurrentReconciles),
|
||||
reconciler.WithReconcilePeriod(reconcilePeriod),
|
||||
@@ -76,3 +77,14 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Reconciler) defaultConfiguration() map[string]string {
|
||||
var overrideValues = make(map[string]string)
|
||||
if r.GatewayOptions.Repository != "" {
|
||||
overrideValues["controller.image.repository"] = r.GatewayOptions.Repository
|
||||
}
|
||||
if r.GatewayOptions.Tag != "" {
|
||||
overrideValues["controller.image.tag"] = r.GatewayOptions.Tag
|
||||
}
|
||||
return overrideValues
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/log"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/gateway"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"sigs.k8s.io/controller-runtime/pkg/envtest"
|
||||
@@ -79,8 +81,7 @@ var _ = Context("Helm reconcier", func() {
|
||||
mgr, err := ctrl.NewManager(cfg, ctrl.Options{MetricsBindAddress: "0"})
|
||||
Expect(err).NotTo(HaveOccurred(), "failed to create a manager")
|
||||
|
||||
reconciler := &Reconciler{}
|
||||
reconciler.WatchFiles = append(reconciler.WatchFiles, f.Name())
|
||||
reconciler := &Reconciler{GatewayOptions: &gateway.Options{WatchesPath: f.Name()}}
|
||||
err = reconciler.SetupWithManager(mgr)
|
||||
Expect(err).NotTo(HaveOccurred(), "failed to setup helm reconciler")
|
||||
|
||||
|
||||
@@ -112,9 +112,8 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
|
||||
func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
|
||||
logger := r.Logger.WithValues("user", req.NamespacedName)
|
||||
rootCtx := context.Background()
|
||||
user := &iamv1alpha2.User{}
|
||||
err := r.Get(rootCtx, req.NamespacedName, user)
|
||||
err := r.Get(ctx, req.NamespacedName, user)
|
||||
if err != nil {
|
||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||
}
|
||||
@@ -124,7 +123,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
|
||||
// then lets add the finalizer and update the object.
|
||||
if !sliceutil.HasString(user.Finalizers, finalizer) {
|
||||
user.ObjectMeta.Finalizers = append(user.ObjectMeta.Finalizers, finalizer)
|
||||
if err = r.Update(context.Background(), user, &client.UpdateOptions{}); err != nil {
|
||||
if err = r.Update(ctx, user, &client.UpdateOptions{}); err != nil {
|
||||
logger.Error(err, "failed to update user")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
@@ -168,7 +167,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
|
||||
return item == finalizer
|
||||
})
|
||||
|
||||
if err = r.Update(context.Background(), user, &client.UpdateOptions{}); err != nil {
|
||||
if err = r.Update(ctx, user, &client.UpdateOptions{}); err != nil {
|
||||
klog.Error(err)
|
||||
r.Recorder.Event(user, corev1.EventTypeWarning, failedSynced, fmt.Sprintf(syncFailMessage, err))
|
||||
return ctrl.Result{}, err
|
||||
@@ -199,12 +198,12 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
|
||||
// update user status if not managed by kubefed
|
||||
managedByKubefed := user.Labels[constants.KubefedManagedLabel] == "true"
|
||||
if !managedByKubefed {
|
||||
if user, err = r.encryptPassword(user); err != nil {
|
||||
if err = r.encryptPassword(ctx, user); err != nil {
|
||||
klog.Error(err)
|
||||
r.Recorder.Event(user, corev1.EventTypeWarning, failedSynced, fmt.Sprintf(syncFailMessage, err))
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
if user, err = r.syncUserStatus(ctx, user); err != nil {
|
||||
if err = r.syncUserStatus(ctx, user); err != nil {
|
||||
klog.Error(err)
|
||||
r.Recorder.Event(user, corev1.EventTypeWarning, failedSynced, fmt.Sprintf(syncFailMessage, err))
|
||||
return ctrl.Result{}, err
|
||||
@@ -239,15 +238,15 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
|
||||
func (r *Reconciler) encryptPassword(user *iamv1alpha2.User) (*iamv1alpha2.User, error) {
|
||||
// encryptPassword Encrypt and update the user password
|
||||
func (r *Reconciler) encryptPassword(ctx context.Context, user *iamv1alpha2.User) error {
|
||||
// password is not empty and not encrypted
|
||||
if user.Spec.EncryptedPassword != "" && !isEncrypted(user.Spec.EncryptedPassword) {
|
||||
password, err := encrypt(user.Spec.EncryptedPassword)
|
||||
if err != nil {
|
||||
klog.Error(err)
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
user = user.DeepCopy()
|
||||
user.Spec.EncryptedPassword = password
|
||||
if user.Annotations == nil {
|
||||
user.Annotations = make(map[string]string)
|
||||
@@ -255,32 +254,31 @@ func (r *Reconciler) encryptPassword(user *iamv1alpha2.User) (*iamv1alpha2.User,
|
||||
user.Annotations[iamv1alpha2.LastPasswordChangeTimeAnnotation] = time.Now().UTC().Format(time.RFC3339)
|
||||
// ensure plain text password won't be kept anywhere
|
||||
delete(user.Annotations, corev1.LastAppliedConfigAnnotation)
|
||||
err = r.Update(context.Background(), user, &client.UpdateOptions{})
|
||||
err = r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
return user, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Reconciler) ensureNotControlledByKubefed(user *iamv1alpha2.User) error {
|
||||
func (r *Reconciler) ensureNotControlledByKubefed(ctx context.Context, user *iamv1alpha2.User) error {
|
||||
if user.Labels[constants.KubefedManagedLabel] != "false" {
|
||||
if user.Labels == nil {
|
||||
user.Labels = make(map[string]string, 0)
|
||||
}
|
||||
user = user.DeepCopy()
|
||||
user.Labels[constants.KubefedManagedLabel] = "false"
|
||||
err := r.Update(context.Background(), user, &client.UpdateOptions{})
|
||||
err := r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
klog.Error(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Reconciler) multiClusterSync(ctx context.Context, user *iamv1alpha2.User) error {
|
||||
if err := r.ensureNotControlledByKubefed(user); err != nil {
|
||||
if err := r.ensureNotControlledByKubefed(ctx, user); err != nil {
|
||||
klog.Error(err)
|
||||
return err
|
||||
}
|
||||
@@ -434,12 +432,18 @@ func (r *Reconciler) deleteRoleBindings(ctx context.Context, user *iamv1alpha2.U
|
||||
return err
|
||||
}
|
||||
|
||||
roleBinding := &rbacv1.RoleBinding{}
|
||||
err = r.Client.DeleteAllOf(ctx, roleBinding, client.MatchingLabels{iamv1alpha2.UserReferenceLabel: user.Name})
|
||||
roleBindingList := &rbacv1.RoleBindingList{}
|
||||
err = r.Client.List(ctx, roleBindingList, client.MatchingLabels{iamv1alpha2.UserReferenceLabel: user.Name})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, roleBinding := range roleBindingList.Items {
|
||||
err = r.Client.Delete(ctx, &roleBinding)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -448,57 +452,51 @@ func (r *Reconciler) deleteLoginRecords(ctx context.Context, user *iamv1alpha2.U
|
||||
return r.Client.DeleteAllOf(ctx, loginRecord, client.MatchingLabels{iamv1alpha2.UserReferenceLabel: user.Name})
|
||||
}
|
||||
|
||||
// syncUserStatus will reconcile user state based on user login records
|
||||
func (r *Reconciler) syncUserStatus(ctx context.Context, user *iamv1alpha2.User) (*iamv1alpha2.User, error) {
|
||||
// syncUserStatus Update the user status
|
||||
func (r *Reconciler) syncUserStatus(ctx context.Context, user *iamv1alpha2.User) error {
|
||||
if user.Spec.EncryptedPassword == "" {
|
||||
if user.Labels[iamv1alpha2.IdentifyProviderLabel] != "" {
|
||||
// mapped user from other identity provider always active until disabled
|
||||
if user.Status.State == nil || *user.Status.State != iamv1alpha2.UserActive {
|
||||
expected := user.DeepCopy()
|
||||
active := iamv1alpha2.UserActive
|
||||
expected.Status = iamv1alpha2.UserStatus{
|
||||
user.Status = iamv1alpha2.UserStatus{
|
||||
State: &active,
|
||||
LastTransitionTime: &metav1.Time{Time: time.Now()},
|
||||
}
|
||||
err := r.Update(ctx, expected, &client.UpdateOptions{})
|
||||
err := r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return expected, nil
|
||||
}
|
||||
} else {
|
||||
// becomes disabled after setting a blank password
|
||||
if user.Status.State == nil || *user.Status.State != iamv1alpha2.UserDisabled {
|
||||
expected := user.DeepCopy()
|
||||
disabled := iamv1alpha2.UserDisabled
|
||||
expected.Status = iamv1alpha2.UserStatus{
|
||||
user.Status = iamv1alpha2.UserStatus{
|
||||
State: &disabled,
|
||||
LastTransitionTime: &metav1.Time{Time: time.Now()},
|
||||
}
|
||||
err := r.Update(ctx, expected, &client.UpdateOptions{})
|
||||
err := r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return expected, nil
|
||||
}
|
||||
}
|
||||
return user, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
// becomes active after password encrypted
|
||||
if isEncrypted(user.Spec.EncryptedPassword) {
|
||||
if user.Status.State == nil || *user.Status.State == iamv1alpha2.UserDisabled {
|
||||
expected := user.DeepCopy()
|
||||
active := iamv1alpha2.UserActive
|
||||
expected.Status = iamv1alpha2.UserStatus{
|
||||
user.Status = iamv1alpha2.UserStatus{
|
||||
State: &active,
|
||||
LastTransitionTime: &metav1.Time{Time: time.Now()},
|
||||
}
|
||||
err := r.Update(ctx, expected, &client.UpdateOptions{})
|
||||
err := r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return expected, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,18 +504,17 @@ func (r *Reconciler) syncUserStatus(ctx context.Context, user *iamv1alpha2.User)
|
||||
if user.Status.State != nil && *user.Status.State == iamv1alpha2.UserAuthLimitExceeded {
|
||||
if user.Status.LastTransitionTime != nil &&
|
||||
user.Status.LastTransitionTime.Add(r.AuthenticationOptions.AuthenticateRateLimiterDuration).Before(time.Now()) {
|
||||
expected := user.DeepCopy()
|
||||
// unblock user
|
||||
active := iamv1alpha2.UserActive
|
||||
expected.Status = iamv1alpha2.UserStatus{
|
||||
user.Status = iamv1alpha2.UserStatus{
|
||||
State: &active,
|
||||
LastTransitionTime: &metav1.Time{Time: time.Now()},
|
||||
}
|
||||
err := r.Update(ctx, expected, &client.UpdateOptions{})
|
||||
err := r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return expected, nil
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +523,7 @@ func (r *Reconciler) syncUserStatus(ctx context.Context, user *iamv1alpha2.User)
|
||||
err := r.List(ctx, records, client.MatchingLabels{iamv1alpha2.UserReferenceLabel: user.Name})
|
||||
if err != nil {
|
||||
klog.Error(err)
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
// count failed login attempts during last AuthenticateRateLimiterDuration
|
||||
@@ -541,22 +538,20 @@ func (r *Reconciler) syncUserStatus(ctx context.Context, user *iamv1alpha2.User)
|
||||
|
||||
// block user if failed login attempts exceeds maximum tries setting
|
||||
if failedLoginAttempts >= r.AuthenticationOptions.AuthenticateRateLimiterMaxTries {
|
||||
expected := user.DeepCopy()
|
||||
limitExceed := iamv1alpha2.UserAuthLimitExceeded
|
||||
expected.Status = iamv1alpha2.UserStatus{
|
||||
user.Status = iamv1alpha2.UserStatus{
|
||||
State: &limitExceed,
|
||||
Reason: fmt.Sprintf("Failed login attempts exceed %d in last %s", failedLoginAttempts, r.AuthenticationOptions.AuthenticateRateLimiterDuration),
|
||||
LastTransitionTime: &metav1.Time{Time: time.Now()},
|
||||
}
|
||||
|
||||
err = r.Update(context.Background(), expected, &client.UpdateOptions{})
|
||||
err = r.Update(ctx, user, &client.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
return expected, nil
|
||||
}
|
||||
|
||||
return user, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func encrypt(password string) (string, error) {
|
||||
|
||||
@@ -99,7 +99,7 @@ func TestDoNothing(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = c.Reconcile(context.Background(), reconcile.Request{
|
||||
result, err := c.Reconcile(context.Background(), reconcile.Request{
|
||||
NamespacedName: types.NamespacedName{Name: user.Name},
|
||||
})
|
||||
if err != nil {
|
||||
@@ -108,22 +108,15 @@ func TestDoNothing(t *testing.T) {
|
||||
|
||||
// append finalizer
|
||||
updateEvent := <-w.ResultChan()
|
||||
assert.Equal(t, updateEvent.Type, watch.Modified)
|
||||
assert.Equal(t, watch.Modified, updateEvent.Type)
|
||||
assert.NotNil(t, updateEvent.Object)
|
||||
user = updateEvent.Object.(*iamv1alpha2.User)
|
||||
assert.NotNil(t, user)
|
||||
assert.NotEmpty(t, user.Finalizers)
|
||||
|
||||
result, err := c.Reconcile(context.Background(), reconcile.Request{
|
||||
NamespacedName: types.NamespacedName{Name: user.Name},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
updateEvent = <-w.ResultChan()
|
||||
// encrypt password
|
||||
assert.Equal(t, updateEvent.Type, watch.Modified)
|
||||
assert.Equal(t, watch.Modified, updateEvent.Type)
|
||||
assert.NotNil(t, updateEvent.Object)
|
||||
user = updateEvent.Object.(*iamv1alpha2.User)
|
||||
assert.NotNil(t, user)
|
||||
@@ -132,12 +125,12 @@ func TestDoNothing(t *testing.T) {
|
||||
// becomes active after password encrypted
|
||||
updateEvent = <-w.ResultChan()
|
||||
user = updateEvent.Object.(*iamv1alpha2.User)
|
||||
assert.Equal(t, *user.Status.State, iamv1alpha2.UserActive)
|
||||
assert.Equal(t, iamv1alpha2.UserActive, *user.Status.State)
|
||||
|
||||
// block user
|
||||
updateEvent = <-w.ResultChan()
|
||||
user = updateEvent.Object.(*iamv1alpha2.User)
|
||||
assert.Equal(t, *user.Status.State, iamv1alpha2.UserAuthLimitExceeded)
|
||||
assert.Equal(t, iamv1alpha2.UserAuthLimitExceeded, *user.Status.State)
|
||||
assert.True(t, result.Requeue)
|
||||
|
||||
time.Sleep(result.RequeueAfter + time.Second)
|
||||
@@ -151,5 +144,5 @@ func TestDoNothing(t *testing.T) {
|
||||
// unblock user
|
||||
updateEvent = <-w.ResultChan()
|
||||
user = updateEvent.Object.(*iamv1alpha2.User)
|
||||
assert.Equal(t, *user.Status.State, iamv1alpha2.UserActive)
|
||||
assert.Equal(t, iamv1alpha2.UserActive, *user.Status.State)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,6 @@ func (r *Reconciler) bindWorkspace(ctx context.Context, logger logr.Logger, work
|
||||
return client.IgnoreNotFound(err)
|
||||
}
|
||||
if !metav1.IsControlledBy(workspaceRole, &workspace) {
|
||||
workspaceRole = workspaceRole.DeepCopy()
|
||||
workspaceRole.OwnerReferences = k8sutil.RemoveWorkspaceOwnerReference(workspaceRole.OwnerReferences)
|
||||
if err := controllerutil.SetControllerReference(&workspace, workspaceRole, r.Scheme); err != nil {
|
||||
logger.Error(err, "set controller reference failed")
|
||||
@@ -151,6 +150,7 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
logger.Error(err, "create federated workspace role failed")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
logger.Error(err, "get federated workspace role failed")
|
||||
@@ -174,10 +174,6 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
|
||||
func newFederatedWorkspaceRole(workspaceRole *iamv1alpha2.WorkspaceRole) (*typesv1beta1.FederatedWorkspaceRole, error) {
|
||||
federatedWorkspaceRole := &typesv1beta1.FederatedWorkspaceRole{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: typesv1beta1.FederatedWorkspaceRoleKind,
|
||||
APIVersion: typesv1beta1.SchemeGroupVersion.String(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: workspaceRole.Name,
|
||||
},
|
||||
@@ -206,7 +202,6 @@ func (r *Reconciler) ensureNotControlledByKubefed(ctx context.Context, logger lo
|
||||
if workspaceRole.Labels == nil {
|
||||
workspaceRole.Labels = make(map[string]string)
|
||||
}
|
||||
workspaceRole = workspaceRole.DeepCopy()
|
||||
workspaceRole.Labels[constants.KubefedManagedLabel] = "false"
|
||||
if err := r.Update(ctx, workspaceRole); err != nil {
|
||||
logger.Error(err, "update kubefed managed label failed")
|
||||
|
||||
@@ -123,7 +123,6 @@ func (r *Reconciler) bindWorkspace(ctx context.Context, logger logr.Logger, work
|
||||
}
|
||||
// owner reference not match workspace label
|
||||
if !metav1.IsControlledBy(workspaceRoleBinding, workspace) {
|
||||
workspaceRoleBinding := workspaceRoleBinding.DeepCopy()
|
||||
workspaceRoleBinding.OwnerReferences = k8sutil.RemoveWorkspaceOwnerReference(workspaceRoleBinding.OwnerReferences)
|
||||
if err := controllerutil.SetControllerReference(workspace, workspaceRoleBinding, r.Scheme); err != nil {
|
||||
logger.Error(err, "set controller reference failed")
|
||||
@@ -145,7 +144,7 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
federatedWorkspaceRoleBinding := &typesv1beta1.FederatedWorkspaceRoleBinding{}
|
||||
if err := r.Client.Get(ctx, types.NamespacedName{Name: workspaceRoleBinding.Name}, federatedWorkspaceRoleBinding); err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
if federatedWorkspaceRoleBinding, err := newFederatedWorkspaceRole(workspaceRoleBinding); err != nil {
|
||||
if federatedWorkspaceRoleBinding, err := newFederatedWorkspaceRoleBinding(workspaceRoleBinding); err != nil {
|
||||
logger.Error(err, "generate federated workspace role binding failed")
|
||||
return err
|
||||
} else {
|
||||
@@ -153,6 +152,7 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
logger.Error(err, "create federated workspace role binding failed")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
logger.Error(err, "get federated workspace role binding failed")
|
||||
@@ -176,12 +176,8 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
return nil
|
||||
}
|
||||
|
||||
func newFederatedWorkspaceRole(workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBinding) (*typesv1beta1.FederatedWorkspaceRoleBinding, error) {
|
||||
federatedWorkspaceRole := &typesv1beta1.FederatedWorkspaceRoleBinding{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: typesv1beta1.FederatedWorkspaceRoleBindingKind,
|
||||
APIVersion: typesv1beta1.SchemeGroupVersion.String(),
|
||||
},
|
||||
func newFederatedWorkspaceRoleBinding(workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBinding) (*typesv1beta1.FederatedWorkspaceRoleBinding, error) {
|
||||
federatedWorkspaceRoleBinding := &typesv1beta1.FederatedWorkspaceRoleBinding{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: workspaceRoleBinding.Name,
|
||||
},
|
||||
@@ -198,10 +194,10 @@ func newFederatedWorkspaceRole(workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBi
|
||||
},
|
||||
},
|
||||
}
|
||||
if err := controllerutil.SetControllerReference(workspaceRoleBinding, federatedWorkspaceRole, scheme.Scheme); err != nil {
|
||||
if err := controllerutil.SetControllerReference(workspaceRoleBinding, federatedWorkspaceRoleBinding, scheme.Scheme); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return federatedWorkspaceRole, nil
|
||||
return federatedWorkspaceRoleBinding, nil
|
||||
}
|
||||
|
||||
func (r *Reconciler) ensureNotControlledByKubefed(ctx context.Context, logger logr.Logger, workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBinding) error {
|
||||
@@ -209,7 +205,6 @@ func (r *Reconciler) ensureNotControlledByKubefed(ctx context.Context, logger lo
|
||||
if workspaceRoleBinding.Labels == nil {
|
||||
workspaceRoleBinding.Labels = make(map[string]string)
|
||||
}
|
||||
workspaceRoleBinding = workspaceRoleBinding.DeepCopy()
|
||||
workspaceRoleBinding.Labels[constants.KubefedManagedLabel] = "false"
|
||||
logger.V(4).Info("update kubefed managed label")
|
||||
if err := r.Update(ctx, workspaceRoleBinding); err != nil {
|
||||
|
||||
@@ -91,9 +91,8 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
// +kubebuilder:rbac:groups=tenant.kubesphere.io,resources=workspaces,verbs=get;list;watch;
|
||||
func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
|
||||
logger := r.Logger.WithValues("workspacetemplate", req.NamespacedName)
|
||||
rootCtx := context.Background()
|
||||
workspaceTemplate := &tenantv1alpha2.WorkspaceTemplate{}
|
||||
if err := r.Get(rootCtx, req.NamespacedName, workspaceTemplate); err != nil {
|
||||
if err := r.Get(ctx, req.NamespacedName, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||
}
|
||||
|
||||
@@ -102,7 +101,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
|
||||
// then lets add the finalizer and update the object.
|
||||
if !sliceutil.HasString(workspaceTemplate.ObjectMeta.Finalizers, workspaceTemplateFinalizer) {
|
||||
workspaceTemplate.ObjectMeta.Finalizers = append(workspaceTemplate.ObjectMeta.Finalizers, workspaceTemplateFinalizer)
|
||||
if err := r.Update(rootCtx, workspaceTemplate); err != nil {
|
||||
if err := r.Update(ctx, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
}
|
||||
@@ -110,16 +109,16 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
|
||||
// The object is being deleted
|
||||
if sliceutil.HasString(workspaceTemplate.ObjectMeta.Finalizers, workspaceTemplateFinalizer) ||
|
||||
sliceutil.HasString(workspaceTemplate.ObjectMeta.Finalizers, orphanFinalizer) {
|
||||
if err := r.deleteOpenPitrixResourcesInWorkspace(rootCtx, workspaceTemplate.Name); err != nil {
|
||||
logger.Error(err, "delete resource in workspace template failed")
|
||||
if err := r.deleteOpenPitrixResourcesInWorkspace(ctx, workspaceTemplate.Name); err != nil {
|
||||
logger.Error(err, "failed to delete related openpitrix resource")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
|
||||
if err := r.deleteWorkspace(rootCtx, workspaceTemplate); err != nil {
|
||||
if err := r.deleteWorkspace(ctx, workspaceTemplate); err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
logger.V(4).Info("workspace not found", "workspacerole", workspaceTemplate.Name)
|
||||
logger.V(4).Info("related workspace not found")
|
||||
} else {
|
||||
logger.Error(err, "failed delete workspaces")
|
||||
logger.Error(err, "failed to delete related workspace")
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
}
|
||||
@@ -130,7 +129,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
|
||||
})
|
||||
|
||||
logger.V(4).Info("update workspace template")
|
||||
if err := r.Update(rootCtx, workspaceTemplate); err != nil {
|
||||
if err := r.Update(ctx, workspaceTemplate); err != nil {
|
||||
logger.Error(err, "update workspace template failed")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
@@ -140,18 +139,18 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
|
||||
}
|
||||
|
||||
if r.MultiClusterEnabled {
|
||||
if err := r.multiClusterSync(rootCtx, logger, workspaceTemplate); err != nil {
|
||||
if err := r.multiClusterSync(ctx, logger, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
} else {
|
||||
if err := r.singleClusterSync(rootCtx, logger, workspaceTemplate); err != nil {
|
||||
if err := r.singleClusterSync(ctx, logger, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
}
|
||||
if err := r.initWorkspaceRoles(rootCtx, logger, workspaceTemplate); err != nil {
|
||||
if err := r.initWorkspaceRoles(ctx, logger, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
if err := r.initManagerRoleBinding(rootCtx, logger, workspaceTemplate); err != nil {
|
||||
if err := r.initManagerRoleBinding(ctx, logger, workspaceTemplate); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
r.Recorder.Event(workspaceTemplate, corev1.EventTypeNormal, controllerutils.SuccessSynced, controllerutils.MessageResourceSynced)
|
||||
@@ -230,10 +229,6 @@ func (r *Reconciler) multiClusterSync(ctx context.Context, logger logr.Logger, w
|
||||
|
||||
func newFederatedWorkspace(template *tenantv1alpha2.WorkspaceTemplate) (*typesv1beta1.FederatedWorkspace, error) {
|
||||
federatedWorkspace := &typesv1beta1.FederatedWorkspace{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: typesv1beta1.FederatedWorkspaceRoleKind,
|
||||
APIVersion: typesv1beta1.SchemeGroupVersion.String(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: template.Name,
|
||||
Labels: template.Labels,
|
||||
@@ -261,6 +256,7 @@ func (r *Reconciler) deleteWorkspace(ctx context.Context, template *tenantv1alph
|
||||
if err := r.Client.Get(ctx, types.NamespacedName{Name: template.Name}, federatedWorkspace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Workspace will be deleted with Orphan Option when it has a orphan finalizer.
|
||||
// Reousrces that owned by the Workspace will not be deleted.
|
||||
if sliceutil.HasString(template.ObjectMeta.Finalizers, orphanFinalizer) {
|
||||
@@ -271,7 +267,17 @@ func (r *Reconciler) deleteWorkspace(ctx context.Context, template *tenantv1alph
|
||||
if err := r.Update(ctx, federatedWorkspace); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
// Usually namespace will bind the lifecycle of workspace with ownerReference,
|
||||
// in multi-cluster environment workspace will not be created in host cluster
|
||||
// if the cluster is not be granted or kubefed-controller-manager is unavailable,
|
||||
// this will cause the federated namespace left an orphan object in host cluster.
|
||||
// After workspaceTemplate deleted we need to deleted orphan namespace in host cluster directly.
|
||||
if err := r.deleteNamespacesInWorkspace(ctx, template); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := r.Delete(ctx, federatedWorkspace); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -301,7 +307,6 @@ func (r *Reconciler) ensureNotControlledByKubefed(ctx context.Context, logger lo
|
||||
if workspaceTemplate.Labels == nil {
|
||||
workspaceTemplate.Labels = make(map[string]string)
|
||||
}
|
||||
workspaceTemplate = workspaceTemplate.DeepCopy()
|
||||
workspaceTemplate.Labels[constants.KubefedManagedLabel] = "false"
|
||||
logger.V(4).Info("update kubefed managed label")
|
||||
if err := r.Update(ctx, workspaceTemplate); err != nil {
|
||||
@@ -326,8 +331,8 @@ func (r *Reconciler) initWorkspaceRoles(ctx context.Context, logger logr.Logger,
|
||||
expected.Labels = make(map[string]string)
|
||||
}
|
||||
expected.Labels[tenantv1alpha1.WorkspaceLabel] = workspace.Name
|
||||
var existed iamv1alpha2.WorkspaceRole
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: expected.Name}, &existed); err != nil {
|
||||
workspaceRole := &iamv1alpha2.WorkspaceRole{}
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: expected.Name}, workspaceRole); err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
logger.V(4).Info("create workspace role", "workspacerole", expected.Name)
|
||||
if err := r.Create(ctx, &expected); err != nil {
|
||||
@@ -340,15 +345,14 @@ func (r *Reconciler) initWorkspaceRoles(ctx context.Context, logger logr.Logger,
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !reflect.DeepEqual(expected.Labels, existed.Labels) ||
|
||||
!reflect.DeepEqual(expected.Annotations, existed.Annotations) ||
|
||||
!reflect.DeepEqual(expected.Rules, existed.Rules) {
|
||||
updated := existed.DeepCopy()
|
||||
updated.Labels = expected.Labels
|
||||
updated.Annotations = expected.Annotations
|
||||
updated.Rules = expected.Rules
|
||||
logger.V(4).Info("update workspace role", "workspacerole", updated.Name)
|
||||
if err := r.Update(ctx, updated); err != nil {
|
||||
if !reflect.DeepEqual(expected.Labels, workspaceRole.Labels) ||
|
||||
!reflect.DeepEqual(expected.Annotations, workspaceRole.Annotations) ||
|
||||
!reflect.DeepEqual(expected.Rules, workspaceRole.Rules) {
|
||||
workspaceRole.Labels = expected.Labels
|
||||
workspaceRole.Annotations = expected.Annotations
|
||||
workspaceRole.Rules = expected.Rules
|
||||
logger.V(4).Info("update workspace role", "workspacerole", workspaceRole.Name)
|
||||
if err := r.Update(ctx, workspaceRole); err != nil {
|
||||
logger.Error(err, "update workspace role failed")
|
||||
return err
|
||||
}
|
||||
@@ -471,6 +475,23 @@ func (r *Reconciler) deleteHelmRepos(ctx context.Context, ws string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// deleteNamespacesInWorkspace Deletes the namespace associated with the workspace, which match the workspace label selector
|
||||
func (r *Reconciler) deleteNamespacesInWorkspace(ctx context.Context, template *tenantv1alpha2.WorkspaceTemplate) error {
|
||||
namespaceList := &corev1.NamespaceList{}
|
||||
err := r.Client.List(ctx, namespaceList, client.MatchingLabels{tenantv1alpha1.WorkspaceLabel: template.Name})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaceList.Items {
|
||||
err = r.Client.Delete(ctx, &namespace)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func workspaceRoleBindingChanger(workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBinding, workspace, username, workspaceRoleName string) controllerutil.MutateFn {
|
||||
return func() error {
|
||||
workspaceRoleBinding.Labels = map[string]string{
|
||||
|
||||
@@ -227,15 +227,30 @@ func (h *handler) PodLogSearch(request *restful.Request, response *restful.Respo
|
||||
}
|
||||
|
||||
noHit := len(namespaceCreateTimeMap) == 0 || len(podfilter) == 0
|
||||
if noHit {
|
||||
ar.Logs = &loggingclient.Logs{}
|
||||
|
||||
if logQuery.Operation == loggingv1alpha2.OperationExport {
|
||||
response.Header().Set(restful.HEADER_ContentType, "text/plain")
|
||||
response.Header().Set("Content-Disposition", "attachment")
|
||||
if noHit {
|
||||
return
|
||||
}
|
||||
|
||||
err = h.lo.ExportLogs(sf, response)
|
||||
if err != nil {
|
||||
api.HandleInternalError(response, request, err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if noHit {
|
||||
ar.Logs = &loggingclient.Logs{}
|
||||
}
|
||||
|
||||
ar, err = h.lo.SearchLogs(sf, logQuery.From, logQuery.Size, logQuery.Sort)
|
||||
if err != nil {
|
||||
api.HandleError(response, request, err)
|
||||
return
|
||||
}
|
||||
response.WriteEntity(ar)
|
||||
}
|
||||
|
||||
response.WriteEntity(ar)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ func (p *passwordAuthenticator) Authenticate(_ context.Context, username, passwo
|
||||
return nil, providerOptions.Name, err
|
||||
}
|
||||
linkedAccount, err := p.userGetter.findMappedUser(providerOptions.Name, authenticated.GetUserID())
|
||||
if err != nil {
|
||||
if err != nil && !errors.IsNotFound(err) {
|
||||
klog.Error(err)
|
||||
return nil, providerOptions.Name, err
|
||||
}
|
||||
// using this method requires you to manually provision users.
|
||||
@@ -129,7 +130,8 @@ func (p *passwordAuthenticator) Authenticate(_ context.Context, username, passwo
|
||||
return nil, "", err
|
||||
}
|
||||
u := &authuser.DefaultInfo{
|
||||
Name: user.Name,
|
||||
Name: user.Name,
|
||||
Groups: user.Spec.Groups,
|
||||
}
|
||||
// check if the password is initialized
|
||||
if uninitialized := user.Annotations[iamv1alpha2.UninitializedAnnotation]; uninitialized != "" {
|
||||
|
||||
@@ -19,9 +19,22 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
authuser "k8s.io/apiserver/pkg/authentication/user"
|
||||
iamv1alpha2 "kubesphere.io/api/iam/v1alpha2"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authentication"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authentication/identityprovider"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authentication/oauth"
|
||||
fakeks "kubesphere.io/kubesphere/pkg/client/clientset/versioned/fake"
|
||||
ksinformers "kubesphere.io/kubesphere/pkg/client/informers/externalversions"
|
||||
)
|
||||
|
||||
func TestEncryptPassword(t *testing.T) {
|
||||
@@ -39,3 +52,197 @@ func hashPassword(password string) (string, error) {
|
||||
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.MinCost)
|
||||
return string(bytes), err
|
||||
}
|
||||
|
||||
func Test_passwordAuthenticator_Authenticate(t *testing.T) {
|
||||
|
||||
oauthOptions := &authentication.Options{
|
||||
OAuthOptions: &oauth.Options{
|
||||
IdentityProviders: []oauth.IdentityProviderOptions{
|
||||
{
|
||||
Name: "fakepwd",
|
||||
MappingMethod: "auto",
|
||||
Type: "fakePasswordProvider",
|
||||
Provider: oauth.DynamicOptions{
|
||||
"identities": map[string]interface{}{
|
||||
"user1": map[string]string{
|
||||
"uid": "100001",
|
||||
"email": "user1@kubesphere.io",
|
||||
"username": "user1",
|
||||
"password": "password",
|
||||
},
|
||||
"user2": map[string]string{
|
||||
"uid": "100002",
|
||||
"email": "user2@kubesphere.io",
|
||||
"username": "user2",
|
||||
"password": "password",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
identityprovider.RegisterGenericProvider(&fakePasswordProviderFactory{})
|
||||
if err := identityprovider.SetupWithOptions(oauthOptions.OAuthOptions.IdentityProviders); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ksClient := fakeks.NewSimpleClientset()
|
||||
ksInformerFactory := ksinformers.NewSharedInformerFactory(ksClient, 0)
|
||||
err := ksInformerFactory.Iam().V1alpha2().Users().Informer().GetIndexer().Add(newUser("user1", "100001", "fakepwd"))
|
||||
err = ksInformerFactory.Iam().V1alpha2().Users().Informer().GetIndexer().Add(newUser("user3", "100003", ""))
|
||||
err = ksInformerFactory.Iam().V1alpha2().Users().Informer().GetIndexer().Add(newActiveUser("user4", "password"))
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
authenticator := NewPasswordAuthenticator(
|
||||
ksClient,
|
||||
ksInformerFactory.Iam().V1alpha2().Users().Lister(),
|
||||
oauthOptions,
|
||||
)
|
||||
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
username string
|
||||
password string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
passwordAuthenticator PasswordAuthenticator
|
||||
args args
|
||||
want authuser.Info
|
||||
want1 string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "Should successfully with existing provider user",
|
||||
passwordAuthenticator: authenticator,
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
username: "user1",
|
||||
password: "password",
|
||||
},
|
||||
want: &user.DefaultInfo{
|
||||
Name: "user1",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "Should return register user",
|
||||
passwordAuthenticator: authenticator,
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
username: "user2",
|
||||
password: "password",
|
||||
},
|
||||
want: &user.DefaultInfo{
|
||||
Name: "system:pre-registration",
|
||||
Extra: map[string][]string{
|
||||
"email": {"user2@kubesphere.io"},
|
||||
"idp": {"fakepwd"},
|
||||
"uid": {"100002"},
|
||||
"username": {"user2"},
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "Should failed login",
|
||||
passwordAuthenticator: authenticator,
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
username: "user3",
|
||||
password: "password",
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "Should successfully with internal user",
|
||||
passwordAuthenticator: authenticator,
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
username: "user4",
|
||||
password: "password",
|
||||
},
|
||||
want: &user.DefaultInfo{
|
||||
Name: "user4",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
p := tt.passwordAuthenticator
|
||||
got, _, err := p.Authenticate(tt.args.ctx, tt.args.username, tt.args.password)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("passwordAuthenticator.Authenticate() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("passwordAuthenticator.Authenticate() got = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type fakePasswordProviderFactory struct {
|
||||
}
|
||||
|
||||
type fakePasswordProvider struct {
|
||||
Identities map[string]fakePasswordIdentity `json:"identities"`
|
||||
}
|
||||
|
||||
type fakePasswordIdentity struct {
|
||||
UID string `json:"uid"`
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
func (f fakePasswordIdentity) GetUserID() string {
|
||||
return f.UID
|
||||
}
|
||||
|
||||
func (f fakePasswordIdentity) GetUsername() string {
|
||||
return f.Username
|
||||
}
|
||||
|
||||
func (f fakePasswordIdentity) GetEmail() string {
|
||||
return f.Email
|
||||
}
|
||||
|
||||
func (fakePasswordProviderFactory) Type() string {
|
||||
return "fakePasswordProvider"
|
||||
}
|
||||
|
||||
func (fakePasswordProviderFactory) Create(options oauth.DynamicOptions) (identityprovider.GenericProvider, error) {
|
||||
var fakeProvider fakePasswordProvider
|
||||
if err := mapstructure.Decode(options, &fakeProvider); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &fakeProvider, nil
|
||||
}
|
||||
|
||||
func (l fakePasswordProvider) Authenticate(username string, password string) (identityprovider.Identity, error) {
|
||||
if i, ok := l.Identities[username]; ok && i.Password == password {
|
||||
return i, nil
|
||||
}
|
||||
return nil, errors.NewUnauthorized("authorization failed")
|
||||
}
|
||||
|
||||
func encrypt(password string) (string, error) {
|
||||
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
|
||||
return string(bytes), err
|
||||
}
|
||||
|
||||
func newActiveUser(username string, password string) *iamv1alpha2.User {
|
||||
u := newUser(username, "", "")
|
||||
password, _ = encrypt(password)
|
||||
u.Spec.EncryptedPassword = password
|
||||
s := iamv1alpha2.UserActive
|
||||
u.Status.State = &s
|
||||
return u
|
||||
}
|
||||
|
||||
@@ -259,12 +259,12 @@ func (c *gatewayOperator) GetGateways(namespace string) ([]*v1alpha1.Gateway, er
|
||||
}
|
||||
obj := &v1alpha1.Gateway{}
|
||||
err := c.client.Get(context.TODO(), key, obj)
|
||||
if errors.IsNotFound(err) {
|
||||
return gateways, nil
|
||||
} else if err != nil {
|
||||
|
||||
if err == nil {
|
||||
gateways = append(gateways, obj)
|
||||
} else if err != nil && !errors.IsNotFound(err) {
|
||||
return nil, err
|
||||
}
|
||||
gateways = append(gateways, obj)
|
||||
|
||||
for _, g := range gateways {
|
||||
s := &corev1.Service{}
|
||||
@@ -281,7 +281,7 @@ func (c *gatewayOperator) GetGateways(namespace string) ([]*v1alpha1.Gateway, er
|
||||
}
|
||||
}
|
||||
|
||||
return gateways, err
|
||||
return gateways, nil
|
||||
}
|
||||
|
||||
// Create a Gateway in a namespace
|
||||
@@ -457,8 +457,10 @@ func (c *gatewayOperator) filter(object runtime.Object, filter query.Filter) boo
|
||||
return false
|
||||
}
|
||||
namesapce = svc.Labels["project"]
|
||||
objMeta = svc.ObjectMeta
|
||||
} else {
|
||||
namesapce = gateway.Spec.Conroller.Scope.Namespace
|
||||
objMeta = gateway.ObjectMeta
|
||||
}
|
||||
|
||||
switch filter.Field {
|
||||
|
||||
@@ -182,6 +182,9 @@ func Test_gatewayOperator_GetGateways(t *testing.T) {
|
||||
Type: corev1.ServiceTypeNodePort,
|
||||
},
|
||||
},
|
||||
Status: runtime.RawExtension{
|
||||
Raw: []byte("{\"loadBalancer\":{},\"service\":[{\"name\":\"http\",\"protocol\":\"TCP\",\"port\":80,\"targetPort\":0}]}\n"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1091,19 +1091,21 @@ func (am *amOperator) ListGroupRoleBindings(workspace string, query *query.Query
|
||||
result = append(result, roleBinding)
|
||||
}
|
||||
}
|
||||
devOpsProjects, err := am.devopsProjectLister.List(labels.SelectorFromSet(labels.Set{tenantv1alpha1.WorkspaceLabel: workspace}))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, devOpsProject := range devOpsProjects {
|
||||
roleBindings, err := am.roleBindingGetter.List(devOpsProject.Name, query)
|
||||
if am.devopsProjectLister != nil {
|
||||
devOpsProjects, err := am.devopsProjectLister.List(labels.SelectorFromSet(labels.Set{tenantv1alpha1.WorkspaceLabel: workspace}))
|
||||
if err != nil {
|
||||
klog.Error(err)
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range roleBindings.Items {
|
||||
roleBinding := obj.(*rbacv1.RoleBinding)
|
||||
result = append(result, roleBinding)
|
||||
for _, devOpsProject := range devOpsProjects {
|
||||
roleBindings, err := am.roleBindingGetter.List(devOpsProject.Name, query)
|
||||
if err != nil {
|
||||
klog.Error(err)
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range roleBindings.Items {
|
||||
roleBinding := obj.(*rbacv1.RoleBinding)
|
||||
result = append(result, roleBinding)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
|
||||
@@ -28,9 +28,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
filedNameName = "nodeName"
|
||||
filedPVCName = "pvcName"
|
||||
filedServiceName = "serviceName"
|
||||
fieldNodeName = "nodeName"
|
||||
fieldPVCName = "pvcName"
|
||||
fieldServiceName = "serviceName"
|
||||
fieldStatus = "status"
|
||||
)
|
||||
|
||||
type podsGetter struct {
|
||||
@@ -82,12 +83,14 @@ func (p *podsGetter) filter(object runtime.Object, filter query.Filter) bool {
|
||||
return false
|
||||
}
|
||||
switch filter.Field {
|
||||
case filedNameName:
|
||||
case fieldNodeName:
|
||||
return pod.Spec.NodeName == string(filter.Value)
|
||||
case filedPVCName:
|
||||
case fieldPVCName:
|
||||
return p.podBindPVC(pod, string(filter.Value))
|
||||
case filedServiceName:
|
||||
case fieldServiceName:
|
||||
return p.podBelongToService(pod, string(filter.Value))
|
||||
case fieldStatus:
|
||||
return string(pod.Status.Phase) == string(filter.Value)
|
||||
default:
|
||||
return v1alpha3.DefaultObjectMetaFilter(pod.ObjectMeta, filter)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestListPods(t *testing.T) {
|
||||
Filters: map[query.Field]query.Value{query.FieldNamespace: query.Value("default")},
|
||||
},
|
||||
&api.ListResult{
|
||||
Items: []interface{}{foo4, foo3, foo2, foo1},
|
||||
Items: []interface{}{foo5, foo4, foo3, foo2, foo1},
|
||||
TotalItems: len(pods),
|
||||
},
|
||||
nil,
|
||||
@@ -68,7 +68,7 @@ func TestListPods(t *testing.T) {
|
||||
Ascending: false,
|
||||
Filters: map[query.Field]query.Value{
|
||||
query.FieldNamespace: query.Value("default"),
|
||||
filedPVCName: query.Value(foo4.Spec.Volumes[0].PersistentVolumeClaim.ClaimName),
|
||||
fieldPVCName: query.Value(foo4.Spec.Volumes[0].PersistentVolumeClaim.ClaimName),
|
||||
},
|
||||
},
|
||||
&api.ListResult{
|
||||
@@ -77,6 +77,27 @@ func TestListPods(t *testing.T) {
|
||||
},
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"test status filter",
|
||||
"default",
|
||||
&query.Query{
|
||||
Pagination: &query.Pagination{
|
||||
Limit: 10,
|
||||
Offset: 0,
|
||||
},
|
||||
SortBy: query.FieldName,
|
||||
Ascending: false,
|
||||
Filters: map[query.Field]query.Value{
|
||||
query.FieldNamespace: query.Value("default"),
|
||||
fieldStatus: query.Value(corev1.PodRunning),
|
||||
},
|
||||
},
|
||||
&api.ListResult{
|
||||
Items: []interface{}{foo5},
|
||||
TotalItems: 1,
|
||||
},
|
||||
nil,
|
||||
},
|
||||
}
|
||||
|
||||
getter := prepare()
|
||||
@@ -133,7 +154,16 @@ var (
|
||||
},
|
||||
},
|
||||
}
|
||||
pods = []interface{}{foo1, foo2, foo3, foo4}
|
||||
foo5 = &corev1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo5",
|
||||
Namespace: "default",
|
||||
},
|
||||
Status: corev1.PodStatus{
|
||||
Phase: corev1.PodRunning,
|
||||
},
|
||||
}
|
||||
pods = []interface{}{foo1, foo2, foo3, foo4, foo5}
|
||||
)
|
||||
|
||||
func prepare() v1alpha3.Interface {
|
||||
|
||||
28
pkg/simple/client/es/query/builder_test.go
Normal file
28
pkg/simple/client/es/query/builder_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestQueryBuilder(t *testing.T) {
|
||||
testCase := func() *Query {
|
||||
var mini int32 = 1
|
||||
aaa := NewTerms("aaa", []string{})
|
||||
b := NewBool()
|
||||
b.AppendFilter(NewBool().
|
||||
AppendShould(aaa).
|
||||
WithMinimumShouldMatch(mini))
|
||||
|
||||
return NewQuery().WithBool(b)
|
||||
}
|
||||
|
||||
b := NewBuilder().
|
||||
WithQuery(testCase())
|
||||
|
||||
fmt.Printf("aaaaaa: %+v\n", b)
|
||||
_, err := b.Bytes()
|
||||
if err != nil {
|
||||
t.Fatalf("err jsoniter.Marshal: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
type Options struct {
|
||||
WatchesPath string `json:"watchesPath,omitempty" yaml:"watchesPath"`
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace"`
|
||||
Repository string `json:"repository,omitempty" yaml:"repository"`
|
||||
Tag string `json:"tag,omitempty" yaml:"tag"`
|
||||
}
|
||||
|
||||
// NewGatewayOptions creates a default Gateway Option
|
||||
@@ -33,6 +35,8 @@ func NewGatewayOptions() *Options {
|
||||
return &Options{
|
||||
WatchesPath: "",
|
||||
Namespace: "", //constants.KubeSphereControlNamespace
|
||||
Repository: "",
|
||||
Tag: "",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +63,6 @@ func (s *Options) ApplyTo(options *Options) {
|
||||
func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) {
|
||||
fs.StringVar(&s.WatchesPath, "watches-path", c.WatchesPath, "Path to the watches file to use.")
|
||||
fs.StringVar(&s.Namespace, "namespace", c.Namespace, "Working Namespace of the Gateway's Ingress Controller.")
|
||||
fs.StringVar(&s.Repository, "repository", c.Repository, "The Gateway Controller's image repository")
|
||||
fs.StringVar(&s.Tag, "tag", c.Tag, "The Gateway Controller's image tag")
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/constants"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/monitoring"
|
||||
)
|
||||
|
||||
@@ -167,8 +168,8 @@ var promQLTemplates = map[string]string{
|
||||
|
||||
// ingress
|
||||
"ingress_request_count": `round(sum(increase(nginx_ingress_controller_requests{$1,$2}[$3])))`,
|
||||
"ingress_request_4xx_count": `round(sum(increase(nginx_ingress_controller_requests{$1,$2,status="[4].*"}[$3])))`,
|
||||
"ingress_request_5xx_count": `round(sum(increase(nginx_ingress_controller_requests{$1,$2,status="[5].*"}[$3])))`,
|
||||
"ingress_request_4xx_count": `round(sum(increase(nginx_ingress_controller_requests{$1,$2,status=~"[4].*"}[$3])))`,
|
||||
"ingress_request_5xx_count": `round(sum(increase(nginx_ingress_controller_requests{$1,$2,status=~"[5].*"}[$3])))`,
|
||||
"ingress_active_connections": `sum(avg_over_time(nginx_ingress_controller_nginx_process_connections{$2,state="active"}[$3]))`,
|
||||
"ingress_success_rate": `sum(rate(nginx_ingress_controller_requests{$1,$2,status!~"[4-5].*"}[$3])) / sum(rate(nginx_ingress_controller_requests{$1,$2}[$3]))`,
|
||||
"ingress_request_duration_average": `sum_over_time(nginx_ingress_controller_request_duration_seconds_sum{$1,$2}[$3])/sum_over_time(nginx_ingress_controller_request_duration_seconds_count{$1,$2}[$3])`,
|
||||
@@ -482,13 +483,20 @@ func makeIngressMetricExpr(tmpl string, o monitoring.QueryOptions) string {
|
||||
// For monitoring ingress in the specific namespace
|
||||
// GET /namespaces/{namespace}/ingress/{ingress} or
|
||||
// GET /namespaces/{namespace}/ingress
|
||||
if o.NamespaceName != "" {
|
||||
if o.NamespaceName != constants.KubeSphereNamespace {
|
||||
if o.Ingress != "" {
|
||||
ingressSelector = fmt.Sprintf(`exported_namespace="%s", ingress="%s"`, o.NamespaceName, o.Ingress)
|
||||
} else {
|
||||
ingressSelector = fmt.Sprintf(`exported_namespace="%s", ingress=~"%s"`, o.NamespaceName, o.ResourceFilter)
|
||||
}
|
||||
} else {
|
||||
if o.Ingress != "" {
|
||||
ingressSelector = fmt.Sprintf(`ingress="%s"`, o.Ingress)
|
||||
} else {
|
||||
ingressSelector = fmt.Sprintf(`ingress=~"%s"`, o.ResourceFilter)
|
||||
}
|
||||
}
|
||||
|
||||
// job is a reqiuried filter
|
||||
// GET /namespaces/{namespace}/ingress?job=xxx&pod=xxx
|
||||
if o.Job != "" {
|
||||
|
||||
@@ -16,32 +16,7 @@ limitations under the License.
|
||||
|
||||
package net
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// 0 is considered as a non valid port
|
||||
func IsValidPort(port int) bool {
|
||||
return port > 0 && port < 65535
|
||||
}
|
||||
|
||||
func GetRequestIP(req *http.Request) string {
|
||||
address := strings.Trim(req.Header.Get("X-Real-Ip"), " ")
|
||||
if address != "" {
|
||||
return address
|
||||
}
|
||||
|
||||
address = strings.Trim(req.Header.Get("X-Forwarded-For"), " ")
|
||||
if address != "" {
|
||||
return address
|
||||
}
|
||||
|
||||
address, _, err := net.SplitHostPort(req.RemoteAddr)
|
||||
if err != nil {
|
||||
return req.RemoteAddr
|
||||
}
|
||||
|
||||
return address
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ func init() {
|
||||
&FederatedUserList{},
|
||||
&FederatedGroup{},
|
||||
&FederatedGroupList{},
|
||||
&FederatedGroupBinding{},
|
||||
&FederatedGroupBindingList{},
|
||||
&FederatedWorkspace{},
|
||||
&FederatedWorkspaceList{},
|
||||
&FederatedWorkspaceRole{},
|
||||
|
||||
@@ -155,6 +155,9 @@ func (f *Framework) GenericClient(userAgent string) client.Client {
|
||||
Host: ctx.Host,
|
||||
Username: ctx.Username,
|
||||
Password: ctx.Password,
|
||||
ContentConfig: rest.ContentConfig{
|
||||
ContentType: runtime.ContentTypeJSON,
|
||||
},
|
||||
}
|
||||
|
||||
rest.AddUserAgent(config, userAgent)
|
||||
|
||||
@@ -34,13 +34,10 @@ import (
|
||||
func NewClient(s *runtime.Scheme, user, passsword string) (client.Client, error) {
|
||||
|
||||
ctx := framework.TestContext
|
||||
token, err := getToken(ctx.Host, user, passsword)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config := &rest.Config{
|
||||
Host: ctx.Host,
|
||||
BearerToken: token.AccessToken,
|
||||
Host: ctx.Host,
|
||||
Username: user,
|
||||
Password: passsword,
|
||||
}
|
||||
|
||||
return generic.New(config, client.Options{Scheme: s})
|
||||
@@ -48,13 +45,10 @@ func NewClient(s *runtime.Scheme, user, passsword string) (client.Client, error)
|
||||
|
||||
func NewRestClient(user, passsword string) (*restclient.RestClient, error) {
|
||||
ctx := framework.TestContext
|
||||
token, err := getToken(ctx.Host, user, passsword)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config := &rest.Config{
|
||||
Host: ctx.Host,
|
||||
BearerToken: token.AccessToken,
|
||||
Host: ctx.Host,
|
||||
Username: user,
|
||||
Password: passsword,
|
||||
}
|
||||
|
||||
return restclient.NewForConfig(config)
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
|
||||
"kubesphere.io/api/iam/v1alpha2"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/utils/stringutils"
|
||||
"kubesphere.io/kubesphere/test/e2e/constant"
|
||||
"kubesphere.io/kubesphere/test/e2e/framework"
|
||||
"kubesphere.io/kubesphere/test/e2e/framework/iam"
|
||||
@@ -73,6 +74,11 @@ var _ = Describe("Groups", func() {
|
||||
_, err = restClient.IamV1alpha2().Groups().CreateBinding(context.TODO(), workspace, group, UserName)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
Eventually(func() bool {
|
||||
user, err := iam.GetUser(adminClient, UserName)
|
||||
return err == nil && stringutils.FindString(user.Spec.Groups, group) != -1
|
||||
}, timeout, interval).Should(BeTrue())
|
||||
|
||||
By("Creating a new client with user authentication")
|
||||
userClient, err = iam.NewClient(f.GetScheme(), u.Name, constant.DefaultPassword)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
2
vendor/github.com/json-iterator/go/README.md
generated
vendored
2
vendor/github.com/json-iterator/go/README.md
generated
vendored
@@ -8,8 +8,6 @@
|
||||
|
||||
A high-performance 100% compatible drop-in replacement of "encoding/json"
|
||||
|
||||
You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go)
|
||||
|
||||
# Benchmark
|
||||
|
||||

|
||||
|
||||
2
vendor/github.com/json-iterator/go/go.mod
generated
vendored
2
vendor/github.com/json-iterator/go/go.mod
generated
vendored
@@ -6,6 +6,6 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/google/gofuzz v1.0.0
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
|
||||
github.com/modern-go/reflect2 v1.0.2
|
||||
github.com/stretchr/testify v1.3.0
|
||||
)
|
||||
|
||||
4
vendor/github.com/json-iterator/go/go.sum
generated
vendored
4
vendor/github.com/json-iterator/go/go.sum
generated
vendored
@@ -5,8 +5,8 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
|
||||
3
vendor/github.com/json-iterator/go/iter_float.go
generated
vendored
3
vendor/github.com/json-iterator/go/iter_float.go
generated
vendored
@@ -288,6 +288,9 @@ non_decimal_loop:
|
||||
return iter.readFloat64SlowPath()
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint64(ind)
|
||||
if value > maxFloat64 {
|
||||
return iter.readFloat64SlowPath()
|
||||
}
|
||||
}
|
||||
}
|
||||
return iter.readFloat64SlowPath()
|
||||
|
||||
3
vendor/github.com/json-iterator/go/iter_int.go
generated
vendored
3
vendor/github.com/json-iterator/go/iter_int.go
generated
vendored
@@ -9,6 +9,7 @@ var intDigits []int8
|
||||
|
||||
const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1
|
||||
const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1
|
||||
const maxFloat64 = 1<<53 - 1
|
||||
|
||||
func init() {
|
||||
intDigits = make([]int8, 256)
|
||||
@@ -339,7 +340,7 @@ func (iter *Iterator) readUint64(c byte) (ret uint64) {
|
||||
}
|
||||
|
||||
func (iter *Iterator) assertInteger() {
|
||||
if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' {
|
||||
if iter.head < iter.tail && iter.buf[iter.head] == '.' {
|
||||
iter.ReportError("assertInteger", "can not decode float as int")
|
||||
}
|
||||
}
|
||||
|
||||
2
vendor/github.com/json-iterator/go/reflect.go
generated
vendored
2
vendor/github.com/json-iterator/go/reflect.go
generated
vendored
@@ -65,7 +65,7 @@ func (iter *Iterator) ReadVal(obj interface{}) {
|
||||
decoder := iter.cfg.getDecoderFromCache(cacheKey)
|
||||
if decoder == nil {
|
||||
typ := reflect2.TypeOf(obj)
|
||||
if typ.Kind() != reflect.Ptr {
|
||||
if typ == nil || typ.Kind() != reflect.Ptr {
|
||||
iter.ReportError("ReadVal", "can only unmarshal into pointer")
|
||||
return
|
||||
}
|
||||
|
||||
24
vendor/github.com/json-iterator/go/reflect_json_raw_message.go
generated
vendored
24
vendor/github.com/json-iterator/go/reflect_json_raw_message.go
generated
vendored
@@ -33,11 +33,19 @@ type jsonRawMessageCodec struct {
|
||||
}
|
||||
|
||||
func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||
*((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
|
||||
if iter.ReadNil() {
|
||||
*((*json.RawMessage)(ptr)) = nil
|
||||
} else {
|
||||
*((*json.RawMessage)(ptr)) = iter.SkipAndReturnBytes()
|
||||
}
|
||||
}
|
||||
|
||||
func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
|
||||
stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
|
||||
if *((*json.RawMessage)(ptr)) == nil {
|
||||
stream.WriteNil()
|
||||
} else {
|
||||
stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
|
||||
}
|
||||
}
|
||||
|
||||
func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
|
||||
@@ -48,11 +56,19 @@ type jsoniterRawMessageCodec struct {
|
||||
}
|
||||
|
||||
func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||
*((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
|
||||
if iter.ReadNil() {
|
||||
*((*RawMessage)(ptr)) = nil
|
||||
} else {
|
||||
*((*RawMessage)(ptr)) = iter.SkipAndReturnBytes()
|
||||
}
|
||||
}
|
||||
|
||||
func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
|
||||
stream.WriteRaw(string(*((*RawMessage)(ptr))))
|
||||
if *((*RawMessage)(ptr)) == nil {
|
||||
stream.WriteNil()
|
||||
} else {
|
||||
stream.WriteRaw(string(*((*RawMessage)(ptr))))
|
||||
}
|
||||
}
|
||||
|
||||
func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
|
||||
|
||||
5
vendor/github.com/json-iterator/go/reflect_struct_decoder.go
generated
vendored
5
vendor/github.com/json-iterator/go/reflect_struct_decoder.go
generated
vendored
@@ -1075,6 +1075,11 @@ type stringModeNumberDecoder struct {
|
||||
}
|
||||
|
||||
func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||
if iter.WhatIsNext() == NilValue {
|
||||
decoder.elemDecoder.Decode(ptr, iter)
|
||||
return
|
||||
}
|
||||
|
||||
c := iter.nextToken()
|
||||
if c != '"' {
|
||||
iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
|
||||
|
||||
2
vendor/github.com/modern-go/reflect2/.travis.yml
generated
vendored
2
vendor/github.com/modern-go/reflect2/.travis.yml
generated
vendored
@@ -1,7 +1,7 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.x
|
||||
|
||||
before_install:
|
||||
|
||||
8
vendor/github.com/modern-go/reflect2/Gopkg.lock
generated
vendored
8
vendor/github.com/modern-go/reflect2/Gopkg.lock
generated
vendored
@@ -1,15 +1,9 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/modern-go/concurrent"
|
||||
packages = ["."]
|
||||
revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a"
|
||||
version = "1.0.0"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7"
|
||||
input-imports = []
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
||||
4
vendor/github.com/modern-go/reflect2/Gopkg.toml
generated
vendored
4
vendor/github.com/modern-go/reflect2/Gopkg.toml
generated
vendored
@@ -26,10 +26,6 @@
|
||||
|
||||
ignored = []
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/modern-go/concurrent"
|
||||
version = "1.0.0"
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
||||
|
||||
3
vendor/github.com/modern-go/reflect2/go.mod
generated
vendored
Normal file
3
vendor/github.com/modern-go/reflect2/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/modern-go/reflect2
|
||||
|
||||
go 1.12
|
||||
23
vendor/github.com/modern-go/reflect2/go_above_118.go
generated
vendored
Normal file
23
vendor/github.com/modern-go/reflect2/go_above_118.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
//+build go1.18
|
||||
|
||||
package reflect2
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// m escapes into the return value, but the caller of mapiterinit
|
||||
// doesn't let the return value escape.
|
||||
//go:noescape
|
||||
//go:linkname mapiterinit reflect.mapiterinit
|
||||
func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer, it *hiter)
|
||||
|
||||
func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
|
||||
var it hiter
|
||||
mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj), &it)
|
||||
return &UnsafeMapIterator{
|
||||
hiter: &it,
|
||||
pKeyRType: type2.pKeyRType,
|
||||
pElemRType: type2.pElemRType,
|
||||
}
|
||||
}
|
||||
8
vendor/github.com/modern-go/reflect2/go_above_17.go
generated
vendored
8
vendor/github.com/modern-go/reflect2/go_above_17.go
generated
vendored
@@ -1,8 +0,0 @@
|
||||
//+build go1.7
|
||||
|
||||
package reflect2
|
||||
|
||||
import "unsafe"
|
||||
|
||||
//go:linkname resolveTypeOff reflect.resolveTypeOff
|
||||
func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
|
||||
3
vendor/github.com/modern-go/reflect2/go_above_19.go
generated
vendored
3
vendor/github.com/modern-go/reflect2/go_above_19.go
generated
vendored
@@ -6,6 +6,9 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
//go:linkname resolveTypeOff reflect.resolveTypeOff
|
||||
func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
|
||||
|
||||
//go:linkname makemap reflect.makemap
|
||||
func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer)
|
||||
|
||||
|
||||
21
vendor/github.com/modern-go/reflect2/go_below_118.go
generated
vendored
Normal file
21
vendor/github.com/modern-go/reflect2/go_below_118.go
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
//+build !go1.18
|
||||
|
||||
package reflect2
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// m escapes into the return value, but the caller of mapiterinit
|
||||
// doesn't let the return value escape.
|
||||
//go:noescape
|
||||
//go:linkname mapiterinit reflect.mapiterinit
|
||||
func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter)
|
||||
|
||||
func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
|
||||
return &UnsafeMapIterator{
|
||||
hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
|
||||
pKeyRType: type2.pKeyRType,
|
||||
pElemRType: type2.pElemRType,
|
||||
}
|
||||
}
|
||||
9
vendor/github.com/modern-go/reflect2/go_below_17.go
generated
vendored
9
vendor/github.com/modern-go/reflect2/go_below_17.go
generated
vendored
@@ -1,9 +0,0 @@
|
||||
//+build !go1.7
|
||||
|
||||
package reflect2
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
|
||||
return nil
|
||||
}
|
||||
14
vendor/github.com/modern-go/reflect2/go_below_19.go
generated
vendored
14
vendor/github.com/modern-go/reflect2/go_below_19.go
generated
vendored
@@ -1,14 +0,0 @@
|
||||
//+build !go1.9
|
||||
|
||||
package reflect2
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
//go:linkname makemap reflect.makemap
|
||||
func makemap(rtype unsafe.Pointer) (m unsafe.Pointer)
|
||||
|
||||
func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
|
||||
return makemap(rtype)
|
||||
}
|
||||
20
vendor/github.com/modern-go/reflect2/reflect2.go
generated
vendored
20
vendor/github.com/modern-go/reflect2/reflect2.go
generated
vendored
@@ -1,8 +1,9 @@
|
||||
package reflect2
|
||||
|
||||
import (
|
||||
"github.com/modern-go/concurrent"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -130,13 +131,13 @@ var ConfigSafe = Config{UseSafeImplementation: true}.Froze()
|
||||
|
||||
type frozenConfig struct {
|
||||
useSafeImplementation bool
|
||||
cache *concurrent.Map
|
||||
cache *sync.Map
|
||||
}
|
||||
|
||||
func (cfg Config) Froze() *frozenConfig {
|
||||
return &frozenConfig{
|
||||
useSafeImplementation: cfg.UseSafeImplementation,
|
||||
cache: concurrent.NewMap(),
|
||||
cache: new(sync.Map),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,11 +289,12 @@ func NoEscape(p unsafe.Pointer) unsafe.Pointer {
|
||||
}
|
||||
|
||||
func UnsafeCastString(str string) []byte {
|
||||
bytes := make([]byte, 0)
|
||||
stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str))
|
||||
sliceHeader := &reflect.SliceHeader{
|
||||
Data: stringHeader.Data,
|
||||
Cap: stringHeader.Len,
|
||||
Len: stringHeader.Len,
|
||||
}
|
||||
return *(*[]byte)(unsafe.Pointer(sliceHeader))
|
||||
sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&bytes))
|
||||
sliceHeader.Data = stringHeader.Data
|
||||
sliceHeader.Cap = stringHeader.Len
|
||||
sliceHeader.Len = stringHeader.Len
|
||||
runtime.KeepAlive(str)
|
||||
return bytes
|
||||
}
|
||||
|
||||
12
vendor/github.com/modern-go/reflect2/test.sh
generated
vendored
12
vendor/github.com/modern-go/reflect2/test.sh
generated
vendored
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
echo "" > coverage.txt
|
||||
|
||||
for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do
|
||||
go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
51
vendor/github.com/modern-go/reflect2/type_map.go
generated
vendored
51
vendor/github.com/modern-go/reflect2/type_map.go
generated
vendored
@@ -1,17 +1,13 @@
|
||||
// +build !gccgo
|
||||
|
||||
package reflect2
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// typelinks1 for 1.5 ~ 1.6
|
||||
//go:linkname typelinks1 reflect.typelinks
|
||||
func typelinks1() [][]unsafe.Pointer
|
||||
|
||||
// typelinks2 for 1.7 ~
|
||||
//go:linkname typelinks2 reflect.typelinks
|
||||
func typelinks2() (sections []unsafe.Pointer, offset [][]int32)
|
||||
@@ -27,49 +23,10 @@ func discoverTypes() {
|
||||
types = make(map[string]reflect.Type)
|
||||
packages = make(map[string]map[string]reflect.Type)
|
||||
|
||||
ver := runtime.Version()
|
||||
if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") {
|
||||
loadGo15Types()
|
||||
} else if ver == "go1.6" || strings.HasPrefix(ver, "go1.6.") {
|
||||
loadGo15Types()
|
||||
} else {
|
||||
loadGo17Types()
|
||||
}
|
||||
loadGoTypes()
|
||||
}
|
||||
|
||||
func loadGo15Types() {
|
||||
var obj interface{} = reflect.TypeOf(0)
|
||||
typePtrss := typelinks1()
|
||||
for _, typePtrs := range typePtrss {
|
||||
for _, typePtr := range typePtrs {
|
||||
(*emptyInterface)(unsafe.Pointer(&obj)).word = typePtr
|
||||
typ := obj.(reflect.Type)
|
||||
if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct {
|
||||
loadedType := typ.Elem()
|
||||
pkgTypes := packages[loadedType.PkgPath()]
|
||||
if pkgTypes == nil {
|
||||
pkgTypes = map[string]reflect.Type{}
|
||||
packages[loadedType.PkgPath()] = pkgTypes
|
||||
}
|
||||
types[loadedType.String()] = loadedType
|
||||
pkgTypes[loadedType.Name()] = loadedType
|
||||
}
|
||||
if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Ptr &&
|
||||
typ.Elem().Elem().Kind() == reflect.Struct {
|
||||
loadedType := typ.Elem().Elem()
|
||||
pkgTypes := packages[loadedType.PkgPath()]
|
||||
if pkgTypes == nil {
|
||||
pkgTypes = map[string]reflect.Type{}
|
||||
packages[loadedType.PkgPath()] = pkgTypes
|
||||
}
|
||||
types[loadedType.String()] = loadedType
|
||||
pkgTypes[loadedType.Name()] = loadedType
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func loadGo17Types() {
|
||||
func loadGoTypes() {
|
||||
var obj interface{} = reflect.TypeOf(0)
|
||||
sections, offset := typelinks2()
|
||||
for i, offs := range offset {
|
||||
|
||||
26
vendor/github.com/modern-go/reflect2/unsafe_link.go
generated
vendored
26
vendor/github.com/modern-go/reflect2/unsafe_link.go
generated
vendored
@@ -19,18 +19,12 @@ func typedslicecopy(elemType unsafe.Pointer, dst, src sliceHeader) int
|
||||
|
||||
//go:linkname mapassign reflect.mapassign
|
||||
//go:noescape
|
||||
func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer)
|
||||
func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer, val unsafe.Pointer)
|
||||
|
||||
//go:linkname mapaccess reflect.mapaccess
|
||||
//go:noescape
|
||||
func mapaccess(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer)
|
||||
|
||||
// m escapes into the return value, but the caller of mapiterinit
|
||||
// doesn't let the return value escape.
|
||||
//go:noescape
|
||||
//go:linkname mapiterinit reflect.mapiterinit
|
||||
func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) *hiter
|
||||
|
||||
//go:noescape
|
||||
//go:linkname mapiternext reflect.mapiternext
|
||||
func mapiternext(it *hiter)
|
||||
@@ -42,9 +36,21 @@ func ifaceE2I(rtype unsafe.Pointer, src interface{}, dst unsafe.Pointer)
|
||||
// If you modify hiter, also change cmd/internal/gc/reflect.go to indicate
|
||||
// the layout of this structure.
|
||||
type hiter struct {
|
||||
key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/internal/gc/range.go).
|
||||
value unsafe.Pointer // Must be in second position (see cmd/internal/gc/range.go).
|
||||
// rest fields are ignored
|
||||
key unsafe.Pointer
|
||||
value unsafe.Pointer
|
||||
t unsafe.Pointer
|
||||
h unsafe.Pointer
|
||||
buckets unsafe.Pointer
|
||||
bptr unsafe.Pointer
|
||||
overflow *[]unsafe.Pointer
|
||||
oldoverflow *[]unsafe.Pointer
|
||||
startBucket uintptr
|
||||
offset uint8
|
||||
wrapped bool
|
||||
B uint8
|
||||
i uint8
|
||||
bucket uintptr
|
||||
checkBucket uintptr
|
||||
}
|
||||
|
||||
// add returns p+x.
|
||||
|
||||
8
vendor/github.com/modern-go/reflect2/unsafe_map.go
generated
vendored
8
vendor/github.com/modern-go/reflect2/unsafe_map.go
generated
vendored
@@ -107,14 +107,6 @@ func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator {
|
||||
return type2.UnsafeIterate(objEFace.data)
|
||||
}
|
||||
|
||||
func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
|
||||
return &UnsafeMapIterator{
|
||||
hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
|
||||
pKeyRType: type2.pKeyRType,
|
||||
pElemRType: type2.pElemRType,
|
||||
}
|
||||
}
|
||||
|
||||
type UnsafeMapIterator struct {
|
||||
*hiter
|
||||
pKeyRType unsafe.Pointer
|
||||
|
||||
1
vendor/kubesphere.io/api
generated
vendored
Symbolic link
1
vendor/kubesphere.io/api
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../staging/src/kubesphere.io/api
|
||||
201
vendor/kubesphere.io/api/LICENSE
generated
vendored
201
vendor/kubesphere.io/api/LICENSE
generated
vendored
@@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
29
vendor/kubesphere.io/api/application/crdinstall/install.go
generated
vendored
29
vendor/kubesphere.io/api/application/crdinstall/install.go
generated
vendored
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 KubeSphere Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package crdinstall
|
||||
|
||||
import (
|
||||
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
|
||||
"kubesphere.io/api/application/v1alpha1"
|
||||
)
|
||||
|
||||
func Install(scheme *k8sruntime.Scheme) {
|
||||
urlruntime.Must(v1alpha1.AddToScheme(scheme))
|
||||
urlruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
|
||||
}
|
||||
65
vendor/kubesphere.io/api/application/v1alpha1/constants.go
generated
vendored
65
vendor/kubesphere.io/api/application/v1alpha1/constants.go
generated
vendored
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
const (
|
||||
MsgLen = 512
|
||||
HelmRepoSyncStateLen = 10
|
||||
|
||||
// app version state
|
||||
StateDraft = "draft"
|
||||
StateSubmitted = "submitted"
|
||||
StatePassed = "passed"
|
||||
StateRejected = "rejected"
|
||||
StateSuspended = "suspended"
|
||||
StateActive = "active"
|
||||
|
||||
// repo state
|
||||
RepoStateSuccessful = "successful"
|
||||
RepoStateFailed = "failed"
|
||||
RepoStateSyncing = "syncing"
|
||||
|
||||
// helm release state
|
||||
HelmStatusActive = "active"
|
||||
HelmStatusCreating = "creating"
|
||||
HelmStatusDeleting = "deleting"
|
||||
HelmStatusUpgrading = "upgrading"
|
||||
HelmStatusRollbacking = "rollbacking"
|
||||
HelmStatusFailed = "failed"
|
||||
HelmStatusCreated = "created"
|
||||
HelmStatusUpgraded = "upgraded"
|
||||
|
||||
AttachmentTypeScreenshot = "screenshot"
|
||||
AttachmentTypeIcon = "icon"
|
||||
|
||||
HelmApplicationAppStoreSuffix = "-store"
|
||||
HelmApplicationIdPrefix = "app-"
|
||||
HelmRepoIdPrefix = "repo-"
|
||||
BuiltinRepoPrefix = "builtin-"
|
||||
HelmApplicationVersionIdPrefix = "appv-"
|
||||
HelmCategoryIdPrefix = "ctg-"
|
||||
HelmAttachmentPrefix = "att-"
|
||||
HelmReleasePrefix = "rls-"
|
||||
UncategorizedName = "uncategorized"
|
||||
UncategorizedId = "ctg-uncategorized"
|
||||
AppStoreRepoId = "repo-helm"
|
||||
|
||||
ApplicationInstance = "app.kubesphere.io/instance"
|
||||
|
||||
RepoSyncPeriod = "app.kubesphere.io/sync-period"
|
||||
OriginWorkspaceLabelKey = "kubesphere.io/workspace-origin"
|
||||
)
|
||||
136
vendor/kubesphere.io/api/application/v1alpha1/helmapplication_types.go
generated
vendored
136
vendor/kubesphere.io/api/application/v1alpha1/helmapplication_types.go
generated
vendored
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"kubesphere.io/api/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindHelmApplication = "HelmApplication"
|
||||
ResourceSingularHelmApplication = "helmapplication"
|
||||
ResourcePluralHelmApplication = "helmapplications"
|
||||
)
|
||||
|
||||
// HelmApplicationSpec defines the desired state of HelmApplication
|
||||
type HelmApplicationSpec struct {
|
||||
// the name of the helm application
|
||||
Name string `json:"name"`
|
||||
// description from chart's description or frontend
|
||||
Description string `json:"description,omitempty"`
|
||||
// attachments id
|
||||
Attachments []string `json:"attachments,omitempty"`
|
||||
// info from frontend
|
||||
Abstraction string `json:"abstraction,omitempty"`
|
||||
AppHome string `json:"appHome,omitempty"`
|
||||
// The attachment id of the icon
|
||||
Icon string `json:"icon,omitempty"`
|
||||
}
|
||||
|
||||
// HelmApplicationStatus defines the observed state of HelmApplication
|
||||
type HelmApplicationStatus struct {
|
||||
// If this application belong to appStore, latestVersion is the the latest version of the active application version.
|
||||
// otherwise latestVersion is the latest version of all application version
|
||||
LatestVersion string `json:"latestVersion,omitempty"`
|
||||
// the state of the helm application: draft, submitted, passed, rejected, suspended, active
|
||||
State string `json:"state,omitempty"`
|
||||
UpdateTime *metav1.Time `json:"updateTime"`
|
||||
StatusTime *metav1.Time `json:"statusTime"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=happ
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="application name",type=string,JSONPath=`.spec.name`
|
||||
// +kubebuilder:printcolumn:name="workspace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/workspace"
|
||||
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmApplication is the Schema for the helmapplications API
|
||||
type HelmApplication struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HelmApplicationSpec `json:"spec,omitempty"`
|
||||
Status HelmApplicationStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmApplicationList contains a list of HelmApplication
|
||||
type HelmApplicationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HelmApplication `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&HelmApplication{}, &HelmApplicationList{})
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetTrueName() string {
|
||||
return in.Spec.Name
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetHelmRepoId() string {
|
||||
return getValue(in.Labels, constants.ChartRepoIdLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetHelmApplicationId() string {
|
||||
return strings.TrimSuffix(in.Name, HelmApplicationAppStoreSuffix)
|
||||
}
|
||||
func (in *HelmApplication) GetHelmCategoryId() string {
|
||||
return getValue(in.Labels, constants.CategoryIdLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetWorkspace() string {
|
||||
ws := getValue(in.Labels, constants.WorkspaceLabelKey)
|
||||
if ws == "" {
|
||||
return getValue(in.Labels, OriginWorkspaceLabelKey)
|
||||
}
|
||||
return ws
|
||||
}
|
||||
|
||||
func getValue(m map[string]string, key string) string {
|
||||
if m == nil {
|
||||
return ""
|
||||
}
|
||||
return m[key]
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetCategoryId() string {
|
||||
return getValue(in.Labels, constants.CategoryIdLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplication) State() string {
|
||||
if in.Status.State == "" {
|
||||
return StateDraft
|
||||
}
|
||||
return in.Status.State
|
||||
}
|
||||
|
||||
func (in *HelmApplication) GetCreator() string {
|
||||
return getValue(in.Annotations, constants.CreatorAnnotationKey)
|
||||
}
|
||||
233
vendor/kubesphere.io/api/application/v1alpha1/helmapplicationversion_types.go
generated
vendored
233
vendor/kubesphere.io/api/application/v1alpha1/helmapplicationversion_types.go
generated
vendored
@@ -1,233 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"kubesphere.io/api/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindHelmApplicationVersion = "HelmApplicationVersion"
|
||||
ResourceSingularHelmApplicationVersion = "helmapplicationversion"
|
||||
ResourcePluralHelmApplicationVersion = "helmapplicationversions"
|
||||
)
|
||||
|
||||
// HelmApplicationVersionSpec defines the desired state of HelmApplicationVersion
|
||||
type HelmApplicationVersionSpec struct {
|
||||
// metadata from chart
|
||||
*Metadata `json:",inline"`
|
||||
// chart url
|
||||
URLs []string `json:"urls,omitempty"`
|
||||
// raw data of chart, it will !!!NOT!!! be save to etcd
|
||||
Data []byte `json:"data,omitempty"`
|
||||
|
||||
// dataKey in the storage
|
||||
DataKey string `json:"dataKey,omitempty"`
|
||||
|
||||
// chart create time
|
||||
Created *metav1.Time `json:"created,omitempty"`
|
||||
|
||||
// chart digest
|
||||
Digest string `json:"digest,omitempty"`
|
||||
}
|
||||
|
||||
// HelmApplicationVersionStatus defines the observed state of HelmApplicationVersion
|
||||
type HelmApplicationVersionStatus struct {
|
||||
State string `json:"state,omitempty"`
|
||||
Audit []Audit `json:"audit,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=happver
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="application name",type=string,JSONPath=`.spec.name`
|
||||
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmApplicationVersion is the Schema for the helmapplicationversions API
|
||||
type HelmApplicationVersion struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HelmApplicationVersionSpec `json:"spec,omitempty"`
|
||||
Status HelmApplicationVersionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// Maintainer describes a Chart maintainer.
|
||||
type Maintainer struct {
|
||||
// Name is a user name or organization name
|
||||
Name string `json:"name,omitempty"`
|
||||
// Email is an optional email address to contact the named maintainer
|
||||
Email string `json:"email,omitempty"`
|
||||
// URL is an optional URL to an address for the named maintainer
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// Metadata for a Chart file. This models the structure of a Chart.yaml file.
|
||||
type Metadata struct {
|
||||
// The name of the chart
|
||||
Name string `json:"name,omitempty"`
|
||||
// The URL to a relevant project page, git repo, or contact person
|
||||
Home string `json:"home,omitempty"`
|
||||
// Source is the URL to the source code of this chart
|
||||
Sources []string `json:"sources,omitempty"`
|
||||
// A SemVer 2 conformant version string of the chart
|
||||
Version string `json:"version,omitempty"`
|
||||
// A one-sentence description of the chart
|
||||
Description string `json:"description,omitempty"`
|
||||
// A list of string keywords
|
||||
Keywords []string `json:"keywords,omitempty"`
|
||||
// A list of name and URL/email address combinations for the maintainer(s)
|
||||
Maintainers []*Maintainer `json:"maintainers,omitempty"`
|
||||
// The URL to an icon file.
|
||||
Icon string `json:"icon,omitempty"`
|
||||
// The API Version of this chart.
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
// The condition to check to enable chart
|
||||
Condition string `json:"condition,omitempty"`
|
||||
// The tags to check to enable chart
|
||||
Tags string `json:"tags,omitempty"`
|
||||
// The version of the application enclosed inside of this chart.
|
||||
AppVersion string `json:"appVersion,omitempty"`
|
||||
// Whether or not this chart is deprecated
|
||||
Deprecated bool `json:"deprecated,omitempty"`
|
||||
// Annotations are additional mappings uninterpreted by Helm,
|
||||
// made available for inspection by other applications.
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
|
||||
KubeVersion string `json:"kubeVersion,omitempty"`
|
||||
// Dependencies are a list of dependencies for a chart.
|
||||
Dependencies []*Dependency `json:"dependencies,omitempty"`
|
||||
// Specifies the chart type: application or library
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type Audit struct {
|
||||
// audit message
|
||||
Message string `json:"message,omitempty"`
|
||||
// audit state: submitted, passed, draft, active, rejected, suspended
|
||||
State string `json:"state,omitempty"`
|
||||
// audit time
|
||||
Time metav1.Time `json:"time"`
|
||||
// audit operator
|
||||
Operator string `json:"operator,omitempty"`
|
||||
OperatorType string `json:"operatorType,omitempty"`
|
||||
}
|
||||
|
||||
// Dependency describes a chart upon which another chart depends.
|
||||
// Dependencies can be used to express developer intent, or to capture the state
|
||||
// of a chart.
|
||||
type Dependency struct {
|
||||
// Name is the name of the dependency.
|
||||
// This must mach the name in the dependency's Chart.yaml.
|
||||
Name string `json:"name"`
|
||||
// Version is the version (range) of this chart.
|
||||
// A lock file will always produce a single version, while a dependency
|
||||
// may contain a semantic version range.
|
||||
Version string `json:"version,omitempty"`
|
||||
// The URL to the repository.
|
||||
// Appending `index.yaml` to this string should result in a URL that can be
|
||||
// used to fetch the repository index.
|
||||
Repository string `json:"repository"`
|
||||
// A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
|
||||
Condition string `json:"condition,omitempty"`
|
||||
// Tags can be used to group charts for enabling/disabling together
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
// Enabled bool determines if chart should be loaded
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
// ImportValues holds the mapping of source values to parent key to be imported. Each item can be a
|
||||
// string or pair of child/parent sublist items.
|
||||
// ImportValues []interface{} `json:"import_values,omitempty"`
|
||||
|
||||
// Alias usable alias to be used for the chart
|
||||
Alias string `json:"alias,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmApplicationVersionList contains a list of HelmApplicationVersion
|
||||
type HelmApplicationVersionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HelmApplicationVersion `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&HelmApplicationVersion{}, &HelmApplicationVersionList{})
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetCreator() string {
|
||||
return getValue(in.Annotations, constants.CreatorAnnotationKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetHelmApplicationVersionId() string {
|
||||
return in.Name
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetWorkspace() string {
|
||||
return getValue(in.Labels, constants.WorkspaceLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetVersionName() string {
|
||||
appV := in.GetChartAppVersion()
|
||||
if appV != "" {
|
||||
return fmt.Sprintf("%s [%s]", in.GetChartVersion(), appV)
|
||||
} else {
|
||||
return in.GetChartVersion()
|
||||
}
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetHelmApplicationId() string {
|
||||
return getValue(in.Labels, constants.ChartApplicationIdLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetSemver() string {
|
||||
return strings.Split(in.GetVersionName(), " ")[0]
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetTrueName() string {
|
||||
return in.Spec.Name
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetChartVersion() string {
|
||||
return in.Spec.Version
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetChartAppVersion() string {
|
||||
return in.Spec.AppVersion
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) GetHelmRepoId() string {
|
||||
return getValue(in.Labels, constants.ChartRepoIdLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmApplicationVersion) State() string {
|
||||
if in.Status.State == "" {
|
||||
return StateDraft
|
||||
}
|
||||
|
||||
return in.Status.State
|
||||
}
|
||||
81
vendor/kubesphere.io/api/application/v1alpha1/helmcategory_types.go
generated
vendored
81
vendor/kubesphere.io/api/application/v1alpha1/helmcategory_types.go
generated
vendored
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindHelmCategory = "HelmCategory"
|
||||
ResourceSingularHelmCategory = "helmcategory"
|
||||
ResourcePluralHelmCategory = "helmcategories"
|
||||
)
|
||||
|
||||
// HelmCategorySpec defines the desired state of HelmRepo
|
||||
type HelmCategorySpec struct {
|
||||
// name of the category
|
||||
Name string `json:"name"`
|
||||
// info from frontend
|
||||
Description string `json:"description,omitempty"`
|
||||
Locale string `json:"locale,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=hctg
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="name",type=string,JSONPath=`.spec.name`
|
||||
// +kubebuilder:printcolumn:name="total",type=string,JSONPath=`.status.total`
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmCategory is the Schema for the helmcategories API
|
||||
type HelmCategory struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HelmCategorySpec `json:"spec,omitempty"`
|
||||
Status HelmCategoryStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type HelmCategoryStatus struct {
|
||||
// total helmapplications belong to this category
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmCategoryList contains a list of HelmCategory
|
||||
type HelmCategoryList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HelmCategory `json:"items"`
|
||||
}
|
||||
|
||||
func (in *HelmCategory) GetTrueName() string {
|
||||
if in == nil {
|
||||
return ""
|
||||
}
|
||||
return in.Spec.Name
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&HelmCategory{}, &HelmCategoryList{})
|
||||
}
|
||||
154
vendor/kubesphere.io/api/application/v1alpha1/helmrelease_types.go
generated
vendored
154
vendor/kubesphere.io/api/application/v1alpha1/helmrelease_types.go
generated
vendored
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"kubesphere.io/api/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindHelmRelease = "HelmRelease"
|
||||
ResourceSingularHelmRelease = "helmrelease"
|
||||
ResourcePluralHelmRelease = "helmreleases"
|
||||
)
|
||||
|
||||
// HelmReleaseSpec defines the desired state of HelmRelease
|
||||
type HelmReleaseSpec struct {
|
||||
// Name of the release
|
||||
Name string `json:"name"`
|
||||
// Message got from frontend
|
||||
Description string `json:"description,omitempty"`
|
||||
// helm release values.yaml
|
||||
Values []byte `json:"values,omitempty"`
|
||||
// The name of the chart which will be installed.
|
||||
ChartName string `json:"chartName"`
|
||||
// Specify the exact chart version to install. If this is not specified, the latest version is installed
|
||||
ChartVersion string `json:"chartVersion"`
|
||||
// appVersion from Chart.yaml
|
||||
ChartAppVersion string `json:"chartAppVer,omitempty"`
|
||||
// id of the repo
|
||||
RepoId string `json:"repoId,omitempty"`
|
||||
// id of the helmapplication
|
||||
ApplicationId string `json:"appId,omitempty"`
|
||||
// application version id
|
||||
ApplicationVersionId string `json:"appVerId,omitempty"`
|
||||
// expected release version, when this version is not equal status.version, the release need upgrade
|
||||
// this filed should be modified when any filed of the spec modified.
|
||||
Version int `json:"version"`
|
||||
}
|
||||
|
||||
type HelmReleaseDeployStatus struct {
|
||||
// A human readable message indicating details about why the release is in this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
// current state of the release
|
||||
State string `json:"state"`
|
||||
// deploy time, upgrade time or check status time
|
||||
Time metav1.Time `json:"deployTime"`
|
||||
}
|
||||
|
||||
// HelmReleaseStatus defines the observed state of HelmRelease
|
||||
type HelmReleaseStatus struct {
|
||||
// current state
|
||||
State string `json:"state"`
|
||||
// A human readable message indicating details about why the release is in this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
// current release version
|
||||
Version int `json:"version,omitempty"`
|
||||
// deploy status list of history, which will store at most 10 state
|
||||
DeployStatus []HelmReleaseDeployStatus `json:"deployStatus,omitempty"`
|
||||
// last update time
|
||||
LastUpdate metav1.Time `json:"lastUpdate,omitempty"`
|
||||
// last deploy time or upgrade time
|
||||
LastDeployed *metav1.Time `json:"lastDeployed,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=hrls
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="Release Name",type=string,JSONPath=".spec.name"
|
||||
// +kubebuilder:printcolumn:name="Workspace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/workspace"
|
||||
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.kubesphere\\.io/cluster"
|
||||
// +kubebuilder:printcolumn:name="Namespace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/namespace"
|
||||
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmRelease is the Schema for the helmreleases API
|
||||
type HelmRelease struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HelmReleaseSpec `json:"spec,omitempty"`
|
||||
Status HelmReleaseStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmReleaseList contains a list of HelmRelease
|
||||
type HelmReleaseList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HelmRelease `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&HelmRelease{}, &HelmReleaseList{})
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetCreator() string {
|
||||
return getValue(in.Annotations, constants.CreatorAnnotationKey)
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetTrueName() string {
|
||||
return in.Spec.Name
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetChartVersionName() string {
|
||||
appV := in.GetChartAppVersion()
|
||||
if appV != "" {
|
||||
return fmt.Sprintf("%s [%s]", in.GetChartVersion(), appV)
|
||||
} else {
|
||||
return in.GetChartVersion()
|
||||
}
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetChartAppVersion() string {
|
||||
return in.Spec.ChartAppVersion
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetChartVersion() string {
|
||||
return in.Spec.ChartVersion
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetRlsCluster() string {
|
||||
return getValue(in.Labels, constants.ClusterNameLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetWorkspace() string {
|
||||
return getValue(in.Labels, constants.WorkspaceLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmRelease) GetRlsNamespace() string {
|
||||
return getValue(in.Labels, constants.NamespaceLabelKey)
|
||||
}
|
||||
141
vendor/kubesphere.io/api/application/v1alpha1/helmrepo_types.go
generated
vendored
141
vendor/kubesphere.io/api/application/v1alpha1/helmrepo_types.go
generated
vendored
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"kubesphere.io/api/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindHelmRepo = "HelmRepo"
|
||||
ResourceSingularHelmRepo = "helmrepo"
|
||||
ResourcePluralHelmRepo = "helmrepos"
|
||||
)
|
||||
|
||||
type HelmRepoCredential struct {
|
||||
// chart repository username
|
||||
Username string `json:"username,omitempty"`
|
||||
// chart repository password
|
||||
Password string `json:"password,omitempty"`
|
||||
// identify HTTPS client using this SSL certificate file
|
||||
CertFile string `json:"certFile,omitempty"`
|
||||
// identify HTTPS client using this SSL key file
|
||||
KeyFile string `json:"keyFile,omitempty"`
|
||||
// verify certificates of HTTPS-enabled servers using this CA bundle
|
||||
CAFile string `json:"caFile,omitempty"`
|
||||
// skip tls certificate checks for the repository, default is ture
|
||||
InsecureSkipTLSVerify *bool `json:"insecureSkipTLSVerify,omitempty"`
|
||||
|
||||
S3Config `json:",inline"`
|
||||
}
|
||||
|
||||
type S3Config struct {
|
||||
AccessKeyID string `json:"accessKeyID,omitempty"`
|
||||
SecretAccessKey string `json:"secretAccessKey,omitempty"`
|
||||
}
|
||||
|
||||
// HelmRepoSpec defines the desired state of HelmRepo
|
||||
type HelmRepoSpec struct {
|
||||
// name of the repo
|
||||
Name string `json:"name"`
|
||||
// helm repo url
|
||||
Url string `json:"url"`
|
||||
// helm repo credential
|
||||
Credential HelmRepoCredential `json:"credential,omitempty"`
|
||||
// chart repo description from frontend
|
||||
Description string `json:"description,omitempty"`
|
||||
// sync period in seconds, no sync when SyncPeriod=0, the minimum SyncPeriod is 180s
|
||||
SyncPeriod int `json:"syncPeriod,omitempty"`
|
||||
// expected repo version, when this version is not equal status.version, the repo need upgrade
|
||||
// this filed should be modified when any filed of the spec modified.
|
||||
Version int `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
type HelmRepoSyncState struct {
|
||||
// last sync state, valid state are: "failed", "success", and ""
|
||||
State string `json:"state,omitempty"`
|
||||
// A human readable message indicating details about why the repo is in this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
SyncTime *metav1.Time `json:"syncTime"`
|
||||
}
|
||||
|
||||
// HelmRepoStatus defines the observed state of HelmRepo
|
||||
type HelmRepoStatus struct {
|
||||
// repo index
|
||||
Data string `json:"data,omitempty"`
|
||||
// status last update time
|
||||
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
|
||||
// current state of the repo, successful, failed or syncing
|
||||
State string `json:"state,omitempty"`
|
||||
// sync state list of history, which will store at most 10 state
|
||||
SyncState []HelmRepoSyncState `json:"syncState,omitempty"`
|
||||
// if status.version!=spec.Version, we need sync the repo now
|
||||
Version int `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:scope=Cluster,path=helmrepos,shortName=hrepo
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="name",type=string,JSONPath=`.spec.name`
|
||||
// +kubebuilder:printcolumn:name="Workspace",type="string",JSONPath=".metadata.labels.kubesphere\\.io/workspace"
|
||||
// +kubebuilder:printcolumn:name="url",type=string,JSONPath=`.spec.url`
|
||||
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state"
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmRepo is the Schema for the helmrepoes API
|
||||
type HelmRepo struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec HelmRepoSpec `json:"spec,omitempty"`
|
||||
Status HelmRepoStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// HelmRepoList contains a list of HelmRepo
|
||||
type HelmRepoList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []HelmRepo `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&HelmRepo{}, &HelmRepoList{})
|
||||
}
|
||||
|
||||
func (in *HelmRepo) GetTrueName() string {
|
||||
return in.Spec.Name
|
||||
}
|
||||
|
||||
func (in *HelmRepo) GetHelmRepoId() string {
|
||||
return in.Name
|
||||
}
|
||||
|
||||
func (in *HelmRepo) GetWorkspace() string {
|
||||
return getValue(in.Labels, constants.WorkspaceLabelKey)
|
||||
}
|
||||
|
||||
func (in *HelmRepo) GetCreator() string {
|
||||
return getValue(in.Annotations, constants.CreatorAnnotationKey)
|
||||
}
|
||||
40
vendor/kubesphere.io/api/application/v1alpha1/register.go
generated
vendored
40
vendor/kubesphere.io/api/application/v1alpha1/register.go
generated
vendored
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the application v1alpha1 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=application.kubesphere.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "application.kubesphere.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
742
vendor/kubesphere.io/api/application/v1alpha1/zz_generated.deepcopy.go
generated
vendored
742
vendor/kubesphere.io/api/application/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@@ -1,742 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Audit) DeepCopyInto(out *Audit) {
|
||||
*out = *in
|
||||
in.Time.DeepCopyInto(&out.Time)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Audit.
|
||||
func (in *Audit) DeepCopy() *Audit {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Audit)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Dependency) DeepCopyInto(out *Dependency) {
|
||||
*out = *in
|
||||
if in.Tags != nil {
|
||||
in, out := &in.Tags, &out.Tags
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dependency.
|
||||
func (in *Dependency) DeepCopy() *Dependency {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Dependency)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplication) DeepCopyInto(out *HelmApplication) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplication.
|
||||
func (in *HelmApplication) DeepCopy() *HelmApplication {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplication)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmApplication) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationList) DeepCopyInto(out *HelmApplicationList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmApplication, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationList.
|
||||
func (in *HelmApplicationList) DeepCopy() *HelmApplicationList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmApplicationList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationSpec) DeepCopyInto(out *HelmApplicationSpec) {
|
||||
*out = *in
|
||||
if in.Attachments != nil {
|
||||
in, out := &in.Attachments, &out.Attachments
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationSpec.
|
||||
func (in *HelmApplicationSpec) DeepCopy() *HelmApplicationSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationStatus) DeepCopyInto(out *HelmApplicationStatus) {
|
||||
*out = *in
|
||||
if in.UpdateTime != nil {
|
||||
in, out := &in.UpdateTime, &out.UpdateTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.StatusTime != nil {
|
||||
in, out := &in.StatusTime, &out.StatusTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationStatus.
|
||||
func (in *HelmApplicationStatus) DeepCopy() *HelmApplicationStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationVersion) DeepCopyInto(out *HelmApplicationVersion) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationVersion.
|
||||
func (in *HelmApplicationVersion) DeepCopy() *HelmApplicationVersion {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationVersion)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmApplicationVersion) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationVersionList) DeepCopyInto(out *HelmApplicationVersionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmApplicationVersion, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationVersionList.
|
||||
func (in *HelmApplicationVersionList) DeepCopy() *HelmApplicationVersionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationVersionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmApplicationVersionList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationVersionSpec) DeepCopyInto(out *HelmApplicationVersionSpec) {
|
||||
*out = *in
|
||||
if in.Metadata != nil {
|
||||
in, out := &in.Metadata, &out.Metadata
|
||||
*out = new(Metadata)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.URLs != nil {
|
||||
in, out := &in.URLs, &out.URLs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Data != nil {
|
||||
in, out := &in.Data, &out.Data
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Created != nil {
|
||||
in, out := &in.Created, &out.Created
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationVersionSpec.
|
||||
func (in *HelmApplicationVersionSpec) DeepCopy() *HelmApplicationVersionSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationVersionSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmApplicationVersionStatus) DeepCopyInto(out *HelmApplicationVersionStatus) {
|
||||
*out = *in
|
||||
if in.Audit != nil {
|
||||
in, out := &in.Audit, &out.Audit
|
||||
*out = make([]Audit, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmApplicationVersionStatus.
|
||||
func (in *HelmApplicationVersionStatus) DeepCopy() *HelmApplicationVersionStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmApplicationVersionStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmCategory) DeepCopyInto(out *HelmCategory) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmCategory.
|
||||
func (in *HelmCategory) DeepCopy() *HelmCategory {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmCategory)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmCategory) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmCategoryList) DeepCopyInto(out *HelmCategoryList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmCategory, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmCategoryList.
|
||||
func (in *HelmCategoryList) DeepCopy() *HelmCategoryList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmCategoryList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmCategoryList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmCategorySpec) DeepCopyInto(out *HelmCategorySpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmCategorySpec.
|
||||
func (in *HelmCategorySpec) DeepCopy() *HelmCategorySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmCategorySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmCategoryStatus) DeepCopyInto(out *HelmCategoryStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmCategoryStatus.
|
||||
func (in *HelmCategoryStatus) DeepCopy() *HelmCategoryStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmCategoryStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRelease) DeepCopyInto(out *HelmRelease) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRelease.
|
||||
func (in *HelmRelease) DeepCopy() *HelmRelease {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRelease)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmRelease) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseDeployStatus) DeepCopyInto(out *HelmReleaseDeployStatus) {
|
||||
*out = *in
|
||||
in.Time.DeepCopyInto(&out.Time)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseDeployStatus.
|
||||
func (in *HelmReleaseDeployStatus) DeepCopy() *HelmReleaseDeployStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseDeployStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseList) DeepCopyInto(out *HelmReleaseList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmRelease, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseList.
|
||||
func (in *HelmReleaseList) DeepCopy() *HelmReleaseList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmReleaseList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) {
|
||||
*out = *in
|
||||
if in.Values != nil {
|
||||
in, out := &in.Values, &out.Values
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseSpec.
|
||||
func (in *HelmReleaseSpec) DeepCopy() *HelmReleaseSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmReleaseStatus) DeepCopyInto(out *HelmReleaseStatus) {
|
||||
*out = *in
|
||||
if in.DeployStatus != nil {
|
||||
in, out := &in.DeployStatus, &out.DeployStatus
|
||||
*out = make([]HelmReleaseDeployStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
in.LastUpdate.DeepCopyInto(&out.LastUpdate)
|
||||
if in.LastDeployed != nil {
|
||||
in, out := &in.LastDeployed, &out.LastDeployed
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseStatus.
|
||||
func (in *HelmReleaseStatus) DeepCopy() *HelmReleaseStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmReleaseStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepo) DeepCopyInto(out *HelmRepo) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepo.
|
||||
func (in *HelmRepo) DeepCopy() *HelmRepo {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepo)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmRepo) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepoCredential) DeepCopyInto(out *HelmRepoCredential) {
|
||||
*out = *in
|
||||
if in.InsecureSkipTLSVerify != nil {
|
||||
in, out := &in.InsecureSkipTLSVerify, &out.InsecureSkipTLSVerify
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
out.S3Config = in.S3Config
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepoCredential.
|
||||
func (in *HelmRepoCredential) DeepCopy() *HelmRepoCredential {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepoCredential)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepoList) DeepCopyInto(out *HelmRepoList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HelmRepo, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepoList.
|
||||
func (in *HelmRepoList) DeepCopy() *HelmRepoList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepoList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *HelmRepoList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepoSpec) DeepCopyInto(out *HelmRepoSpec) {
|
||||
*out = *in
|
||||
in.Credential.DeepCopyInto(&out.Credential)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepoSpec.
|
||||
func (in *HelmRepoSpec) DeepCopy() *HelmRepoSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepoSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepoStatus) DeepCopyInto(out *HelmRepoStatus) {
|
||||
*out = *in
|
||||
if in.LastUpdateTime != nil {
|
||||
in, out := &in.LastUpdateTime, &out.LastUpdateTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.SyncState != nil {
|
||||
in, out := &in.SyncState, &out.SyncState
|
||||
*out = make([]HelmRepoSyncState, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepoStatus.
|
||||
func (in *HelmRepoStatus) DeepCopy() *HelmRepoStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepoStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HelmRepoSyncState) DeepCopyInto(out *HelmRepoSyncState) {
|
||||
*out = *in
|
||||
if in.SyncTime != nil {
|
||||
in, out := &in.SyncTime, &out.SyncTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepoSyncState.
|
||||
func (in *HelmRepoSyncState) DeepCopy() *HelmRepoSyncState {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HelmRepoSyncState)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Maintainer) DeepCopyInto(out *Maintainer) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Maintainer.
|
||||
func (in *Maintainer) DeepCopy() *Maintainer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Maintainer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Metadata) DeepCopyInto(out *Metadata) {
|
||||
*out = *in
|
||||
if in.Sources != nil {
|
||||
in, out := &in.Sources, &out.Sources
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Keywords != nil {
|
||||
in, out := &in.Keywords, &out.Keywords
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Maintainers != nil {
|
||||
in, out := &in.Maintainers, &out.Maintainers
|
||||
*out = make([]*Maintainer, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(Maintainer)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Dependencies != nil {
|
||||
in, out := &in.Dependencies, &out.Dependencies
|
||||
*out = make([]*Dependency, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(Dependency)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.
|
||||
func (in *Metadata) DeepCopy() *Metadata {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Metadata)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S3Config) DeepCopyInto(out *S3Config) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Config.
|
||||
func (in *S3Config) DeepCopy() *S3Config {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S3Config)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
19
vendor/kubesphere.io/api/auditing/v1alpha1/doc.go
generated
vendored
19
vendor/kubesphere.io/api/auditing/v1alpha1/doc.go
generated
vendored
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the audit v1alpha1 API group
|
||||
// +groupName=auditing.kubesphere.io
|
||||
package v1alpha1
|
||||
41
vendor/kubesphere.io/api/auditing/v1alpha1/register.go
generated
vendored
41
vendor/kubesphere.io/api/auditing/v1alpha1/register.go
generated
vendored
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// NOTE: Boilerplate only. Ignore this file.
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the audit v1alpha1 API group
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +groupName=auditing.kubesphere.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "auditing.kubesphere.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
91
vendor/kubesphere.io/api/auditing/v1alpha1/rule_types.go
generated
vendored
91
vendor/kubesphere.io/api/auditing/v1alpha1/rule_types.go
generated
vendored
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
type PolicyRule struct {
|
||||
// Rule name
|
||||
Name string `json:"name,omitempty" protobuf:"bytes,8,opt,name=name"`
|
||||
// Rule type, rule, macro,list,alias
|
||||
Type string `json:"type,omitempty" protobuf:"bytes,8,opt,name=type"`
|
||||
// Rule describe
|
||||
Desc string `json:"desc,omitempty" protobuf:"bytes,8,opt,name=desc"`
|
||||
// Rule condition
|
||||
// This effective When the rule type is rule
|
||||
Condition string `json:"condition,omitempty" protobuf:"bytes,8,opt,name=condition"`
|
||||
// This effective When the rule type is macro
|
||||
Macro string `json:"macro,omitempty" protobuf:"bytes,8,opt,name=macro"`
|
||||
// This effective When the rule type is alias
|
||||
Alias string `json:"alias,omitempty" protobuf:"bytes,8,opt,name=alias"`
|
||||
// This effective When the rule type is list
|
||||
List []string `json:"list,omitempty" protobuf:"bytes,8,opt,name=list"`
|
||||
// Is the rule enable
|
||||
Enable bool `json:"enable" protobuf:"bytes,8,opt,name=enable"`
|
||||
// The output formater of message which send to user
|
||||
Output string `json:"output,omitempty" protobuf:"bytes,8,opt,name=output"`
|
||||
// Rule priority, DEBUG, INFO, WARNING
|
||||
Priority string `json:"priority,omitempty" protobuf:"bytes,8,opt,name=priority"`
|
||||
}
|
||||
|
||||
// AuditRuleSpec defines the desired state of Rule
|
||||
type RuleSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
PolicyRules []PolicyRule `json:"rules,omitempty" protobuf:"bytes,8,opt,name=rules"`
|
||||
}
|
||||
|
||||
// AuditRuleStatus defines the observed state of Rule
|
||||
type RuleStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:noStatus
|
||||
// +genclient:nonNamespaced
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Rule is the Schema for the rules API
|
||||
type Rule struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec RuleSpec `json:"spec,omitempty"`
|
||||
Status RuleStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// AuditRuleList contains a list of Rule
|
||||
type RuleList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Rule `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Rule{}, &RuleList{})
|
||||
}
|
||||
261
vendor/kubesphere.io/api/auditing/v1alpha1/webhook_types.go
generated
vendored
261
vendor/kubesphere.io/api/auditing/v1alpha1/webhook_types.go
generated
vendored
@@ -1,261 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// Receiver config which received the audit alert
|
||||
type Receiver struct {
|
||||
// Receiver name
|
||||
// +optional
|
||||
ReceicerName string `json:"name,omitempty" protobuf:"bytes,8,opt,name=name"`
|
||||
// Receiver type, alertmanager or webhook
|
||||
// +optional
|
||||
ReceiverType string `json:"type,omitempty" protobuf:"bytes,8,opt,name=type"`
|
||||
// ClientConfig holds the connection parameters for the webhook
|
||||
// +optional
|
||||
ReceiverConfig *WebhookClientConfig `json:"config,omitempty" protobuf:"bytes,8,opt,name=config"`
|
||||
}
|
||||
|
||||
type AuditSinkPolicy struct {
|
||||
ArchivingRuleSelector *metav1.LabelSelector `json:"archivingRuleSelector,omitempty" protobuf:"bytes,8,opt,name=archivingRuleSelector"`
|
||||
AlertingRuleSelector *metav1.LabelSelector `json:"alertingRuleSelector,omitempty" protobuf:"bytes,8,opt,name=alertingRuleSelector"`
|
||||
}
|
||||
|
||||
type DynamicAuditConfig struct {
|
||||
// Throttle holds the options for throttling the webhook
|
||||
// +optional
|
||||
Throttle *WebhookThrottleConfig `json:"throttle,omitempty" protobuf:"bytes,18,opt,name=throttle"`
|
||||
// Policy defines the policy for selecting which events should be sent to the webhook
|
||||
// +optional
|
||||
Policy *Policy `json:"policy,omitempty" protobuf:"bytes,18,opt,name=policy"`
|
||||
}
|
||||
|
||||
type Policy struct {
|
||||
// The Level that all requests are recorded at.
|
||||
// available options: None, Metadata, Request, RequestResponse
|
||||
// required
|
||||
Level Level `json:"level" protobuf:"bytes,1,opt,name=level"`
|
||||
|
||||
// Stages is a list of stages for which events are created.
|
||||
// +optional
|
||||
Stages []Stage `json:"stages" protobuf:"bytes,2,opt,name=stages"`
|
||||
}
|
||||
|
||||
type Stage string
|
||||
|
||||
type Level string
|
||||
|
||||
type WebhookThrottleConfig struct {
|
||||
// ThrottleQPS maximum number of batches per second
|
||||
// default 10 QPS
|
||||
// +optional
|
||||
QPS *int64 `json:"qps,omitempty" protobuf:"bytes,1,opt,name=qps"`
|
||||
|
||||
// ThrottleBurst is the maximum number of events sent at the same moment
|
||||
// default 15 QPS
|
||||
// +optional
|
||||
Burst *int64 `json:"burst,omitempty" protobuf:"bytes,2,opt,name=burst"`
|
||||
}
|
||||
|
||||
// WebhookSpec defines the desired state of Webhook
|
||||
type WebhookSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
// Number of desired pods. This is a pointer to distinguish between explicit
|
||||
// zero and not specified. Defaults to 1.
|
||||
// +optional
|
||||
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
|
||||
// The webhook docker image name.
|
||||
// +optional
|
||||
Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"`
|
||||
// Image pull policy.
|
||||
// One of Always, Never, IfNotPresent.
|
||||
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
|
||||
// Cannot be updated.
|
||||
// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
|
||||
// +optional
|
||||
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"`
|
||||
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
|
||||
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
|
||||
// in the case of docker, only DockerConfig type secrets are honored.
|
||||
// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
|
||||
// +optional
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"`
|
||||
// Arguments to the entrypoint..
|
||||
// It will be appended to the args and replace the default value.
|
||||
// +optional
|
||||
Args []string `json:"args,omitempty" protobuf:"bytes,3,rep,name=args"`
|
||||
// NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
// Selector which must match a node's labels for the pod to be scheduled on that node.
|
||||
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
|
||||
// +optional
|
||||
NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
|
||||
// If specified, the pod's scheduling constraints
|
||||
// +optional
|
||||
Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"`
|
||||
// If specified, the pod's tolerations.
|
||||
// +optional
|
||||
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
|
||||
// Compute Resources required by this container.
|
||||
// Cannot be updated.
|
||||
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||
// +optional
|
||||
Resources *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
|
||||
// Receiver contains the information to make a connection with the alertmanager
|
||||
// +optional
|
||||
Receivers []Receiver `json:"receivers,omitempty" protobuf:"bytes,8,opt,name=receivers"`
|
||||
|
||||
// AuditSinkPolicy is a rule selector, only the rule matched this selector will be taked effect.
|
||||
// +optional
|
||||
*AuditSinkPolicy `json:"auditSinkPolicy,omitempty" protobuf:"bytes,8,opt,name=auditSinkPolicy"`
|
||||
// Rule priority, DEBUG < INFO < WARNING
|
||||
//Audit events will be stored only when the priority of the audit rule
|
||||
// matching the audit event is greater than this.
|
||||
Priority string `json:"priority,omitempty" protobuf:"bytes,8,opt,name=priority"`
|
||||
// Audit type, static or dynamic.
|
||||
AuditType string `json:"auditType,omitempty" protobuf:"bytes,8,opt,name=auditType"`
|
||||
// The Level that all requests are recorded at.
|
||||
// available options: None, Metadata, Request, RequestResponse
|
||||
// default: Metadata
|
||||
// +optional
|
||||
AuditLevel Level `json:"auditLevel" protobuf:"bytes,1,opt,name=auditLevel"`
|
||||
// K8s auditing is enabled or not.
|
||||
K8sAuditingEnabled bool `json:"k8sAuditingEnabled,omitempty" protobuf:"bytes,8,opt,name=priority"`
|
||||
}
|
||||
|
||||
type WebhookClientConfig struct {
|
||||
// `url` gives the location of the webhook, in standard URL form
|
||||
// (`scheme://host:port/path`). Exactly one of `url` or `service`
|
||||
// must be specified.
|
||||
//
|
||||
// The `host` should not refer to a service running in the cluster; use
|
||||
// the `service` field instead. The host might be resolved via external
|
||||
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
|
||||
// in-cluster DNS as that would be a layering violation). `host` may
|
||||
// also be an IP address.
|
||||
//
|
||||
// Please note that using `localhost` or `127.0.0.1` as a `host` is
|
||||
// risky unless you take great care to run this webhook on all hosts
|
||||
// which run an apiserver which might need to make calls to this
|
||||
// webhook. Such installs are likely to be non-portable, i.e., not easy
|
||||
// to turn up in a new cluster.
|
||||
//
|
||||
// The scheme must be "https"; the URL must begin with "https://".
|
||||
//
|
||||
// A path is optional, and if present may be any string permissible in
|
||||
// a URL. You may use the path to pass an arbitrary string to the
|
||||
// webhook, for example, a cluster identifier.
|
||||
//
|
||||
// Attempting to use a user or basic auth e.g. "user:password@" is not
|
||||
// allowed. Fragments ("#...") and query parameters ("?...") are not
|
||||
// allowed, either.
|
||||
//
|
||||
// +optional
|
||||
URL *string `json:"url,omitempty" protobuf:"bytes,1,opt,name=url"`
|
||||
|
||||
// `service` is a reference to the service for this webhook. Either
|
||||
// `service` or `url` must be specified.
|
||||
//
|
||||
// If the webhook is running within the cluster, then you should use `service`.
|
||||
//
|
||||
// +optional
|
||||
Service *ServiceReference `json:"service,omitempty" protobuf:"bytes,2,opt,name=service"`
|
||||
|
||||
// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
|
||||
// If unspecified, system trust roots on the apiserver are used.
|
||||
// +optional
|
||||
CABundle []byte `json:"caBundle,omitempty" protobuf:"bytes,3,opt,name=caBundle"`
|
||||
}
|
||||
|
||||
// WebhookStatus defines the observed state of Webhook
|
||||
type WebhookStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:noStatus
|
||||
// +genclient:nonNamespaced
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Webhook is the Schema for the webhooks API
|
||||
type Webhook struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec WebhookSpec `json:"spec,omitempty"`
|
||||
Status WebhookStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// WebhookList contains a list of Webhook
|
||||
type WebhookList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Webhook `json:"items"`
|
||||
}
|
||||
|
||||
type ServiceReference struct {
|
||||
// `namespace` is the namespace of the service.
|
||||
// Required
|
||||
Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
|
||||
|
||||
// `name` is the name of the service.
|
||||
// Required
|
||||
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
|
||||
|
||||
// `path` is an optional URL path which will be sent in any request to
|
||||
// this service.
|
||||
// +optional
|
||||
Path *string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"`
|
||||
|
||||
// If specified, the port on the service that hosting webhook.
|
||||
// Default to 443 for backward compatibility.
|
||||
// `port` should be a valid port number (1-65535, inclusive).
|
||||
// +optional
|
||||
Port *int32 `json:"port,omitempty" protobuf:"varint,4,opt,name=port"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Webhook{}, &WebhookList{})
|
||||
}
|
||||
|
||||
const (
|
||||
// LevelNone disables auditing
|
||||
LevelNone Level = "None"
|
||||
// LevelMetadata provides the basic level of auditing.
|
||||
LevelMetadata Level = "Metadata"
|
||||
// LevelRequest provides Metadata level of auditing, and additionally
|
||||
// logs the request object (does not apply for non-resource requests).
|
||||
LevelRequest Level = "Request"
|
||||
// LevelRequestResponse provides Request level of auditing, and additionally
|
||||
// logs the response object (does not apply for non-resource requests and watches).
|
||||
LevelRequestResponse Level = "RequestResponse"
|
||||
)
|
||||
454
vendor/kubesphere.io/api/auditing/v1alpha1/zz_generated.deepcopy.go
generated
vendored
454
vendor/kubesphere.io/api/auditing/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@@ -1,454 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuditSinkPolicy) DeepCopyInto(out *AuditSinkPolicy) {
|
||||
*out = *in
|
||||
if in.ArchivingRuleSelector != nil {
|
||||
in, out := &in.ArchivingRuleSelector, &out.ArchivingRuleSelector
|
||||
*out = new(v1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.AlertingRuleSelector != nil {
|
||||
in, out := &in.AlertingRuleSelector, &out.AlertingRuleSelector
|
||||
*out = new(v1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditSinkPolicy.
|
||||
func (in *AuditSinkPolicy) DeepCopy() *AuditSinkPolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AuditSinkPolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DynamicAuditConfig) DeepCopyInto(out *DynamicAuditConfig) {
|
||||
*out = *in
|
||||
if in.Throttle != nil {
|
||||
in, out := &in.Throttle, &out.Throttle
|
||||
*out = new(WebhookThrottleConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Policy != nil {
|
||||
in, out := &in.Policy, &out.Policy
|
||||
*out = new(Policy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicAuditConfig.
|
||||
func (in *DynamicAuditConfig) DeepCopy() *DynamicAuditConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DynamicAuditConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PolicyRule) DeepCopyInto(out *PolicyRule) {
|
||||
*out = *in
|
||||
if in.List != nil {
|
||||
in, out := &in.List, &out.List
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRule.
|
||||
func (in *PolicyRule) DeepCopy() *PolicyRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PolicyRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Receiver) DeepCopyInto(out *Receiver) {
|
||||
*out = *in
|
||||
in.ReceiverConfig.DeepCopyInto(out.ReceiverConfig)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Receiver.
|
||||
func (in *Receiver) DeepCopy() *Receiver {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Receiver)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Rule) DeepCopyInto(out *Rule) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
|
||||
func (in *Rule) DeepCopy() *Rule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Rule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Rule) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RuleList) DeepCopyInto(out *RuleList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Rule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleList.
|
||||
func (in *RuleList) DeepCopy() *RuleList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RuleList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *RuleList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RuleSpec) DeepCopyInto(out *RuleSpec) {
|
||||
*out = *in
|
||||
if in.PolicyRules != nil {
|
||||
in, out := &in.PolicyRules, &out.PolicyRules
|
||||
*out = make([]PolicyRule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSpec.
|
||||
func (in *RuleSpec) DeepCopy() *RuleSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RuleSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RuleStatus) DeepCopyInto(out *RuleStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleStatus.
|
||||
func (in *RuleStatus) DeepCopy() *RuleStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RuleStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Webhook) DeepCopyInto(out *Webhook) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook.
|
||||
func (in *Webhook) DeepCopy() *Webhook {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Webhook)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Webhook) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookList) DeepCopyInto(out *WebhookList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Webhook, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookList.
|
||||
func (in *WebhookList) DeepCopy() *WebhookList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *WebhookList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookSpec) DeepCopyInto(out *WebhookSpec) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.ImagePullSecrets != nil {
|
||||
in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
|
||||
*out = make([]corev1.LocalObjectReference, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Args != nil {
|
||||
in, out := &in.Args, &out.Args
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.NodeSelector != nil {
|
||||
in, out := &in.NodeSelector, &out.NodeSelector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Affinity != nil {
|
||||
in, out := &in.Affinity, &out.Affinity
|
||||
*out = new(corev1.Affinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Tolerations != nil {
|
||||
in, out := &in.Tolerations, &out.Tolerations
|
||||
*out = make([]corev1.Toleration, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Resources != nil {
|
||||
in, out := &in.Resources, &out.Resources
|
||||
*out = new(corev1.ResourceRequirements)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Receivers != nil {
|
||||
in, out := &in.Receivers, &out.Receivers
|
||||
*out = make([]Receiver, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.AuditSinkPolicy != nil {
|
||||
in, out := &in.AuditSinkPolicy, &out.AuditSinkPolicy
|
||||
*out = new(AuditSinkPolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookSpec.
|
||||
func (in *WebhookSpec) DeepCopy() *WebhookSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookStatus) DeepCopyInto(out *WebhookStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookStatus.
|
||||
func (in *WebhookStatus) DeepCopy() *WebhookStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookThrottleConfig) DeepCopyInto(out *WebhookThrottleConfig) {
|
||||
*out = *in
|
||||
if in.QPS != nil {
|
||||
in, out := &in.QPS, &out.QPS
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
if in.Burst != nil {
|
||||
in, out := &in.Burst, &out.Burst
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookThrottleConfig.
|
||||
func (in *WebhookThrottleConfig) DeepCopy() *WebhookThrottleConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookThrottleConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Policy) DeepCopyInto(out *Policy) {
|
||||
*out = *in
|
||||
if in.Stages != nil {
|
||||
in, out := &in.Stages, &out.Stages
|
||||
*out = make([]Stage, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy.
|
||||
func (in *Policy) DeepCopy() *Policy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Policy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) {
|
||||
*out = *in
|
||||
if in.URL != nil {
|
||||
in, out := &in.URL, &out.URL
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Service != nil {
|
||||
in, out := &in.Service, &out.Service
|
||||
*out = new(ServiceReference)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.CABundle != nil {
|
||||
in, out := &in.CABundle, &out.CABundle
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig.
|
||||
func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookClientConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
|
||||
*out = *in
|
||||
if in.Path != nil {
|
||||
|
||||
in, out := &in.Path, &out.Path
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Port != nil {
|
||||
in, out := &in.Port, &out.Port
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference.
|
||||
func (in *ServiceReference) DeepCopy() *ServiceReference {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceReference)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
189
vendor/kubesphere.io/api/cluster/v1alpha1/cluster_types.go
generated
vendored
189
vendor/kubesphere.io/api/cluster/v1alpha1/cluster_types.go
generated
vendored
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 KubeSphere Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindCluster = "Cluster"
|
||||
ResourcesSingularCluster = "cluster"
|
||||
ResourcesPluralCluster = "clusters"
|
||||
|
||||
HostCluster = "cluster-role.kubesphere.io/host"
|
||||
// Description of which region the cluster been placed
|
||||
ClusterRegion = "cluster.kubesphere.io/region"
|
||||
// Name of the cluster group
|
||||
ClusterGroup = "cluster.kubesphere.io/group"
|
||||
|
||||
Finalizer = "finalizer.cluster.kubesphere.io"
|
||||
)
|
||||
|
||||
type ClusterSpec struct {
|
||||
|
||||
// Join cluster as a kubefed cluster
|
||||
JoinFederation bool `json:"joinFederation,omitempty"`
|
||||
|
||||
// Desired state of the cluster
|
||||
Enable bool `json:"enable,omitempty"`
|
||||
|
||||
// Provider of the cluster, this field is just for description
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// Connection holds info to connect to the member cluster
|
||||
Connection Connection `json:"connection,omitempty"`
|
||||
}
|
||||
|
||||
type ConnectionType string
|
||||
|
||||
const (
|
||||
ConnectionTypeDirect ConnectionType = "direct"
|
||||
ConnectionTypeProxy ConnectionType = "proxy"
|
||||
)
|
||||
|
||||
type Connection struct {
|
||||
|
||||
// type defines how host cluster will connect to host cluster
|
||||
// ConnectionTypeDirect means direct connection, this requires
|
||||
// kubeconfig and kubesphere apiserver endpoint provided
|
||||
// ConnectionTypeProxy means using kubesphere proxy, no kubeconfig
|
||||
// or kubesphere apiserver endpoint required
|
||||
Type ConnectionType `json:"type,omitempty"`
|
||||
|
||||
// KubeSphere API Server endpoint. Example: http://10.10.0.11:8080
|
||||
// Should provide this field explicitly if connection type is direct.
|
||||
// Will be populated by ks-apiserver if connection type is proxy.
|
||||
KubeSphereAPIEndpoint string `json:"kubesphereAPIEndpoint,omitempty"`
|
||||
|
||||
// Kubernetes API Server endpoint. Example: https://10.10.0.1:6443
|
||||
// Should provide this field explicitly if connection type is direct.
|
||||
// Will be populated by ks-apiserver if connection type is proxy.
|
||||
KubernetesAPIEndpoint string `json:"kubernetesAPIEndpoint,omitempty"`
|
||||
|
||||
// KubeConfig content used to connect to cluster api server
|
||||
// Should provide this field explicitly if connection type is direct.
|
||||
// Will be populated by ks-proxy if connection type is proxy.
|
||||
KubeConfig []byte `json:"kubeconfig,omitempty"`
|
||||
|
||||
// Token used by agents of member cluster to connect to host cluster proxy.
|
||||
// This field is populated by apiserver only if connection type is proxy.
|
||||
Token string `json:"token,omitempty"`
|
||||
|
||||
// KubeAPIServerPort is the port which listens for forwarding kube-apiserver traffic
|
||||
// Only applicable when connection type is proxy.
|
||||
KubernetesAPIServerPort uint16 `json:"kubernetesAPIServerPort,omitempty"`
|
||||
|
||||
// KubeSphereAPIServerPort is the port which listens for forwarding kubesphere apigateway traffic
|
||||
// Only applicable when connection type is proxy.
|
||||
KubeSphereAPIServerPort uint16 `json:"kubesphereAPIServerPort,omitempty"`
|
||||
}
|
||||
|
||||
type ClusterConditionType string
|
||||
|
||||
const (
|
||||
// Cluster agent is initialized and waiting for connecting
|
||||
ClusterInitialized ClusterConditionType = "Initialized"
|
||||
|
||||
// Cluster agent is available
|
||||
ClusterAgentAvailable ClusterConditionType = "AgentAvailable"
|
||||
|
||||
// Cluster has been one of federated clusters
|
||||
ClusterFederated ClusterConditionType = "Federated"
|
||||
|
||||
// Cluster is all available for requests
|
||||
ClusterReady ClusterConditionType = "Ready"
|
||||
|
||||
// Openpitrix runtime is created
|
||||
ClusterOpenPitrixRuntimeReady ClusterConditionType = "OpenPitrixRuntimeReady"
|
||||
)
|
||||
|
||||
type ClusterCondition struct {
|
||||
// Type of the condition
|
||||
Type ClusterConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// The last time this condition was updated.
|
||||
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// A human readable message indicating details about the transition.
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
type ClusterStatus struct {
|
||||
|
||||
// Represents the latest available observations of a cluster's current state.
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty"`
|
||||
|
||||
// GitVersion of the kubernetes cluster, this field is populated by cluster controller
|
||||
KubernetesVersion string `json:"kubernetesVersion,omitempty"`
|
||||
|
||||
// GitVersion of the /kapis/version api response, this field is populated by cluster controller
|
||||
KubeSphereVersion string `json:"kubeSphereVersion,omitempty"`
|
||||
|
||||
// Count of the kubernetes cluster nodes
|
||||
// This field may not reflect the instant status of the cluster.
|
||||
NodeCount int `json:"nodeCount,omitempty"`
|
||||
|
||||
// Zones are the names of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// +optional
|
||||
Zones []string `json:"zones,omitempty"`
|
||||
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
// +optional
|
||||
Region *string `json:"region,omitempty"`
|
||||
|
||||
// Configz is status of components enabled in the member cluster. This is synchronized with member cluster
|
||||
// every amount of time, like 5 minutes.
|
||||
// +optional
|
||||
Configz map[string]bool `json:"configz,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:openapi-gen=true
|
||||
// +genclient:nonNamespaced
|
||||
// +kubebuilder:printcolumn:name="Federated",type="boolean",JSONPath=".spec.joinFederation"
|
||||
// +kubebuilder:printcolumn:name="Provider",type="string",JSONPath=".spec.provider"
|
||||
// +kubebuilder:printcolumn:name="Active",type="boolean",JSONPath=".spec.enable"
|
||||
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.kubernetesVersion"
|
||||
// +kubebuilder:resource:scope=Cluster
|
||||
|
||||
// Cluster is the schema for the clusters API
|
||||
type Cluster struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ClusterSpec `json:"spec,omitempty"`
|
||||
Status ClusterStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
type ClusterList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Cluster `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
|
||||
}
|
||||
24
vendor/kubesphere.io/api/cluster/v1alpha1/doc.go
generated
vendored
24
vendor/kubesphere.io/api/cluster/v1alpha1/doc.go
generated
vendored
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 KubeSphere Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the tower v1alpha1 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=kubesphere.io/api/cluster
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=cluster.kubesphere.io
|
||||
|
||||
package v1alpha1
|
||||
14502
vendor/kubesphere.io/api/cluster/v1alpha1/openapi_generated.go
generated
vendored
14502
vendor/kubesphere.io/api/cluster/v1alpha1/openapi_generated.go
generated
vendored
File diff suppressed because it is too large
Load Diff
57
vendor/kubesphere.io/api/cluster/v1alpha1/register.go
generated
vendored
57
vendor/kubesphere.io/api/cluster/v1alpha1/register.go
generated
vendored
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 KubeSphere Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the tower v1alpha1 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=cluster.kubesphere.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "cluster.kubesphere.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
182
vendor/kubesphere.io/api/cluster/v1alpha1/zz_generated.deepcopy.go
generated
vendored
182
vendor/kubesphere.io/api/cluster/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@@ -1,182 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Cluster) DeepCopyInto(out *Cluster) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
|
||||
func (in *Cluster) DeepCopy() *Cluster {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Cluster)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Cluster) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) {
|
||||
*out = *in
|
||||
in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition.
|
||||
func (in *ClusterCondition) DeepCopy() *ClusterCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterList) DeepCopyInto(out *ClusterList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Cluster, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
|
||||
func (in *ClusterList) DeepCopy() *ClusterList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
*out = *in
|
||||
in.Connection.DeepCopyInto(&out.Connection)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
|
||||
func (in *ClusterSpec) DeepCopy() *ClusterSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]ClusterCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Zones != nil {
|
||||
in, out := &in.Zones, &out.Zones
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Region != nil {
|
||||
in, out := &in.Region, &out.Region
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Configz != nil {
|
||||
in, out := &in.Configz, &out.Configz
|
||||
*out = make(map[string]bool, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
|
||||
func (in *ClusterStatus) DeepCopy() *ClusterStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Connection) DeepCopyInto(out *Connection) {
|
||||
*out = *in
|
||||
if in.KubeConfig != nil {
|
||||
in, out := &in.KubeConfig, &out.KubeConfig
|
||||
*out = make([]byte, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Connection.
|
||||
func (in *Connection) DeepCopy() *Connection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Connection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
29
vendor/kubesphere.io/api/constants/constants.go
generated
vendored
29
vendor/kubesphere.io/api/constants/constants.go
generated
vendored
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package constants
|
||||
|
||||
const (
|
||||
WorkspaceLabelKey = "kubesphere.io/workspace"
|
||||
NameLabelKey = "kubesphere.io/name"
|
||||
NamespaceLabelKey = "kubesphere.io/namespace"
|
||||
CreatorAnnotationKey = "kubesphere.io/creator"
|
||||
ClusterNameLabelKey = "kubesphere.io/cluster"
|
||||
ChartRepoIdLabelKey = "application.kubesphere.io/repo-id"
|
||||
ChartApplicationIdLabelKey = "application.kubesphere.io/app-id"
|
||||
ChartApplicationVersionIdLabelKey = "application.kubesphere.io/app-version-id"
|
||||
CategoryIdLabelKey = "application.kubesphere.io/app-category-id"
|
||||
)
|
||||
31
vendor/kubesphere.io/api/devops/crdinstall/install.go
generated
vendored
31
vendor/kubesphere.io/api/devops/crdinstall/install.go
generated
vendored
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package install
|
||||
|
||||
import (
|
||||
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
|
||||
devopsv1alpha1 "kubesphere.io/api/devops/v1alpha1"
|
||||
devopsv1alpha3 "kubesphere.io/api/devops/v1alpha3"
|
||||
)
|
||||
|
||||
func Install(scheme *k8sruntime.Scheme) {
|
||||
urlruntime.Must(devopsv1alpha1.AddToScheme(scheme))
|
||||
urlruntime.Must(devopsv1alpha3.AddToScheme(scheme))
|
||||
urlruntime.Must(scheme.SetVersionPriority(devopsv1alpha3.SchemeGroupVersion, devopsv1alpha1.SchemeGroupVersion))
|
||||
}
|
||||
23
vendor/kubesphere.io/api/devops/v1alpha1/doc.go
generated
vendored
23
vendor/kubesphere.io/api/devops/v1alpha1/doc.go
generated
vendored
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the devops v1alpha1 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=kubesphere.io/api/devops
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=devops.kubesphere.io
|
||||
package v1alpha1
|
||||
16124
vendor/kubesphere.io/api/devops/v1alpha1/openapi_generated.go
generated
vendored
16124
vendor/kubesphere.io/api/devops/v1alpha1/openapi_generated.go
generated
vendored
File diff suppressed because it is too large
Load Diff
46
vendor/kubesphere.io/api/devops/v1alpha1/register.go
generated
vendored
46
vendor/kubesphere.io/api/devops/v1alpha1/register.go
generated
vendored
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// NOTE: Boilerplate only. Ignore this file.
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the devops v1alpha1 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=kubesphere.io/api/devops
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=devops.kubesphere.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "devops.kubesphere.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme is required by pkg/client/...
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Resource is required by pkg/client/listers/...
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
91
vendor/kubesphere.io/api/devops/v1alpha1/s2ibinary_types.go
generated
vendored
91
vendor/kubesphere.io/api/devops/v1alpha1/s2ibinary_types.go
generated
vendored
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindS2iBinary = "S2iBinary"
|
||||
ResourceSingularS2iBinary = "s2ibinary"
|
||||
ResourcePluralS2iBinary = "s2ibinaries"
|
||||
)
|
||||
|
||||
const (
|
||||
StatusUploading = "Uploading"
|
||||
StatusReady = "Ready"
|
||||
StatusUploadFailed = "UploadFailed"
|
||||
)
|
||||
|
||||
const (
|
||||
S2iBinaryFinalizerName = "s2ibinary.finalizers.kubesphere.io"
|
||||
S2iBinaryLabelKey = "s2ibinary-name.kubesphere.io"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// S2iBinarySpec defines the desired state of S2iBinary
|
||||
type S2iBinarySpec struct {
|
||||
//FileName is filename of binary
|
||||
FileName string `json:"fileName,omitempty"`
|
||||
//MD5 is Binary's MD5 Hash
|
||||
MD5 string `json:"md5,omitempty"`
|
||||
//Size is the file size of file
|
||||
Size string `json:"size,omitempty"`
|
||||
//DownloadURL in KubeSphere
|
||||
DownloadURL string `json:"downloadURL,omitempty"`
|
||||
// UploadTime is last upload time
|
||||
UploadTimeStamp *metav1.Time `json:"uploadTimeStamp,omitempty"`
|
||||
}
|
||||
|
||||
// S2iBinaryStatus defines the observed state of S2iBinary
|
||||
type S2iBinaryStatus struct {
|
||||
//Phase is status of S2iBinary . Possible value is "Ready","UnableToDownload"
|
||||
Phase string `json:"phase,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBinary is the Schema for the s2ibinaries API
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:printcolumn:name="FileName",type="string",JSONPath=".spec.fileName"
|
||||
// +kubebuilder:printcolumn:name="MD5",type="string",JSONPath=".spec.md5"
|
||||
// +kubebuilder:printcolumn:name="Size",type="string",JSONPath=".spec.size"
|
||||
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
|
||||
type S2iBinary struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec S2iBinarySpec `json:"spec,omitempty"`
|
||||
Status S2iBinaryStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBinaryList contains a list of S2iBinary
|
||||
type S2iBinaryList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []S2iBinary `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&S2iBinary{}, &S2iBinaryList{})
|
||||
}
|
||||
516
vendor/kubesphere.io/api/devops/v1alpha1/s2ibuilder_types.go
generated
vendored
516
vendor/kubesphere.io/api/devops/v1alpha1/s2ibuilder_types.go
generated
vendored
@@ -1,516 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
type RunState string
|
||||
|
||||
const (
|
||||
ResourceKindS2iBuilder = "S2iBuilder"
|
||||
ResourceSingularS2iBuilder = "s2ibuilder"
|
||||
ResourcePluralS2iBuilder = "s2ibuilders"
|
||||
)
|
||||
|
||||
const (
|
||||
NotRunning RunState = "Not Running Yet"
|
||||
Running RunState = "Running"
|
||||
Successful RunState = "Successful"
|
||||
Failed RunState = "Failed"
|
||||
Unknown RunState = "Unknown"
|
||||
)
|
||||
const (
|
||||
AutoScaleAnnotations = "devops.kubesphere.io/autoscale"
|
||||
S2iRunLabel = "devops.kubesphere.io/s2ir"
|
||||
S2irCompletedScaleAnnotations = "devops.kubesphere.io/completedscale"
|
||||
WorkLoadCompletedInitAnnotations = "devops.kubesphere.io/inithasbeencomplted"
|
||||
S2iRunDoNotAutoScaleAnnotations = "devops.kubesphere.io/donotautoscale"
|
||||
DescriptionAnnotations = "desc"
|
||||
)
|
||||
const (
|
||||
KindDeployment = "Deployment"
|
||||
KindStatefulSet = "StatefulSet"
|
||||
)
|
||||
|
||||
// EnvironmentSpec specifies a single environment variable.
|
||||
type EnvironmentSpec struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// ProxyConfig holds proxy configuration.
|
||||
type ProxyConfig struct {
|
||||
HTTPProxy string `json:"httpProxy,omitempty"`
|
||||
HTTPSProxy string `json:"httpsProxy,omitempty"`
|
||||
}
|
||||
|
||||
// CGroupLimits holds limits used to constrain container resources.
|
||||
type CGroupLimits struct {
|
||||
MemoryLimitBytes int64 `json:"memoryLimitBytes"`
|
||||
CPUShares int64 `json:"cpuShares"`
|
||||
CPUPeriod int64 `json:"cpuPeriod"`
|
||||
CPUQuota int64 `json:"cpuQuota"`
|
||||
MemorySwap int64 `json:"memorySwap"`
|
||||
Parent string `json:"parent"`
|
||||
}
|
||||
|
||||
// VolumeSpec represents a single volume mount point.
|
||||
type VolumeSpec struct {
|
||||
// Source is a reference to the volume source.
|
||||
Source string `json:"source,omitempty"`
|
||||
// Destination is the path to mount the volume to - absolute or relative.
|
||||
Destination string `json:"destination,omitempty"`
|
||||
// Keep indicates if the mounted data should be kept in the final image.
|
||||
Keep bool `json:"keep,omitempty"`
|
||||
}
|
||||
|
||||
// DockerConfig contains the configuration for a Docker connection.
|
||||
type DockerConfig struct {
|
||||
// Endpoint is the docker network endpoint or socket
|
||||
Endpoint string `json:"endPoint"`
|
||||
|
||||
// CertFile is the certificate file path for a TLS connection
|
||||
CertFile string `json:"certFile"`
|
||||
|
||||
// KeyFile is the key file path for a TLS connection
|
||||
KeyFile string `json:"keyFile"`
|
||||
|
||||
// CAFile is the certificate authority file path for a TLS connection
|
||||
CAFile string `json:"caFile"`
|
||||
|
||||
// UseTLS indicates if TLS must be used
|
||||
UseTLS bool `json:"useTLS"`
|
||||
|
||||
// TLSVerify indicates if TLS peer must be verified
|
||||
TLSVerify bool `json:"tlsVerify"`
|
||||
}
|
||||
|
||||
// AuthConfig is our abstraction of the Registry authorization information for whatever
|
||||
// docker client we happen to be based on
|
||||
type AuthConfig struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
ServerAddress string `json:"serverAddress,omitempty"`
|
||||
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerConfig is the abstraction of the docker client provider (formerly go-dockerclient, now either
|
||||
// engine-api or kube docker client) container.Config type that is leveraged by s2i or origin
|
||||
type ContainerConfig struct {
|
||||
Labels map[string]string
|
||||
Env []string
|
||||
}
|
||||
|
||||
type PullPolicy string
|
||||
|
||||
const (
|
||||
// PullAlways means that we always attempt to pull the latest image.
|
||||
PullAlways PullPolicy = "always"
|
||||
|
||||
// PullNever means that we never pull an image, but only use a local image.
|
||||
PullNever PullPolicy = "never"
|
||||
|
||||
// PullIfNotPresent means that we pull if the image isn't present on disk.
|
||||
PullIfNotPresent PullPolicy = "if-not-present"
|
||||
|
||||
// DefaultBuilderPullPolicy specifies the default pull policy to use
|
||||
DefaultBuilderPullPolicy = PullIfNotPresent
|
||||
|
||||
// DefaultRuntimeImagePullPolicy specifies the default pull policy to use.
|
||||
DefaultRuntimeImagePullPolicy = PullIfNotPresent
|
||||
|
||||
// DefaultPreviousImagePullPolicy specifies policy for pulling the previously
|
||||
// build Docker image when doing incremental build
|
||||
DefaultPreviousImagePullPolicy = PullIfNotPresent
|
||||
)
|
||||
|
||||
// DockerNetworkMode specifies the network mode setting for the docker container
|
||||
type DockerNetworkMode string
|
||||
|
||||
const (
|
||||
// DockerNetworkModeHost places the container in the default (host) network namespace.
|
||||
DockerNetworkModeHost DockerNetworkMode = "host"
|
||||
// DockerNetworkModeBridge instructs docker to create a network namespace for this container connected to the docker0 bridge via a veth-pair.
|
||||
DockerNetworkModeBridge DockerNetworkMode = "bridge"
|
||||
// DockerNetworkModeContainerPrefix is the string prefix used by NewDockerNetworkModeContainer.
|
||||
DockerNetworkModeContainerPrefix string = "container:"
|
||||
// DockerNetworkModeNetworkNamespacePrefix is the string prefix used when sharing a namespace from a CRI-O container.
|
||||
DockerNetworkModeNetworkNamespacePrefix string = "netns:"
|
||||
)
|
||||
|
||||
type TriggerSource string
|
||||
|
||||
const (
|
||||
Default TriggerSource = "Manual"
|
||||
Github TriggerSource = "Github"
|
||||
Gitlab TriggerSource = "Gitlab"
|
||||
SVN TriggerSource = "SVN"
|
||||
Others TriggerSource = "Others"
|
||||
)
|
||||
|
||||
// NewDockerNetworkModeContainer creates a DockerNetworkMode value which instructs docker to place the container in the network namespace of an existing container.
|
||||
// It can be used, for instance, to place the s2i container in the network namespace of the infrastructure container of a k8s pod.
|
||||
func NewDockerNetworkModeContainer(id string) DockerNetworkMode {
|
||||
return DockerNetworkMode(DockerNetworkModeContainerPrefix + id)
|
||||
}
|
||||
|
||||
// String implements the String() function of pflags.Value so this can be used as
|
||||
// command line parameter.
|
||||
// This method is really used just to show the default value when printing help.
|
||||
// It will not default the configuration.
|
||||
func (p *PullPolicy) String() string {
|
||||
if len(string(*p)) == 0 {
|
||||
return string(DefaultBuilderPullPolicy)
|
||||
}
|
||||
return string(*p)
|
||||
}
|
||||
|
||||
// Type implements the Type() function of pflags.Value interface
|
||||
func (p *PullPolicy) Type() string {
|
||||
return "string"
|
||||
}
|
||||
|
||||
// Set implements the Set() function of pflags.Value interface
|
||||
// The valid options are "always", "never" or "if-not-present"
|
||||
func (p *PullPolicy) Set(v string) error {
|
||||
switch v {
|
||||
case "always":
|
||||
*p = PullAlways
|
||||
case "never":
|
||||
*p = PullNever
|
||||
case "if-not-present":
|
||||
*p = PullIfNotPresent
|
||||
default:
|
||||
return fmt.Errorf("invalid value %q, valid values are: always, never or if-not-present", v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type S2iConfig struct {
|
||||
// DisplayName is a result image display-name label. This defaults to the
|
||||
// output image name.
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
|
||||
// Description is a result image description label. The default is no
|
||||
// description.
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// BuilderImage describes which image is used for building the result images.
|
||||
BuilderImage string `json:"builderImage,omitempty"`
|
||||
|
||||
// BuilderImageVersion provides optional version information about the builder image.
|
||||
BuilderImageVersion string `json:"builderImageVersion,omitempty"`
|
||||
|
||||
// BuilderBaseImageVersion provides optional version information about the builder base image.
|
||||
BuilderBaseImageVersion string `json:"builderBaseImageVersion,omitempty"`
|
||||
|
||||
// RuntimeImage specifies the image that will be a base for resulting image
|
||||
// and will be used for running an application. By default, BuilderImage is
|
||||
// used for building and running, but the latter may be overridden.
|
||||
RuntimeImage string `json:"runtimeImage,omitempty"`
|
||||
|
||||
//OutputImageName is a result image name without tag, default is latest. tag will append to ImageName in the end
|
||||
OutputImageName string `json:"outputImageName,omitempty"`
|
||||
// RuntimeImagePullPolicy specifies when to pull a runtime image.
|
||||
RuntimeImagePullPolicy PullPolicy `json:"runtimeImagePullPolicy,omitempty"`
|
||||
|
||||
// RuntimeAuthentication holds the authentication information for pulling the
|
||||
// runtime Docker images from private repositories.
|
||||
RuntimeAuthentication *AuthConfig `json:"runtimeAuthentication,omitempty"`
|
||||
|
||||
// RuntimeArtifacts specifies a list of source/destination pairs that will
|
||||
// be copied from builder to a runtime image. Source can be a file or
|
||||
// directory. Destination must be a directory. Regardless whether it
|
||||
// is an absolute or relative path, it will be placed into image's WORKDIR.
|
||||
// Destination also can be empty or equals to ".", in this case it just
|
||||
// refers to a root of WORKDIR.
|
||||
// In case it's empty, S2I will try to get this list from
|
||||
// io.openshift.s2i.assemble-input-files label on a RuntimeImage.
|
||||
RuntimeArtifacts []VolumeSpec `json:"runtimeArtifacts,omitempty"`
|
||||
|
||||
// DockerConfig describes how to access host docker daemon.
|
||||
DockerConfig *DockerConfig `json:"dockerConfig,omitempty"`
|
||||
|
||||
// PullAuthentication holds the authentication information for pulling the
|
||||
// Docker images from private repositories
|
||||
PullAuthentication *AuthConfig `json:"pullAuthentication,omitempty"`
|
||||
|
||||
// PullAuthentication holds the authentication information for pulling the
|
||||
// Docker images from private repositories
|
||||
PushAuthentication *AuthConfig `json:"pushAuthentication,omitempty"`
|
||||
|
||||
// IncrementalAuthentication holds the authentication information for pulling the
|
||||
// previous image from private repositories
|
||||
IncrementalAuthentication *AuthConfig `json:"incrementalAuthentication,omitempty"`
|
||||
|
||||
// DockerNetworkMode is used to set the docker network setting to --net=container:<id>
|
||||
// when the builder is invoked from a container.
|
||||
DockerNetworkMode DockerNetworkMode `json:"dockerNetworkMode,omitempty"`
|
||||
|
||||
// PreserveWorkingDir describes if working directory should be left after processing.
|
||||
PreserveWorkingDir bool `json:"preserveWorkingDir,omitempty"`
|
||||
|
||||
//ImageName Contains the registry address and reponame, tag should set by field tag alone
|
||||
ImageName string `json:"imageName"`
|
||||
// Tag is a result image tag name.
|
||||
Tag string `json:"tag,omitempty"`
|
||||
|
||||
// BuilderPullPolicy specifies when to pull the builder image
|
||||
BuilderPullPolicy PullPolicy `json:"builderPullPolicy,omitempty"`
|
||||
|
||||
// PreviousImagePullPolicy specifies when to pull the previously build image
|
||||
// when doing incremental build
|
||||
PreviousImagePullPolicy PullPolicy `json:"previousImagePullPolicy,omitempty"`
|
||||
|
||||
// Incremental describes whether to try to perform incremental build.
|
||||
Incremental bool `json:"incremental,omitempty"`
|
||||
|
||||
// IncrementalFromTag sets an alternative image tag to look for existing
|
||||
// artifacts. Tag is used by default if this is not set.
|
||||
IncrementalFromTag string `json:"incrementalFromTag,omitempty"`
|
||||
|
||||
// RemovePreviousImage describes if previous image should be removed after successful build.
|
||||
// This applies only to incremental builds.
|
||||
RemovePreviousImage bool `json:"removePreviousImage,omitempty"`
|
||||
|
||||
// Environment is a map of environment variables to be passed to the image.
|
||||
Environment []EnvironmentSpec `json:"environment,omitempty"`
|
||||
|
||||
// LabelNamespace provides the namespace under which the labels will be generated.
|
||||
LabelNamespace string `json:"labelNamespace,omitempty"`
|
||||
|
||||
// CallbackURL is a URL which is called upon successful build to inform about that fact.
|
||||
CallbackURL string `json:"callbackUrl,omitempty"`
|
||||
|
||||
// ScriptsURL is a URL describing where to fetch the S2I scripts from during build process.
|
||||
// This url can be a reference within the builder image if the scheme is specified as image://
|
||||
ScriptsURL string `json:"scriptsUrl,omitempty"`
|
||||
|
||||
// Destination specifies a location where the untar operation will place its artifacts.
|
||||
Destination string `json:"destination,omitempty"`
|
||||
|
||||
// WorkingDir describes temporary directory used for downloading sources, scripts and tar operations.
|
||||
WorkingDir string `json:"workingDir,omitempty"`
|
||||
|
||||
// WorkingSourceDir describes the subdirectory off of WorkingDir set up during the repo download
|
||||
// that is later used as the root for ignore processing
|
||||
WorkingSourceDir string `json:"workingSourceDir,omitempty"`
|
||||
|
||||
// LayeredBuild describes if this is build which layered scripts and sources on top of BuilderImage.
|
||||
LayeredBuild bool `json:"layeredBuild,omitempty"`
|
||||
|
||||
// Specify a relative directory inside the application repository that should
|
||||
// be used as a root directory for the application.
|
||||
ContextDir string `json:"contextDir,omitempty"`
|
||||
|
||||
// AssembleUser specifies the user to run the assemble script in container
|
||||
AssembleUser string `json:"assembleUser,omitempty"`
|
||||
|
||||
// RunImage will trigger a "docker run ..." invocation of the produced image so the user
|
||||
// can see if it operates as he would expect
|
||||
RunImage bool `json:"runImage,omitempty"`
|
||||
|
||||
// Usage allows for properly shortcircuiting s2i logic when `s2i usage` is invoked
|
||||
Usage bool `json:"usage,omitempty"`
|
||||
|
||||
// Injections specifies a list source/destination folders that are injected to
|
||||
// the container that runs assemble.
|
||||
// All files we inject will be truncated after the assemble script finishes.
|
||||
Injections []VolumeSpec `json:"injections,omitempty"`
|
||||
|
||||
// CGroupLimits describes the cgroups limits that will be applied to any containers
|
||||
// run by s2i.
|
||||
CGroupLimits *CGroupLimits `json:"cgroupLimits,omitempty"`
|
||||
|
||||
// DropCapabilities contains a list of capabilities to drop when executing containers
|
||||
DropCapabilities []string `json:"dropCapabilities,omitempty"`
|
||||
|
||||
// ScriptDownloadProxyConfig optionally specifies the http and https proxy
|
||||
// to use when downloading scripts
|
||||
ScriptDownloadProxyConfig *ProxyConfig `json:"scriptDownloadProxyConfig,omitempty"`
|
||||
|
||||
// ExcludeRegExp contains a string representation of the regular expression desired for
|
||||
// deciding which files to exclude from the tar stream
|
||||
ExcludeRegExp string `json:"excludeRegExp,omitempty"`
|
||||
|
||||
// BlockOnBuild prevents s2i from performing a docker build operation
|
||||
// if one is necessary to execute ONBUILD commands, or to layer source code into
|
||||
// the container for images that don't have a tar binary available, if the
|
||||
// image contains ONBUILD commands that would be executed.
|
||||
BlockOnBuild bool `json:"blockOnBuild,omitempty"`
|
||||
|
||||
// HasOnBuild will be set to true if the builder image contains ONBUILD instructions
|
||||
HasOnBuild bool `json:"hasOnBuild,omitempty"`
|
||||
|
||||
// BuildVolumes specifies a list of volumes to mount to container running the
|
||||
// build.
|
||||
BuildVolumes []string `json:"buildVolumes,omitempty"`
|
||||
|
||||
// Labels specify labels and their values to be applied to the resulting image. Label keys
|
||||
// must have non-zero length. The labels defined here override generated labels in case
|
||||
// they have the same name.
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
// SecurityOpt are passed as options to the docker containers launched by s2i.
|
||||
SecurityOpt []string `json:"securityOpt,omitempty"`
|
||||
|
||||
// KeepSymlinks indicates to copy symlinks as symlinks. Default behavior is to follow
|
||||
// symlinks and copy files by content.
|
||||
KeepSymlinks bool `json:"keepSymlinks,omitempty"`
|
||||
|
||||
// AsDockerfile indicates the path where the Dockerfile should be written instead of building
|
||||
// a new image.
|
||||
AsDockerfile string `json:"asDockerfile,omitempty"`
|
||||
|
||||
// ImageWorkDir is the default working directory for the builder image.
|
||||
ImageWorkDir string `json:"imageWorkDir,omitempty"`
|
||||
|
||||
// ImageScriptsURL is the default location to find the assemble/run scripts for a builder image.
|
||||
// This url can be a reference within the builder image if the scheme is specified as image://
|
||||
ImageScriptsURL string `json:"imageScriptsUrl,omitempty"`
|
||||
|
||||
// AddHost Add a line to /etc/hosts for test purpose or private use in LAN. Its format is host:IP,multiple hosts can be added by using multiple --add-host
|
||||
AddHost []string `json:"addHost,omitempty"`
|
||||
|
||||
// Export Push the result image to specify image registry in tag
|
||||
Export bool `json:"export,omitempty"`
|
||||
|
||||
// SourceURL is url of the codes such as https://github.com/a/b.git
|
||||
SourceURL string `json:"sourceUrl"`
|
||||
|
||||
// IsBinaryURL explain the type of SourceURL.
|
||||
// If it is IsBinaryURL, it will download the file directly without using git.
|
||||
IsBinaryURL bool `json:"isBinaryURL,omitempty"`
|
||||
|
||||
// GitSecretRef is the BasicAuth Secret of Git Clone
|
||||
GitSecretRef *corev1.LocalObjectReference `json:"gitSecretRef,omitempty"`
|
||||
|
||||
// The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit
|
||||
RevisionId string `json:"revisionId,omitempty"`
|
||||
|
||||
// The name of taint.
|
||||
TaintKey string `json:"taintKey,omitempty"`
|
||||
|
||||
// The key of Node Affinity.
|
||||
NodeAffinityKey string `json:"nodeAffinityKey,omitempty"`
|
||||
|
||||
// The values of Node Affinity.
|
||||
NodeAffinityValues []string `json:"nodeAffinityValues,omitempty"`
|
||||
|
||||
// Whether output build result to status.
|
||||
OutputBuildResult bool `json:"outputBuildResult,omitempty"`
|
||||
|
||||
// Regular expressions, ignoring names that do not match the provided regular expression
|
||||
BranchExpression string `json:"branchExpression,omitempty"`
|
||||
|
||||
// SecretCode
|
||||
SecretCode string `json:"secretCode,omitempty"`
|
||||
}
|
||||
|
||||
type UserDefineTemplate struct {
|
||||
//Name specify a template to use, so many fields in Config can left empty
|
||||
Name string `json:"name,omitempty"`
|
||||
//Parameters must use with `template`, fill some parameters which template will use
|
||||
Parameters []Parameter `json:"parameters,omitempty"`
|
||||
//BaseImage specify which version of this template to use
|
||||
BuilderImage string `json:"builderImage,omitempty"`
|
||||
}
|
||||
|
||||
// S2iBuilderSpec defines the desired state of S2iBuilder
|
||||
type S2iBuilderSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
Config *S2iConfig `json:"config,omitempty"`
|
||||
//FromTemplate define some inputs from user
|
||||
FromTemplate *UserDefineTemplate `json:"fromTemplate,omitempty"`
|
||||
}
|
||||
|
||||
// S2iBuilderStatus defines the observed state of S2iBuilder
|
||||
type S2iBuilderStatus struct {
|
||||
//RunCount represent the sum of s2irun of this builder
|
||||
RunCount int `json:"runCount"`
|
||||
//LastRunState return the state of the newest run of this builder
|
||||
LastRunState RunState `json:"lastRunState,omitempty"`
|
||||
//LastRunState return the name of the newest run of this builder
|
||||
LastRunName *string `json:"lastRunName,omitempty"`
|
||||
//LastRunStartTime return the startTime of the newest run of this builder
|
||||
LastRunStartTime *metav1.Time `json:"lastRunStartTime,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBuilder is the Schema for the s2ibuilders API
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="RunCount",type="integer",JSONPath=".status.runCount"
|
||||
// +kubebuilder:printcolumn:name="LastRunState",type="string",JSONPath=".status.lastRunState"
|
||||
// +kubebuilder:printcolumn:name="LastRunName",type="string",JSONPath=".status.lastRunName"
|
||||
// +kubebuilder:printcolumn:name="LastRunStartTime",type="date",JSONPath=".status.lastRunStartTime"
|
||||
// +kubebuilder:resource:shortName=s2ib
|
||||
type S2iBuilder struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec S2iBuilderSpec `json:"spec,omitempty"`
|
||||
Status S2iBuilderStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBuilderList contains a list of S2iBuilder
|
||||
type S2iBuilderList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []S2iBuilder `json:"items"`
|
||||
}
|
||||
|
||||
type S2iAutoScale struct {
|
||||
Kind string `json:"kind"`
|
||||
Name string `json:"name"`
|
||||
InitReplicas *int32 `json:"initReplicas,omitempty"`
|
||||
Containers []string `json:"containers,omitempty"`
|
||||
}
|
||||
|
||||
type DockerConfigJson struct {
|
||||
Auths DockerConfigMap `json:"auths"`
|
||||
}
|
||||
|
||||
// DockerConfig represents the config file used by the docker CLI.
|
||||
// This config that represents the credentials that should be used
|
||||
// when pulling images from specific image repositories.
|
||||
type DockerConfigMap map[string]DockerConfigEntry
|
||||
|
||||
type DockerConfigEntry struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Email string `json:"email"`
|
||||
ServerAddress string `json:"serverAddress,omitempty"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&S2iBuilder{}, &S2iBuilderList{})
|
||||
}
|
||||
126
vendor/kubesphere.io/api/devops/v1alpha1/s2ibuildertemplate_types.go
generated
vendored
126
vendor/kubesphere.io/api/devops/v1alpha1/s2ibuildertemplate_types.go
generated
vendored
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
ResourceKindS2iBuilderTemplate = "S2iBuilderTemplate"
|
||||
ResourceSingularS2iBuilderTemplate = "s2ibuildertemplate"
|
||||
ResourcePluralS2iBuilderTemplate = "s2ibuildertemplates"
|
||||
)
|
||||
|
||||
type Parameter struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
OptValues []string `json:"optValues,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
DefaultValue string `json:"defaultValue,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
type CodeFramework string
|
||||
|
||||
const (
|
||||
Ruby CodeFramework = "ruby"
|
||||
Go CodeFramework = "go"
|
||||
Java CodeFramework = "Java"
|
||||
JavaTomcat CodeFramework = "JavaTomcat"
|
||||
Nodejs CodeFramework = "Nodejs"
|
||||
Python CodeFramework = "python"
|
||||
)
|
||||
|
||||
func (p *Parameter) ToEnvonment() *EnvironmentSpec {
|
||||
var v string
|
||||
if p.Value == "" && p.DefaultValue != "" {
|
||||
v = p.DefaultValue
|
||||
} else if p.Value != "" {
|
||||
v = p.Value
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
return &EnvironmentSpec{
|
||||
Name: p.Key,
|
||||
Value: v,
|
||||
}
|
||||
}
|
||||
|
||||
// S2iBuilderTemplateSpec defines the desired state of S2iBuilderTemplate
|
||||
type S2iBuilderTemplateSpec struct {
|
||||
//DefaultBaseImage is the image that will be used by default
|
||||
DefaultBaseImage string `json:"defaultBaseImage,omitempty"`
|
||||
//Images are the images this template will use.
|
||||
ContainerInfo []ContainerInfo `json:"containerInfo,omitempty"`
|
||||
//CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS etc
|
||||
CodeFramework CodeFramework `json:"codeFramework,omitempty"`
|
||||
// Parameters is a set of environment variables to be passed to the image.
|
||||
Parameters []Parameter `json:"environment,omitempty"`
|
||||
// Version of template
|
||||
Version string `json:"version,omitempty"`
|
||||
// Description illustrate the purpose of this template
|
||||
Description string `json:"description,omitempty"`
|
||||
// IconPath is used for frontend display
|
||||
IconPath string `json:"iconPath,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerInfo struct {
|
||||
//BaseImage are the images this template will use.
|
||||
BuilderImage string `json:"builderImage,omitempty"`
|
||||
RuntimeImage string `json:"runtimeImage,omitempty"`
|
||||
RuntimeArtifacts []VolumeSpec `json:"runtimeArtifacts,omitempty"`
|
||||
// BuildVolumes specifies a list of volumes to mount to container running the
|
||||
// build.
|
||||
BuildVolumes []string `json:"buildVolumes,omitempty"`
|
||||
}
|
||||
|
||||
// S2iBuilderTemplateStatus defines the observed state of S2iBuilderTemplate
|
||||
type S2iBuilderTemplateStatus struct {
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBuilderTemplate is the Schema for the s2ibuildertemplates API
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:printcolumn:name="Framework",type="string",JSONPath=".spec.codeFramework"
|
||||
// +kubebuilder:printcolumn:name="DefaultBaseImage",type="string",JSONPath=".spec.defaultBaseImage"
|
||||
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version"
|
||||
// +kubebuilder:resource:categories="devops",scope="Cluster",shortName="s2ibt"
|
||||
type S2iBuilderTemplate struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec S2iBuilderTemplateSpec `json:"spec,omitempty"`
|
||||
Status S2iBuilderTemplateStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iBuilderTemplateList contains a list of S2iBuilderTemplate
|
||||
type S2iBuilderTemplateList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []S2iBuilderTemplate `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&S2iBuilderTemplate{}, &S2iBuilderTemplateList{})
|
||||
}
|
||||
141
vendor/kubesphere.io/api/devops/v1alpha1/s2irun_types.go
generated
vendored
141
vendor/kubesphere.io/api/devops/v1alpha1/s2irun_types.go
generated
vendored
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
const (
|
||||
ResourceKindS2iRun = "S2iRun"
|
||||
ResourceSingularS2iRun = "s2irun"
|
||||
ResourcePluralS2iRun = "s2iruns"
|
||||
)
|
||||
|
||||
// S2iRunSpec defines the desired state of S2iRun
|
||||
type S2iRunSpec struct {
|
||||
//BuilderName specify the name of s2ibuilder, required
|
||||
BuilderName string `json:"builderName"`
|
||||
//BackoffLimit limits the restart count of each s2irun. Default is 0
|
||||
BackoffLimit int32 `json:"backoffLimit,omitempty"`
|
||||
//SecondsAfterFinished if is set and greater than zero, and the job created by s2irun become successful or failed , the job will be auto deleted after SecondsAfterFinished
|
||||
SecondsAfterFinished int32 `json:"secondsAfterFinished,omitempty"`
|
||||
//NewTag override the default tag in its s2ibuilder, image name cannot be changed.
|
||||
NewTag string `json:"newTag,omitempty"`
|
||||
//NewRevisionId override the default NewRevisionId in its s2ibuilder.
|
||||
NewRevisionId string `json:"newRevisionId,omitempty"`
|
||||
//NewSourceURL is used to download new binary artifacts
|
||||
NewSourceURL string `json:"newSourceURL,omitempty"`
|
||||
}
|
||||
|
||||
// S2iRunStatus defines the observed state of S2iRun
|
||||
type S2iRunStatus struct {
|
||||
// StartTime represent when this run began
|
||||
StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"`
|
||||
|
||||
// Represents time when the job was completed. It is not guaranteed to
|
||||
// be set in happens-before order across separate operations.
|
||||
// It is represented in RFC3339 form and is in UTC.
|
||||
// +optional
|
||||
CompletionTime *metav1.Time `json:"completionTime,omitempty" protobuf:"bytes,3,opt,name=completionTime"`
|
||||
// RunState indicates whether this job is done or failed
|
||||
RunState RunState `json:"runState,omitempty"`
|
||||
//LogURL is uesd for external log handler to let user know where is log located in
|
||||
LogURL string `json:"logURL,omitempty"`
|
||||
//KubernetesJobName is the job name in k8s
|
||||
KubernetesJobName string `json:"kubernetesJobName,omitempty"`
|
||||
|
||||
// S2i build result info.
|
||||
S2iBuildResult *S2iBuildResult `json:"s2iBuildResult,omitempty"`
|
||||
// S2i build source info.
|
||||
S2iBuildSource *S2iBuildSource `json:"s2iBuildSource,omitempty"`
|
||||
}
|
||||
|
||||
type S2iBuildResult struct {
|
||||
//ImageName is the name of artifact
|
||||
ImageName string `json:"imageName,omitempty"`
|
||||
//The size in bytes of the image
|
||||
ImageSize int64 `json:"imageSize,omitempty"`
|
||||
// Image ID.
|
||||
ImageID string `json:"imageID,omitempty"`
|
||||
// Image created time.
|
||||
ImageCreated string `json:"imageCreated,omitempty"`
|
||||
// image tags.
|
||||
ImageRepoTags []string `json:"imageRepoTags,omitempty"`
|
||||
// Command for pull image.
|
||||
CommandPull string `json:"commandPull,omitempty"`
|
||||
}
|
||||
|
||||
type S2iBuildSource struct {
|
||||
// SourceURL is url of the codes such as https://github.com/a/b.git
|
||||
SourceUrl string `json:"sourceUrl,omitempty"`
|
||||
// The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit
|
||||
RevisionId string `json:"revisionId,omitempty"`
|
||||
// Binary file Name
|
||||
BinaryName string `json:"binaryName,omitempty"`
|
||||
// Binary file Size
|
||||
BinarySize uint64 `json:"binarySize,omitempty"`
|
||||
|
||||
// // BuilderImage describes which image is used for building the result images.
|
||||
BuilderImage string `json:"builderImage,omitempty"`
|
||||
// Description is a result image description label. The default is no
|
||||
// description.
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// CommitID represents an arbitrary extended object reference in Git as SHA-1
|
||||
CommitID string `json:"commitID,omitempty"`
|
||||
// CommitterName contains the name of the committer
|
||||
CommitterName string `json:"committerName,omitempty"`
|
||||
// CommitterEmail contains the e-mail of the committer
|
||||
CommitterEmail string `json:"committerEmail,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iRun is the Schema for the s2iruns API
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:shortName=s2ir
|
||||
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.runState"
|
||||
// +kubebuilder:printcolumn:name="K8sJobName",type="string",JSONPath=".status.kubernetesJobName"
|
||||
// +kubebuilder:printcolumn:name="StartTime",type="date",JSONPath=".status.startTime"
|
||||
// +kubebuilder:printcolumn:name="CompletionTime",type="date",JSONPath=".status.completionTime"
|
||||
// +kubebuilder:printcolumn:name="ImageName",type="string",JSONPath=".status.s2iBuildResult.imageName"
|
||||
type S2iRun struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec S2iRunSpec `json:"spec,omitempty"`
|
||||
Status S2iRunStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// S2iRunList contains a list of S2iRun
|
||||
type S2iRunList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []S2iRun `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&S2iRun{}, &S2iRunList{})
|
||||
}
|
||||
879
vendor/kubesphere.io/api/devops/v1alpha1/zz_generated.deepcopy.go
generated
vendored
879
vendor/kubesphere.io/api/devops/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@@ -1,879 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuthConfig) DeepCopyInto(out *AuthConfig) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(v1.LocalObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig.
|
||||
func (in *AuthConfig) DeepCopy() *AuthConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AuthConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CGroupLimits) DeepCopyInto(out *CGroupLimits) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CGroupLimits.
|
||||
func (in *CGroupLimits) DeepCopy() *CGroupLimits {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CGroupLimits)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ContainerConfig) DeepCopyInto(out *ContainerConfig) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Env != nil {
|
||||
in, out := &in.Env, &out.Env
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerConfig.
|
||||
func (in *ContainerConfig) DeepCopy() *ContainerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ContainerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ContainerInfo) DeepCopyInto(out *ContainerInfo) {
|
||||
*out = *in
|
||||
if in.RuntimeArtifacts != nil {
|
||||
in, out := &in.RuntimeArtifacts, &out.RuntimeArtifacts
|
||||
*out = make([]VolumeSpec, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.BuildVolumes != nil {
|
||||
in, out := &in.BuildVolumes, &out.BuildVolumes
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerInfo.
|
||||
func (in *ContainerInfo) DeepCopy() *ContainerInfo {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ContainerInfo)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DockerConfig) DeepCopyInto(out *DockerConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfig.
|
||||
func (in *DockerConfig) DeepCopy() *DockerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DockerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DockerConfigEntry) DeepCopyInto(out *DockerConfigEntry) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigEntry.
|
||||
func (in *DockerConfigEntry) DeepCopy() *DockerConfigEntry {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DockerConfigEntry)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DockerConfigJson) DeepCopyInto(out *DockerConfigJson) {
|
||||
*out = *in
|
||||
if in.Auths != nil {
|
||||
in, out := &in.Auths, &out.Auths
|
||||
*out = make(DockerConfigMap, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigJson.
|
||||
func (in *DockerConfigJson) DeepCopy() *DockerConfigJson {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DockerConfigJson)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in DockerConfigMap) DeepCopyInto(out *DockerConfigMap) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(DockerConfigMap, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerConfigMap.
|
||||
func (in DockerConfigMap) DeepCopy() DockerConfigMap {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DockerConfigMap)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSpec.
|
||||
func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EnvironmentSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Parameter) DeepCopyInto(out *Parameter) {
|
||||
*out = *in
|
||||
if in.OptValues != nil {
|
||||
in, out := &in.OptValues, &out.OptValues
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameter.
|
||||
func (in *Parameter) DeepCopy() *Parameter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Parameter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig.
|
||||
func (in *ProxyConfig) DeepCopy() *ProxyConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProxyConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iAutoScale) DeepCopyInto(out *S2iAutoScale) {
|
||||
*out = *in
|
||||
if in.InitReplicas != nil {
|
||||
in, out := &in.InitReplicas, &out.InitReplicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.Containers != nil {
|
||||
in, out := &in.Containers, &out.Containers
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iAutoScale.
|
||||
func (in *S2iAutoScale) DeepCopy() *S2iAutoScale {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iAutoScale)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBinary) DeepCopyInto(out *S2iBinary) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinary.
|
||||
func (in *S2iBinary) DeepCopy() *S2iBinary {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBinary)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBinary) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBinaryList) DeepCopyInto(out *S2iBinaryList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]S2iBinary, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinaryList.
|
||||
func (in *S2iBinaryList) DeepCopy() *S2iBinaryList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBinaryList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBinaryList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBinarySpec) DeepCopyInto(out *S2iBinarySpec) {
|
||||
*out = *in
|
||||
if in.UploadTimeStamp != nil {
|
||||
in, out := &in.UploadTimeStamp, &out.UploadTimeStamp
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinarySpec.
|
||||
func (in *S2iBinarySpec) DeepCopy() *S2iBinarySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBinarySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBinaryStatus) DeepCopyInto(out *S2iBinaryStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBinaryStatus.
|
||||
func (in *S2iBinaryStatus) DeepCopy() *S2iBinaryStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBinaryStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuildResult) DeepCopyInto(out *S2iBuildResult) {
|
||||
*out = *in
|
||||
if in.ImageRepoTags != nil {
|
||||
in, out := &in.ImageRepoTags, &out.ImageRepoTags
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuildResult.
|
||||
func (in *S2iBuildResult) DeepCopy() *S2iBuildResult {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuildResult)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuildSource) DeepCopyInto(out *S2iBuildSource) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuildSource.
|
||||
func (in *S2iBuildSource) DeepCopy() *S2iBuildSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuildSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilder) DeepCopyInto(out *S2iBuilder) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilder.
|
||||
func (in *S2iBuilder) DeepCopy() *S2iBuilder {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilder)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBuilder) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderList) DeepCopyInto(out *S2iBuilderList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]S2iBuilder, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderList.
|
||||
func (in *S2iBuilderList) DeepCopy() *S2iBuilderList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBuilderList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderSpec) DeepCopyInto(out *S2iBuilderSpec) {
|
||||
*out = *in
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = new(S2iConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.FromTemplate != nil {
|
||||
in, out := &in.FromTemplate, &out.FromTemplate
|
||||
*out = new(UserDefineTemplate)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderSpec.
|
||||
func (in *S2iBuilderSpec) DeepCopy() *S2iBuilderSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderStatus) DeepCopyInto(out *S2iBuilderStatus) {
|
||||
*out = *in
|
||||
if in.LastRunName != nil {
|
||||
in, out := &in.LastRunName, &out.LastRunName
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.LastRunStartTime != nil {
|
||||
in, out := &in.LastRunStartTime, &out.LastRunStartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderStatus.
|
||||
func (in *S2iBuilderStatus) DeepCopy() *S2iBuilderStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderTemplate) DeepCopyInto(out *S2iBuilderTemplate) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplate.
|
||||
func (in *S2iBuilderTemplate) DeepCopy() *S2iBuilderTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBuilderTemplate) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderTemplateList) DeepCopyInto(out *S2iBuilderTemplateList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]S2iBuilderTemplate, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateList.
|
||||
func (in *S2iBuilderTemplateList) DeepCopy() *S2iBuilderTemplateList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderTemplateList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iBuilderTemplateList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderTemplateSpec) DeepCopyInto(out *S2iBuilderTemplateSpec) {
|
||||
*out = *in
|
||||
if in.ContainerInfo != nil {
|
||||
in, out := &in.ContainerInfo, &out.ContainerInfo
|
||||
*out = make([]ContainerInfo, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Parameters != nil {
|
||||
in, out := &in.Parameters, &out.Parameters
|
||||
*out = make([]Parameter, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateSpec.
|
||||
func (in *S2iBuilderTemplateSpec) DeepCopy() *S2iBuilderTemplateSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderTemplateSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iBuilderTemplateStatus) DeepCopyInto(out *S2iBuilderTemplateStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iBuilderTemplateStatus.
|
||||
func (in *S2iBuilderTemplateStatus) DeepCopy() *S2iBuilderTemplateStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iBuilderTemplateStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iConfig) DeepCopyInto(out *S2iConfig) {
|
||||
*out = *in
|
||||
if in.RuntimeAuthentication != nil {
|
||||
in, out := &in.RuntimeAuthentication, &out.RuntimeAuthentication
|
||||
*out = new(AuthConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.RuntimeArtifacts != nil {
|
||||
in, out := &in.RuntimeArtifacts, &out.RuntimeArtifacts
|
||||
*out = make([]VolumeSpec, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.DockerConfig != nil {
|
||||
in, out := &in.DockerConfig, &out.DockerConfig
|
||||
*out = new(DockerConfig)
|
||||
**out = **in
|
||||
}
|
||||
if in.PullAuthentication != nil {
|
||||
in, out := &in.PullAuthentication, &out.PullAuthentication
|
||||
*out = new(AuthConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PushAuthentication != nil {
|
||||
in, out := &in.PushAuthentication, &out.PushAuthentication
|
||||
*out = new(AuthConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.IncrementalAuthentication != nil {
|
||||
in, out := &in.IncrementalAuthentication, &out.IncrementalAuthentication
|
||||
*out = new(AuthConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Environment != nil {
|
||||
in, out := &in.Environment, &out.Environment
|
||||
*out = make([]EnvironmentSpec, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Injections != nil {
|
||||
in, out := &in.Injections, &out.Injections
|
||||
*out = make([]VolumeSpec, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.CGroupLimits != nil {
|
||||
in, out := &in.CGroupLimits, &out.CGroupLimits
|
||||
*out = new(CGroupLimits)
|
||||
**out = **in
|
||||
}
|
||||
if in.DropCapabilities != nil {
|
||||
in, out := &in.DropCapabilities, &out.DropCapabilities
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ScriptDownloadProxyConfig != nil {
|
||||
in, out := &in.ScriptDownloadProxyConfig, &out.ScriptDownloadProxyConfig
|
||||
*out = new(ProxyConfig)
|
||||
**out = **in
|
||||
}
|
||||
if in.BuildVolumes != nil {
|
||||
in, out := &in.BuildVolumes, &out.BuildVolumes
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.SecurityOpt != nil {
|
||||
in, out := &in.SecurityOpt, &out.SecurityOpt
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.AddHost != nil {
|
||||
in, out := &in.AddHost, &out.AddHost
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.GitSecretRef != nil {
|
||||
in, out := &in.GitSecretRef, &out.GitSecretRef
|
||||
*out = new(v1.LocalObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.NodeAffinityValues != nil {
|
||||
in, out := &in.NodeAffinityValues, &out.NodeAffinityValues
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iConfig.
|
||||
func (in *S2iConfig) DeepCopy() *S2iConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iRun) DeepCopyInto(out *S2iRun) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRun.
|
||||
func (in *S2iRun) DeepCopy() *S2iRun {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iRun)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iRun) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iRunList) DeepCopyInto(out *S2iRunList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]S2iRun, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunList.
|
||||
func (in *S2iRunList) DeepCopy() *S2iRunList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iRunList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *S2iRunList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iRunSpec) DeepCopyInto(out *S2iRunSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunSpec.
|
||||
func (in *S2iRunSpec) DeepCopy() *S2iRunSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iRunSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *S2iRunStatus) DeepCopyInto(out *S2iRunStatus) {
|
||||
*out = *in
|
||||
if in.StartTime != nil {
|
||||
in, out := &in.StartTime, &out.StartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.CompletionTime != nil {
|
||||
in, out := &in.CompletionTime, &out.CompletionTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.S2iBuildResult != nil {
|
||||
in, out := &in.S2iBuildResult, &out.S2iBuildResult
|
||||
*out = new(S2iBuildResult)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.S2iBuildSource != nil {
|
||||
in, out := &in.S2iBuildSource, &out.S2iBuildSource
|
||||
*out = new(S2iBuildSource)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S2iRunStatus.
|
||||
func (in *S2iRunStatus) DeepCopy() *S2iRunStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(S2iRunStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UserDefineTemplate) DeepCopyInto(out *UserDefineTemplate) {
|
||||
*out = *in
|
||||
if in.Parameters != nil {
|
||||
in, out := &in.Parameters, &out.Parameters
|
||||
*out = make([]Parameter, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDefineTemplate.
|
||||
func (in *UserDefineTemplate) DeepCopy() *UserDefineTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UserDefineTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeSpec) DeepCopyInto(out *VolumeSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSpec.
|
||||
func (in *VolumeSpec) DeepCopy() *VolumeSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
76
vendor/kubesphere.io/api/devops/v1alpha3/credential_types.go
generated
vendored
76
vendor/kubesphere.io/api/devops/v1alpha3/credential_types.go
generated
vendored
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import v1 "k8s.io/api/core/v1"
|
||||
|
||||
/**
|
||||
We use a special type of secret as a credential for DevOps.
|
||||
This file will not contain CRD, but the credential type constants and their fields.
|
||||
*/
|
||||
const (
|
||||
CredentialFinalizerName = "finalizers.kubesphere.io/credential"
|
||||
DevOpsCredentialPrefix = "credential.devops.kubesphere.io/"
|
||||
DevOpsCredentialDataHash = DevOpsCredentialPrefix + "datahash"
|
||||
// SecretTypeBasicAuth contains data needed for basic authentication.
|
||||
//
|
||||
// Required at least one of fields:
|
||||
// - Secret.Data["username"] - username used for authentication
|
||||
// - Secret.Data["password"] - password or token needed for authentication
|
||||
SecretTypeBasicAuth v1.SecretType = DevOpsCredentialPrefix + "basic-auth"
|
||||
// BasicAuthUsernameKey is the key of the username for SecretTypeBasicAuth secrets
|
||||
BasicAuthUsernameKey = "username"
|
||||
// BasicAuthPasswordKey is the key of the password or token for SecretTypeBasicAuth secrets
|
||||
BasicAuthPasswordKey = "password"
|
||||
|
||||
// SecretTypeSSHAuth contains data needed for ssh authentication.
|
||||
//
|
||||
// Required at least one of fields:
|
||||
// - Secret.Data["username"] - username used for authentication
|
||||
// - Secret.Data["passphrase"] - passphrase needed for authentication
|
||||
// - Secret.Data["privatekey"] - privatekey needed for authentication
|
||||
SecretTypeSSHAuth v1.SecretType = DevOpsCredentialPrefix + "ssh-auth"
|
||||
// SSHAuthUsernameKey is the key of the username for SecretTypeSSHAuth secrets
|
||||
SSHAuthUsernameKey = "username"
|
||||
// SSHAuthPrivateKey is the key of the passphrase for SecretTypeSSHAuth secrets
|
||||
SSHAuthPassphraseKey = "passphrase"
|
||||
// SSHAuthPrivateKey is the key of the privatekey for SecretTypeSSHAuth secrets
|
||||
SSHAuthPrivateKey = "private_key"
|
||||
|
||||
// SecretTypeSecretText contains data.
|
||||
//
|
||||
// Required at least one of fields:
|
||||
// - Secret.Data["secret"] - secret
|
||||
SecretTypeSecretText v1.SecretType = DevOpsCredentialPrefix + "secret-text"
|
||||
// SecretTextSecretKey is the key of the secret for SecretTypeSecretText secrets
|
||||
SecretTextSecretKey = "secret"
|
||||
|
||||
// SecretTypeKubeConfig contains data.
|
||||
//
|
||||
// Required at least one of fields:
|
||||
// - Secret.Data["secret"] - secret
|
||||
SecretTypeKubeConfig v1.SecretType = DevOpsCredentialPrefix + "kubeconfig"
|
||||
// KubeConfigSecretKey is the key of the secret for SecretTypeKubeConfig secrets
|
||||
KubeConfigSecretKey = "content"
|
||||
// CredentialAutoSyncAnnoKey is used to indicate whether the secret is automatically synchronized to devops.
|
||||
// In the old version, the credential is stored in jenkins and cannot be obtained.
|
||||
// This field is set to ensure that the secret is not overwritten by a nil value.
|
||||
CredentialAutoSyncAnnoKey = DevOpsCredentialPrefix + "autosync"
|
||||
CredentialSyncStatusAnnoKey = DevOpsCredentialPrefix + "syncstatus"
|
||||
CredentialSyncTimeAnnoKey = DevOpsCredentialPrefix + "synctime"
|
||||
CredentialSyncMsgAnnoKey = DevOpsCredentialPrefix + "syncmsg"
|
||||
)
|
||||
78
vendor/kubesphere.io/api/devops/v1alpha3/devopsproject_types.go
generated
vendored
78
vendor/kubesphere.io/api/devops/v1alpha3/devopsproject_types.go
generated
vendored
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
const DevOpsProjectFinalizerName = "devopsproject.finalizers.kubesphere.io"
|
||||
|
||||
const (
|
||||
ResourceKindDevOpsProject = "DevOpsProject"
|
||||
ResourceSingularDevOpsProject = "devopsproject"
|
||||
ResourcePluralDevOpsProject = "devopsprojects"
|
||||
DevOpsProjectPrefix = "devopsproject.devops.kubesphere.io/"
|
||||
DevOpeProjectSyncStatusAnnoKey = DevOpsProjectPrefix + "syncstatus"
|
||||
DevOpeProjectSyncTimeAnnoKey = DevOpsProjectPrefix + "synctime"
|
||||
DevOpeProjectSyncMsgAnnoKey = DevOpsProjectPrefix + "syncmsg"
|
||||
)
|
||||
|
||||
// DevOpsProjectSpec defines the desired state of DevOpsProject
|
||||
type DevOpsProjectSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
}
|
||||
|
||||
// DevOpsProjectStatus defines the observed state of DevOpsProject
|
||||
type DevOpsProjectStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
AdminNamespace string `json:"adminNamespace,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DevOpsProject is the Schema for the devopsprojects API
|
||||
// +kubebuilder:resource:categories="devops",scope="Cluster"
|
||||
// +k8s:openapi-gen=true
|
||||
type DevOpsProject struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec DevOpsProjectSpec `json:"spec,omitempty"`
|
||||
Status DevOpsProjectStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DevOpsProjectList contains a list of DevOpsProject
|
||||
type DevOpsProjectList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []DevOpsProject `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&DevOpsProject{}, &DevOpsProjectList{})
|
||||
}
|
||||
23
vendor/kubesphere.io/api/devops/v1alpha3/doc.go
generated
vendored
23
vendor/kubesphere.io/api/devops/v1alpha3/doc.go
generated
vendored
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha3 contains API Schema definitions for the devops v1alpha3 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=kubesphere.io/api/devops
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=devops.kubesphere.io
|
||||
package v1alpha3
|
||||
3411
vendor/kubesphere.io/api/devops/v1alpha3/openapi_generated.go
generated
vendored
3411
vendor/kubesphere.io/api/devops/v1alpha3/openapi_generated.go
generated
vendored
File diff suppressed because it is too large
Load Diff
230
vendor/kubesphere.io/api/devops/v1alpha3/pipeline_types.go
generated
vendored
230
vendor/kubesphere.io/api/devops/v1alpha3/pipeline_types.go
generated
vendored
@@ -1,230 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
const PipelineFinalizerName = "pipeline.finalizers.kubesphere.io"
|
||||
|
||||
const (
|
||||
ResourceKindPipeline = "Pipeline"
|
||||
ResourceSingularPipeline = "pipeline"
|
||||
ResourcePluralPipeline = "pipelines"
|
||||
PipelinePrefix = "pipeline.devops.kubesphere.io/"
|
||||
PipelineSpecHash = PipelinePrefix + "spechash"
|
||||
PipelineSyncStatusAnnoKey = PipelinePrefix + "syncstatus"
|
||||
PipelineSyncTimeAnnoKey = PipelinePrefix + "synctime"
|
||||
PipelineSyncMsgAnnoKey = PipelinePrefix + "syncmsg"
|
||||
)
|
||||
|
||||
// PipelineSpec defines the desired state of Pipeline
|
||||
type PipelineSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
Type string `json:"type" description:"type of devops pipeline, in scm or no scm"`
|
||||
Pipeline *NoScmPipeline `json:"pipeline,omitempty" description:"no scm pipeline structs"`
|
||||
MultiBranchPipeline *MultiBranchPipeline `json:"multi_branch_pipeline,omitempty" description:"in scm pipeline structs"`
|
||||
}
|
||||
|
||||
// PipelineStatus defines the observed state of Pipeline
|
||||
type PipelineStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Pipeline is the Schema for the pipelines API
|
||||
// +k8s:openapi-gen=true
|
||||
type Pipeline struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec PipelineSpec `json:"spec,omitempty"`
|
||||
Status PipelineStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PipelineList contains a list of Pipeline
|
||||
type PipelineList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Pipeline `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Pipeline{}, &PipelineList{})
|
||||
}
|
||||
|
||||
const (
|
||||
NoScmPipelineType = "pipeline"
|
||||
MultiBranchPipelineType = "multi-branch-pipeline"
|
||||
)
|
||||
|
||||
const (
|
||||
SourceTypeSVN = "svn"
|
||||
SourceTypeGit = "git"
|
||||
SourceTypeSingleSVN = "single_svn"
|
||||
SourceTypeGitlab = "gitlab"
|
||||
SourceTypeGithub = "github"
|
||||
SourceTypeBitbucket = "bitbucket_server"
|
||||
)
|
||||
|
||||
type NoScmPipeline struct {
|
||||
Name string `json:"name" description:"name of pipeline"`
|
||||
Description string `json:"description,omitempty" description:"description of pipeline"`
|
||||
Discarder *DiscarderProperty `json:"discarder,omitempty" description:"Discarder of pipeline, managing when to drop a pipeline"`
|
||||
Parameters []Parameter `json:"parameters,omitempty" description:"Parameters define of pipeline,user could pass param when run pipeline"`
|
||||
DisableConcurrent bool `json:"disable_concurrent,omitempty" mapstructure:"disable_concurrent" description:"Whether to prohibit the pipeline from running in parallel"`
|
||||
TimerTrigger *TimerTrigger `json:"timer_trigger,omitempty" mapstructure:"timer_trigger" description:"Timer to trigger pipeline run"`
|
||||
RemoteTrigger *RemoteTrigger `json:"remote_trigger,omitempty" mapstructure:"remote_trigger" description:"Remote api define to trigger pipeline run"`
|
||||
Jenkinsfile string `json:"jenkinsfile,omitempty" description:"Jenkinsfile's content'"`
|
||||
}
|
||||
|
||||
type MultiBranchPipeline struct {
|
||||
Name string `json:"name" description:"name of pipeline"`
|
||||
Description string `json:"description,omitempty" description:"description of pipeline"`
|
||||
Discarder *DiscarderProperty `json:"discarder,omitempty" description:"Discarder of pipeline, managing when to drop a pipeline"`
|
||||
TimerTrigger *TimerTrigger `json:"timer_trigger,omitempty" mapstructure:"timer_trigger" description:"Timer to trigger pipeline run"`
|
||||
SourceType string `json:"source_type" description:"type of scm, such as github/git/svn"`
|
||||
GitSource *GitSource `json:"git_source,omitempty" description:"git scm define"`
|
||||
GitHubSource *GithubSource `json:"github_source,omitempty" description:"github scm define"`
|
||||
GitlabSource *GitlabSource `json:"gitlab_source,omitempty" description:"gitlab scm define"`
|
||||
SvnSource *SvnSource `json:"svn_source,omitempty" description:"multi branch svn scm define"`
|
||||
SingleSvnSource *SingleSvnSource `json:"single_svn_source,omitempty" description:"single branch svn scm define"`
|
||||
BitbucketServerSource *BitbucketServerSource `json:"bitbucket_server_source,omitempty" description:"bitbucket server scm defile"`
|
||||
ScriptPath string `json:"script_path" mapstructure:"script_path" description:"script path in scm"`
|
||||
MultiBranchJobTrigger *MultiBranchJobTrigger `json:"multibranch_job_trigger,omitempty" mapstructure:"multibranch_job_trigger" description:"Pipeline tasks that need to be triggered when branch creation/deletion"`
|
||||
}
|
||||
|
||||
type GitSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Url string `json:"url,omitempty" mapstructure:"url" description:"url of git source"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access git source"`
|
||||
DiscoverBranches bool `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Whether to discover a branch"`
|
||||
DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tags configuration"`
|
||||
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
|
||||
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
|
||||
}
|
||||
|
||||
// GithubSource and BitbucketServerSource have the same structure, but we don't use one due to crd errors
|
||||
type GithubSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"`
|
||||
Repo string `json:"repo,omitempty" mapstructure:"repo" description:"repo name of github repo"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access github source"`
|
||||
ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri" description:"The api url can specify the location of the github apiserver.For private cloud configuration"`
|
||||
DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"`
|
||||
DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"`
|
||||
DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"`
|
||||
DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tag configuration"`
|
||||
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
|
||||
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
|
||||
}
|
||||
|
||||
type GitlabSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of gitlab repo"`
|
||||
Repo string `json:"repo,omitempty" mapstructure:"repo" description:"repo name of gitlab repo"`
|
||||
ServerName string `json:"server_name,omitempty" description:"the name of gitlab server which was configured in jenkins"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access gitlab source"`
|
||||
ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri" description:"The api url can specify the location of the gitlab apiserver.For private cloud configuration"`
|
||||
DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"`
|
||||
DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"`
|
||||
DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"`
|
||||
DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tags configuration"`
|
||||
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
|
||||
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
|
||||
}
|
||||
|
||||
type BitbucketServerSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"`
|
||||
Repo string `json:"repo,omitempty" mapstructure:"repo" description:"repo name of github repo"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access github source"`
|
||||
ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri" description:"The api url can specify the location of the github apiserver.For private cloud configuration"`
|
||||
DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"`
|
||||
DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"`
|
||||
DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"`
|
||||
DiscoverTags bool `json:"discover_tags,omitempty" mapstructure:"discover_tags" description:"Discover tag configuration"`
|
||||
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
|
||||
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
|
||||
}
|
||||
|
||||
type MultiBranchJobTrigger struct {
|
||||
CreateActionJobsToTrigger string `json:"create_action_job_to_trigger,omitempty" description:"pipeline name to trigger"`
|
||||
DeleteActionJobsToTrigger string `json:"delete_action_job_to_trigger,omitempty" description:"pipeline name to trigger"`
|
||||
}
|
||||
|
||||
type GitCloneOption struct {
|
||||
Shallow bool `json:"shallow,omitempty" mapstructure:"shallow" description:"Whether to use git shallow clone"`
|
||||
Timeout int `json:"timeout,omitempty" mapstructure:"timeout" description:"git clone timeout mins"`
|
||||
Depth int `json:"depth,omitempty" mapstructure:"depth" description:"git clone depth"`
|
||||
}
|
||||
|
||||
type SvnSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Remote string `json:"remote,omitempty" description:"remote address url"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access svn source"`
|
||||
Includes string `json:"includes,omitempty" description:"branches to run pipeline"`
|
||||
Excludes string `json:"excludes,omitempty" description:"branches do not run pipeline"`
|
||||
}
|
||||
type SingleSvnSource struct {
|
||||
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
|
||||
Remote string `json:"remote,omitempty" description:"remote address url"`
|
||||
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access svn source"`
|
||||
}
|
||||
|
||||
type DiscoverPRFromForks struct {
|
||||
Strategy int `json:"strategy,omitempty" mapstructure:"strategy" description:"github discover strategy"`
|
||||
Trust int `json:"trust,omitempty" mapstructure:"trust" description:"trust user type"`
|
||||
}
|
||||
|
||||
type DiscarderProperty struct {
|
||||
DaysToKeep string `json:"days_to_keep,omitempty" mapstructure:"days_to_keep" description:"days to keep pipeline"`
|
||||
NumToKeep string `json:"num_to_keep,omitempty" mapstructure:"num_to_keep" description:"nums to keep pipeline"`
|
||||
}
|
||||
|
||||
type Parameter struct {
|
||||
Name string `json:"name" description:"name of param"`
|
||||
DefaultValue string `json:"default_value,omitempty" mapstructure:"default_value" description:"default value of param"`
|
||||
Type string `json:"type" description:"type of param"`
|
||||
Description string `json:"description,omitempty" description:"description of pipeline"`
|
||||
}
|
||||
|
||||
type TimerTrigger struct {
|
||||
// user in no scm job
|
||||
Cron string `json:"cron,omitempty" description:"jenkins cron script"`
|
||||
|
||||
// use in multi-branch job
|
||||
Interval string `json:"interval,omitempty" description:"interval ms"`
|
||||
}
|
||||
|
||||
type RemoteTrigger struct {
|
||||
Token string `json:"token,omitempty" description:"remote trigger token"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Pipeline{}, &PipelineList{})
|
||||
}
|
||||
46
vendor/kubesphere.io/api/devops/v1alpha3/register.go
generated
vendored
46
vendor/kubesphere.io/api/devops/v1alpha3/register.go
generated
vendored
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// NOTE: Boilerplate only. Ignore this file.
|
||||
|
||||
// Package v1alpha3 contains API Schema definitions for the devops v1alpha3 API group
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=kubesphere.io/api/devops
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=devops.kubesphere.io
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "devops.kubesphere.io", Version: "v1alpha3"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme is required by pkg/client/...
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Resource is required by pkg/client/listers/...
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
561
vendor/kubesphere.io/api/devops/v1alpha3/zz_generated.deepcopy.go
generated
vendored
561
vendor/kubesphere.io/api/devops/v1alpha3/zz_generated.deepcopy.go
generated
vendored
@@ -1,561 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *BitbucketServerSource) DeepCopyInto(out *BitbucketServerSource) {
|
||||
*out = *in
|
||||
if in.DiscoverPRFromForks != nil {
|
||||
in, out := &in.DiscoverPRFromForks, &out.DiscoverPRFromForks
|
||||
*out = new(DiscoverPRFromForks)
|
||||
**out = **in
|
||||
}
|
||||
if in.CloneOption != nil {
|
||||
in, out := &in.CloneOption, &out.CloneOption
|
||||
*out = new(GitCloneOption)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerSource.
|
||||
func (in *BitbucketServerSource) DeepCopy() *BitbucketServerSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(BitbucketServerSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DevOpsProject) DeepCopyInto(out *DevOpsProject) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProject.
|
||||
func (in *DevOpsProject) DeepCopy() *DevOpsProject {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DevOpsProject)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *DevOpsProject) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DevOpsProjectList) DeepCopyInto(out *DevOpsProjectList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]DevOpsProject, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectList.
|
||||
func (in *DevOpsProjectList) DeepCopy() *DevOpsProjectList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DevOpsProjectList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *DevOpsProjectList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DevOpsProjectSpec) DeepCopyInto(out *DevOpsProjectSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectSpec.
|
||||
func (in *DevOpsProjectSpec) DeepCopy() *DevOpsProjectSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DevOpsProjectSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DevOpsProjectStatus) DeepCopyInto(out *DevOpsProjectStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevOpsProjectStatus.
|
||||
func (in *DevOpsProjectStatus) DeepCopy() *DevOpsProjectStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DevOpsProjectStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DiscarderProperty) DeepCopyInto(out *DiscarderProperty) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscarderProperty.
|
||||
func (in *DiscarderProperty) DeepCopy() *DiscarderProperty {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DiscarderProperty)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DiscoverPRFromForks) DeepCopyInto(out *DiscoverPRFromForks) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoverPRFromForks.
|
||||
func (in *DiscoverPRFromForks) DeepCopy() *DiscoverPRFromForks {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DiscoverPRFromForks)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitCloneOption) DeepCopyInto(out *GitCloneOption) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCloneOption.
|
||||
func (in *GitCloneOption) DeepCopy() *GitCloneOption {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitCloneOption)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitSource) DeepCopyInto(out *GitSource) {
|
||||
*out = *in
|
||||
if in.CloneOption != nil {
|
||||
in, out := &in.CloneOption, &out.CloneOption
|
||||
*out = new(GitCloneOption)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitSource.
|
||||
func (in *GitSource) DeepCopy() *GitSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GithubSource) DeepCopyInto(out *GithubSource) {
|
||||
*out = *in
|
||||
if in.DiscoverPRFromForks != nil {
|
||||
in, out := &in.DiscoverPRFromForks, &out.DiscoverPRFromForks
|
||||
*out = new(DiscoverPRFromForks)
|
||||
**out = **in
|
||||
}
|
||||
if in.CloneOption != nil {
|
||||
in, out := &in.CloneOption, &out.CloneOption
|
||||
*out = new(GitCloneOption)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubSource.
|
||||
func (in *GithubSource) DeepCopy() *GithubSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GithubSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitlabSource) DeepCopyInto(out *GitlabSource) {
|
||||
*out = *in
|
||||
if in.DiscoverPRFromForks != nil {
|
||||
in, out := &in.DiscoverPRFromForks, &out.DiscoverPRFromForks
|
||||
*out = new(DiscoverPRFromForks)
|
||||
**out = **in
|
||||
}
|
||||
if in.CloneOption != nil {
|
||||
in, out := &in.CloneOption, &out.CloneOption
|
||||
*out = new(GitCloneOption)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabSource.
|
||||
func (in *GitlabSource) DeepCopy() *GitlabSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitlabSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MultiBranchJobTrigger) DeepCopyInto(out *MultiBranchJobTrigger) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchJobTrigger.
|
||||
func (in *MultiBranchJobTrigger) DeepCopy() *MultiBranchJobTrigger {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MultiBranchJobTrigger)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MultiBranchPipeline) DeepCopyInto(out *MultiBranchPipeline) {
|
||||
*out = *in
|
||||
if in.Discarder != nil {
|
||||
in, out := &in.Discarder, &out.Discarder
|
||||
*out = new(DiscarderProperty)
|
||||
**out = **in
|
||||
}
|
||||
if in.TimerTrigger != nil {
|
||||
in, out := &in.TimerTrigger, &out.TimerTrigger
|
||||
*out = new(TimerTrigger)
|
||||
**out = **in
|
||||
}
|
||||
if in.GitSource != nil {
|
||||
in, out := &in.GitSource, &out.GitSource
|
||||
*out = new(GitSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.GitHubSource != nil {
|
||||
in, out := &in.GitHubSource, &out.GitHubSource
|
||||
*out = new(GithubSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.GitlabSource != nil {
|
||||
in, out := &in.GitlabSource, &out.GitlabSource
|
||||
*out = new(GitlabSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.SvnSource != nil {
|
||||
in, out := &in.SvnSource, &out.SvnSource
|
||||
*out = new(SvnSource)
|
||||
**out = **in
|
||||
}
|
||||
if in.SingleSvnSource != nil {
|
||||
in, out := &in.SingleSvnSource, &out.SingleSvnSource
|
||||
*out = new(SingleSvnSource)
|
||||
**out = **in
|
||||
}
|
||||
if in.BitbucketServerSource != nil {
|
||||
in, out := &in.BitbucketServerSource, &out.BitbucketServerSource
|
||||
*out = new(BitbucketServerSource)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.MultiBranchJobTrigger != nil {
|
||||
in, out := &in.MultiBranchJobTrigger, &out.MultiBranchJobTrigger
|
||||
*out = new(MultiBranchJobTrigger)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchPipeline.
|
||||
func (in *MultiBranchPipeline) DeepCopy() *MultiBranchPipeline {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MultiBranchPipeline)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NoScmPipeline) DeepCopyInto(out *NoScmPipeline) {
|
||||
*out = *in
|
||||
if in.Discarder != nil {
|
||||
in, out := &in.Discarder, &out.Discarder
|
||||
*out = new(DiscarderProperty)
|
||||
**out = **in
|
||||
}
|
||||
if in.Parameters != nil {
|
||||
in, out := &in.Parameters, &out.Parameters
|
||||
*out = make([]Parameter, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.TimerTrigger != nil {
|
||||
in, out := &in.TimerTrigger, &out.TimerTrigger
|
||||
*out = new(TimerTrigger)
|
||||
**out = **in
|
||||
}
|
||||
if in.RemoteTrigger != nil {
|
||||
in, out := &in.RemoteTrigger, &out.RemoteTrigger
|
||||
*out = new(RemoteTrigger)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoScmPipeline.
|
||||
func (in *NoScmPipeline) DeepCopy() *NoScmPipeline {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NoScmPipeline)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Parameter) DeepCopyInto(out *Parameter) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameter.
|
||||
func (in *Parameter) DeepCopy() *Parameter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Parameter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Pipeline) DeepCopyInto(out *Pipeline) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline.
|
||||
func (in *Pipeline) DeepCopy() *Pipeline {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Pipeline)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Pipeline) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PipelineList) DeepCopyInto(out *PipelineList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Pipeline, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineList.
|
||||
func (in *PipelineList) DeepCopy() *PipelineList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PipelineList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *PipelineList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) {
|
||||
*out = *in
|
||||
if in.Pipeline != nil {
|
||||
in, out := &in.Pipeline, &out.Pipeline
|
||||
*out = new(NoScmPipeline)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.MultiBranchPipeline != nil {
|
||||
in, out := &in.MultiBranchPipeline, &out.MultiBranchPipeline
|
||||
*out = new(MultiBranchPipeline)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec.
|
||||
func (in *PipelineSpec) DeepCopy() *PipelineSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PipelineSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PipelineStatus) DeepCopyInto(out *PipelineStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStatus.
|
||||
func (in *PipelineStatus) DeepCopy() *PipelineStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PipelineStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RemoteTrigger) DeepCopyInto(out *RemoteTrigger) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteTrigger.
|
||||
func (in *RemoteTrigger) DeepCopy() *RemoteTrigger {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RemoteTrigger)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SingleSvnSource) DeepCopyInto(out *SingleSvnSource) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleSvnSource.
|
||||
func (in *SingleSvnSource) DeepCopy() *SingleSvnSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SingleSvnSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SvnSource) DeepCopyInto(out *SvnSource) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvnSource.
|
||||
func (in *SvnSource) DeepCopy() *SvnSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SvnSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TimerTrigger) DeepCopyInto(out *TimerTrigger) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimerTrigger.
|
||||
func (in *TimerTrigger) DeepCopy() *TimerTrigger {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TimerTrigger)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
88
vendor/kubesphere.io/api/gateway/v1alpha1/gateway_types.go
generated
vendored
88
vendor/kubesphere.io/api/gateway/v1alpha1/gateway_types.go
generated
vendored
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// GatewaySpec defines the desired state of Gateway
|
||||
type GatewaySpec struct {
|
||||
Conroller ControllerSpec `json:"controller,omitempty"`
|
||||
Service ServiceSpec `json:"service,omitempty"`
|
||||
Deployment DeploymentSpec `json:"deployment,omitempty"`
|
||||
}
|
||||
|
||||
type ControllerSpec struct {
|
||||
// +optional
|
||||
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
// +optional
|
||||
Config map[string]string `json:"config,omitempty"`
|
||||
// +optional
|
||||
Scope Scope `json:"scope,omitempty"`
|
||||
}
|
||||
|
||||
type ServiceSpec struct {
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
// +optional
|
||||
Type corev1.ServiceType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type DeploymentSpec struct {
|
||||
// +optional
|
||||
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
||||
|
||||
type Scope struct {
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
//+kubebuilder:object:root=true
|
||||
//+kubebuilder:subresource:status
|
||||
//+genclient
|
||||
|
||||
// Gateway is the Schema for the gateways API
|
||||
type Gateway struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec GatewaySpec `json:"spec,omitempty"`
|
||||
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
Status runtime.RawExtension `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
//+kubebuilder:object:root=true
|
||||
|
||||
// GatewayList contains a list of Gateway
|
||||
type GatewayList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Gateway `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&Gateway{}, &GatewayList{})
|
||||
}
|
||||
41
vendor/kubesphere.io/api/gateway/v1alpha1/register.go
generated
vendored
41
vendor/kubesphere.io/api/gateway/v1alpha1/register.go
generated
vendored
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the gateway.kubesphere.io v1alpha1 API group
|
||||
//+kubebuilder:object:generate=true
|
||||
//+groupName=gateway.kubesphere.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "gateway.kubesphere.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Resource is required by pkg/client/listers/...
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
194
vendor/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go
generated
vendored
194
vendor/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@@ -1,194 +0,0 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2020 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ControllerSpec) DeepCopyInto(out *ControllerSpec) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
out.Scope = in.Scope
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerSpec.
|
||||
func (in *ControllerSpec) DeepCopy() *ControllerSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ControllerSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpec.
|
||||
func (in *DeploymentSpec) DeepCopy() *DeploymentSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeploymentSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Gateway) DeepCopyInto(out *Gateway) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway.
|
||||
func (in *Gateway) DeepCopy() *Gateway {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Gateway)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Gateway) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GatewayList) DeepCopyInto(out *GatewayList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Gateway, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList.
|
||||
func (in *GatewayList) DeepCopy() *GatewayList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GatewayList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GatewayList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) {
|
||||
*out = *in
|
||||
in.Conroller.DeepCopyInto(&out.Conroller)
|
||||
in.Service.DeepCopyInto(&out.Service)
|
||||
in.Deployment.DeepCopyInto(&out.Deployment)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec.
|
||||
func (in *GatewaySpec) DeepCopy() *GatewaySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GatewaySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Scope) DeepCopyInto(out *Scope) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scope.
|
||||
func (in *Scope) DeepCopy() *Scope {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Scope)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec.
|
||||
func (in *ServiceSpec) DeepCopy() *ServiceSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user