Skip to content

Commit

Permalink
feat: update apis version and README (#13)
Browse files Browse the repository at this point in the history
* feat: update apis version and typos

* chron: update README and add gadge
  • Loading branch information
whg517 authored Jan 11, 2024
1 parent ea9cc9c commit 0daa6ac
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 232 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CHANGELOG

## v0.0.1 2021-01-11

### features

- Add `DatabaseConnection` and `Database` struct, and implement mysql, postgres, redis.
- Add `S3Conection` and `S3Bucket` struct.
- Add `AuthenticationClass` struct, and implement oidc.
- Add errors and conditions constants
- Add `CreateOrUpdate` for k8s object create or update.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# Operator-go

## 1. Introduction to Operator-go
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/zncdata-labs/operator-go)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/zncdata-labs/operator-go)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/zncdata-labs/operator-go/ci.yml)
![GitHub License](https://img.shields.io/github/license/zncdata-labs/commons-operator)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/zncdata-labs/operator-go)

Operator-go is the public class library of operator under zncdata, which is mainly used to handle operator-related logic.

## 2. Directory introduction
## Features

Since they are all public class libraries, the main codes are placed in the pkg directory.

### pkg/spec directory

This directory extracts the public parts of the operator developed by zncdata for easy application, and content will be added in the future.
Among them, commons-spec is special. Commons-spec is the spec part of commons-operator.
commons-operator will be referenced by many operators in the planning of zncdata, so it is extracted separately to facilitate the use of other projects.

### pkg/status directory

This directory defines the status of the operator. Currently, the status of the operator in zncdata is relatively unified.
It is currently separated and content will be added in the future.
- Database Connection CRD, which provides database connection and database configuration for applications, has implemented Mysql, Postgres, Redis
- S3 Connection CRD: Provides S3 connection and S3 bucket configuration for applications
- Authentication CRD provides flexible authentication for applications and has been configured with oidc
- Error and condition constants
- k8s object creation or update optimization
28 changes: 13 additions & 15 deletions READNE_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# Operator-go
# operator-go

## 1. Operator-go简介
Operator-go 是 zncdata-stack 中 operator 开发需要用公共类库,主要用于处理 operator 的相关逻辑。

Operator-go 是 zncdata 下的 operator 的公共类库,主要用于处理 operator 的相关逻辑。
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/zncdata-labs/operator-go)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/zncdata-labs/operator-go)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/zncdata-labs/operator-go/ci.yml)
![GitHub License](https://img.shields.io/github/license/zncdata-labs/commons-operator)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/zncdata-labs/operator-go)

## 2. 目录介绍
## 特性

由于都是公共类库,所以主要代码都放在了pkg目录下。

### pkg/spec 目录

该目录把zncdata 开发的 operator 的公共部分提取出来,方便应用,后续会陆续增加内容
其中 commons-spec比较特殊,Commons-spec 是commons-operator 的 spec 部分,commons-operator 在 zncdata 的规划中会被许多
operator 引用,所以把它单独提取出来,方便其他项目使用。

### pkg/status 目录

该目录是对 operator 的状态进行定义,目前 zncdata 的 operator 的 status 比较统一,目前抽离了出来,后续会陆续增加内容
- 数据库连接 CRD ,为应用提供数据库连接和数据库配置,目前已经实现 Mysql , Postgres , Redis
- S3连接 CRD ,为应用提供 S3 连接和 S3 桶配置
- 认证 CRD,为应用提供灵活的认证方式,已经实现 oidc 配置
- 错误和条件常量
- k8s 对象创建或更新的优化
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alhpa1
package v1alpha1

type ResponseType string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alhpa1
package v1alpha1

import (
"github.com/zncdata-labs/operator-go/pkg/status"
Expand Down Expand Up @@ -140,5 +140,5 @@ type RedisProvider struct {
// +kubebuilder:validation:Required
Port string `json:"port,omitempty"`
// +kubebuilder:validation:Optional
Password string `json:"password,omitempty"`
Credential *DatabaseConnectionCredentialSpec `json:"credential,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// +kubebuilder:object:generate=true
// +groupName=stack.zncdata.net

package v1alhpa1
package v1alpha1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alhpa1
package v1alpha1

import (
"github.com/zncdata-labs/operator-go/pkg/status"
Expand All @@ -33,6 +33,9 @@ type S3ConnectionSpec struct {
Region string `json:"region,omitempty"`
// +kubebuilder:validation:Optional
SSL bool `json:"ssl,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default:=false
PathStyle bool `json:"pathStyle,omitempty"`
}

// S3Credential include AccessKey and SecretKey or ExistingSecret.
Expand Down

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

29 changes: 0 additions & 29 deletions pkg/image/image_spec.go

This file was deleted.

44 changes: 0 additions & 44 deletions pkg/ingress/ingress_spec.go

This file was deleted.

87 changes: 0 additions & 87 deletions pkg/persistence/persistence_spec.go

This file was deleted.

36 changes: 0 additions & 36 deletions pkg/service/service_spec.go

This file was deleted.

File renamed without changes.

0 comments on commit 0daa6ac

Please sign in to comment.