Skip to content

Commit

Permalink
feat: update gh group to zncdatadev (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 authored May 30, 2024
1 parent 23ae2b2 commit dd098f3
Show file tree
Hide file tree
Showing 48 changed files with 170 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

deploy-operator:
name: Deploy operator
if: github.event_name == 'push' && github.ref_type == 'tag' && github.repository_owner == 'zncdata-labs'
if: github.event_name == 'push' && github.ref_type == 'tag' && github.repository_owner == 'zncdatadev'
runs-on: ubuntu-22.04
needs:
- golang-test
Expand Down
4 changes: 2 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: hdfs-operator
repo: github.com/zncdata-labs/hdfs-operator
repo: github.com/zncdatadev/hdfs-operator
resources:
- api:
crdVersion: v1
Expand All @@ -18,6 +18,6 @@ resources:
domain: zncdata.dev
group: hdfs
kind: HdfsCluster
path: github.com/zncdata-labs/hdfs-operator/api/v1alpha1
path: github.com/zncdatadev/hdfs-operator/api/v1alpha1
version: v1alpha1
version: "3"
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,81 @@
# hdfs-operator

// TODO(user): Add simple overview of use/purpose

## Description

// TODO(user): An in-depth paragraph about your project and overview of use

## Getting Started

You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

### Running on the cluster

1. Install Instances of Custom Resources:

```sh
kubectl apply -f config/samples/
```
```sh
kubectl apply -f config/samples/
```

2. Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=<some-registry>/hdfs-operator:tag
```
```sh
make docker-build docker-push IMG=<some-registry>/hdfs-operator:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=<some-registry>/hdfs-operator:tag
```
```sh
make deploy IMG=<some-registry>/hdfs-operator:tag
```

### Uninstall CRDs

To delete the CRDs from the cluster:

```sh
make uninstall
```

### Undeploy controller

UnDeploy the controller from the cluster:

```sh
make undeploy
```

## Contributing

// TODO(user): Add detailed information on how you would like others to contribute to this project

### How it works

This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).

It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

### Test It Out

1. Install the CRDs into the cluster:

```sh
make install
```
```sh
make install
```

2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):

```sh
make run
```
```sh
make run
```

**NOTE:** You can also run this in one step by running: `make install run`

### Modifying the API definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

```sh
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/hdfscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1

import (
"github.com/zncdata-labs/operator-go/pkg/status"
"github.com/zncdatadev/operator-go/pkg/status"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
9 changes: 5 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"flag"
"fmt"
"os"
"strings"

"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"strings"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand All @@ -35,9 +36,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/controller"
listenerv1alpha1 "github.com/zncdata-labs/listener-operator/api/v1alpha1"
hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/controller"
listenerv1alpha1 "github.com/zncdatadev/listener-operator/api/v1alpha1"
//+kubebuilder:scaffold:imports
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ spec:
name: luwei
maturity: alpha
provider:
name: zncdata-labs
url: https://github.com/zncdata-labs/hdfs-operator
name: zncdatadev
url: https://github.com/zncdatadev/hdfs-operator
version: 0.0.0
2 changes: 1 addition & 1 deletion deploy/catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
securityContextConfig: restricted
image: registry.cn-hangzhou.aliyuncs.com/luwei-dev/hdfs-operator-catalog:latest
displayName: hdfs-catalog
publisher: zncdata-labs
publisher: zncdatadev
updateStrategy:
registryPoll:
interval: 20m
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/zncdata-labs/hdfs-operator
module github.com/zncdatadev/hdfs-operator

go 1.21

require (
emperror.dev/errors v0.8.1
github.com/cisco-open/k8s-objectmatcher v1.9.0
github.com/go-logr/logr v1.4.1
github.com/onsi/ginkgo/v2 v2.17.2
github.com/onsi/ginkgo/v2 v2.17.3
github.com/onsi/gomega v1.33.1
github.com/zncdata-labs/listener-operator v0.0.0-20240327072052-627c01d79e82
github.com/zncdata-labs/operator-go v0.4.0
github.com/zncdatadev/listener-operator v0.0.0-20240521093857-96c738598120
github.com/zncdatadev/operator-go v0.5.0
k8s.io/api v0.29.3
k8s.io/apimachinery v0.29.3
k8s.io/client-go v0.29.3
Expand Down Expand Up @@ -55,7 +55,7 @@ require (
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g=
github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU=
github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -110,10 +110,10 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zncdata-labs/listener-operator v0.0.0-20240327072052-627c01d79e82 h1:sFLuM58WmVF8TWbywbNNpCeFhoR+706MUW4DRdD7cOE=
github.com/zncdata-labs/listener-operator v0.0.0-20240327072052-627c01d79e82/go.mod h1:hFm07JapANcrr7U7QY+z1XHM2LdXjEXfQGSyBaraj1U=
github.com/zncdata-labs/operator-go v0.4.0 h1:R4GUEsOn6PaDhTB0z4NvZrnKRQLiR2bdPyVpCzsIFTw=
github.com/zncdata-labs/operator-go v0.4.0/go.mod h1:y5EDDKn3tt5X9RiO+xsVAw26Xk65bdO1j3R0w1MA5d4=
github.com/zncdatadev/listener-operator v0.0.0-20240521093857-96c738598120 h1:R1Iqqd5NA9Utq0CLuMnWsoDXqDdc5yJPF6q10KDZ5Es=
github.com/zncdatadev/listener-operator v0.0.0-20240521093857-96c738598120/go.mod h1:irFkxipcaTn4uEWXeehbrWRr+DZB2xjmckakry+U9r0=
github.com/zncdatadev/operator-go v0.5.0 h1:VGpApTrre2brmZTT7x3GPOJsYLNZtGolddfI5szA7wg=
github.com/zncdatadev/operator-go v0.5.0/go.mod h1:O5CSSSV6GUjxy13jXDrCpluCwKF60xGHQ+m+3GJARF8=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
Expand All @@ -139,8 +139,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ=
golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
7 changes: 4 additions & 3 deletions internal/common/hdfs_conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package common

import (
"fmt"
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/util"
corev1 "k8s.io/api/core/v1"
"strconv"
"strings"

hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/util"
corev1 "k8s.io/api/core/v1"
)

const coreSiteTemplate = `<?xml version="1.0"?>
Expand Down
3 changes: 2 additions & 1 deletion internal/common/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package common
import (
"context"
"fmt"
"github.com/zncdata-labs/hdfs-operator/internal/util"

"github.com/zncdatadev/hdfs-operator/internal/util"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
3 changes: 2 additions & 1 deletion internal/common/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package common

import (
"context"
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"

hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"

policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
7 changes: 4 additions & 3 deletions internal/common/resouce_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package common
import (
"context"
"fmt"
"github.com/zncdata-labs/hdfs-operator/internal/util"
opgostatus "github.com/zncdata-labs/operator-go/pkg/status"
"time"

"github.com/zncdatadev/hdfs-operator/internal/util"
opgostatus "github.com/zncdatadev/operator-go/pkg/status"
corev1 "k8s.io/api/core/v1"
apimeta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"time"
)

// ResourceBuilderType union type for resource builder
Expand Down
7 changes: 4 additions & 3 deletions internal/common/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package common
import (
"context"
"fmt"
"reflect"
"strings"

"github.com/go-logr/logr"
"github.com/zncdata-labs/hdfs-operator/internal/util"
"github.com/zncdatadev/hdfs-operator/internal/util"
"k8s.io/apimachinery/pkg/runtime"
"reflect"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"strings"
)

type Role string
Expand Down
8 changes: 5 additions & 3 deletions internal/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package common

import (
"fmt"
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/util"
"strings"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"strings"

hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/util"
)

func OverrideEnvVars(origin *[]corev1.EnvVar, override map[string]string) {
Expand Down
11 changes: 6 additions & 5 deletions internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package controller

import (
"context"

"github.com/go-logr/logr"
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/common"
"github.com/zncdata-labs/hdfs-operator/internal/controller/data"
"github.com/zncdata-labs/hdfs-operator/internal/controller/journal"
"github.com/zncdata-labs/hdfs-operator/internal/controller/name"
hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/common"
"github.com/zncdatadev/hdfs-operator/internal/controller/data"
"github.com/zncdatadev/hdfs-operator/internal/controller/journal"
"github.com/zncdatadev/hdfs-operator/internal/controller/name"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
9 changes: 5 additions & 4 deletions internal/controller/data/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package data

import (
"context"
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/common"
"github.com/zncdata-labs/hdfs-operator/internal/controller/data/container"
"github.com/zncdata-labs/hdfs-operator/internal/util"

hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/common"
"github.com/zncdatadev/hdfs-operator/internal/controller/data/container"
"github.com/zncdatadev/hdfs-operator/internal/util"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/data/container/datanode.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package container

import (
hdfsv1alpha1 "github.com/zncdata-labs/hdfs-operator/api/v1alpha1"
"github.com/zncdata-labs/hdfs-operator/internal/common"
hdfsv1alpha1 "github.com/zncdatadev/hdfs-operator/api/v1alpha1"
"github.com/zncdatadev/hdfs-operator/internal/common"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/data/container/init_container.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package container

import (
"github.com/zncdata-labs/hdfs-operator/internal/common"
corev1 "k8s.io/api/core/v1"
"strings"

"github.com/zncdatadev/hdfs-operator/internal/common"
corev1 "k8s.io/api/core/v1"
)

type WaitNameNodeContainerBuilder struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/data/container/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package container

import "github.com/zncdata-labs/hdfs-operator/internal/common"
import "github.com/zncdatadev/hdfs-operator/internal/common"

func DataNodeConfVolumeName() string {
return "datanode-config"
Expand Down
Loading

0 comments on commit dd098f3

Please sign in to comment.