Skip to content

Commit

Permalink
Merge pull request kosmos-io#79 from wangyizhi1/main
Browse files Browse the repository at this point in the history
feat: Merge the clusterlink directory
  • Loading branch information
kosmos-robot authored Oct 3, 2023
2 parents 558cbba + 19b7be8 commit 525aee7
Show file tree
Hide file tree
Showing 98 changed files with 80 additions and 80 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ $(CMD_TARGET):
#
# Example:
# make images
# make make image-clusterlink-controller-manager
# make make image-clusterlink-controller-manager GOARCH=arm64
# make image-clusterlink-controller-manager
# make image-clusterlink-controller-manager GOARCH=arm64
IMAGE_TARGET=$(addprefix image-, $(TARGETS))
.PHONY: $(IMAGE_TARGET)
$(IMAGE_TARGET):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/link-agent/app/options"
"github.com/kosmos.io/kosmos/cmd/clusterlink/agent/app/options"
linkagent "github.com/kosmos.io/kosmos/pkg/clusterlink/agent"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network"
kosmosclientset "github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
kosmosinformer "github.com/kosmos.io/kosmos/pkg/generated/informers/externalversions"
linkagent "github.com/kosmos.io/kosmos/pkg/link-agent"
"github.com/kosmos.io/kosmos/pkg/network"
"github.com/kosmos.io/kosmos/pkg/scheme"
"github.com/kosmos.io/kosmos/pkg/sharedcli"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"

"github.com/kosmos.io/kosmos/cmd/network-manager/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/agent/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/link-controller-manager/app/options"
"github.com/kosmos.io/kosmos/cmd/clusterlink/controller-manager/app/options"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/context"
"github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/link-controllers/context"
"github.com/kosmos.io/kosmos/pkg/scheme"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

"github.com/kosmos.io/kosmos/cmd/link-controller-manager/app/options"
"github.com/kosmos.io/kosmos/cmd/clusterlink/controller-manager/app/options"
clusterlinkv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/context"
"github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
"github.com/kosmos.io/kosmos/pkg/generated/informers/externalversions"
"github.com/kosmos.io/kosmos/pkg/generated/listers/kosmos/v1alpha1"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/link-controllers/context"
"github.com/kosmos.io/kosmos/pkg/utils"
"github.com/kosmos.io/kosmos/pkg/utils/keys"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/calicoippool"
"github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/cluster"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/context"
"github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/node"
"github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/nodecidr"
"github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
"github.com/kosmos.io/kosmos/pkg/link-controllers/calicoippool"
"github.com/kosmos.io/kosmos/pkg/link-controllers/cluster"
ctrlcontext "github.com/kosmos.io/kosmos/pkg/link-controllers/context"
"github.com/kosmos.io/kosmos/pkg/link-controllers/node"
"github.com/kosmos.io/kosmos/pkg/link-controllers/nodecidr"
)

func startClusterController(ctx ctrlcontext.Context) (bool, ctrlcontext.CleanFunc, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"k8s.io/component-base/cli"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/link-controller-manager/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/controller-manager/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"k8s.io/component-base/term"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/cmd/link-elector/app/options"
"github.com/kosmos.io/kosmos/pkg/elector"
"github.com/kosmos.io/kosmos/cmd/clusterlink/elector/app/options"
"github.com/kosmos.io/kosmos/pkg/clusterlink/elector"
"github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
"github.com/kosmos.io/kosmos/pkg/sharedcli"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"k8s.io/component-base/cli"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/link-elector/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/elector/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"k8s.io/component-base/term"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/cmd/floater/app/options"
"github.com/kosmos.io/kosmos/cmd/clusterlink/floater/app/options"
"github.com/kosmos.io/kosmos/pkg/sharedcli"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/floater/main.go → cmd/clusterlink/floater/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"

"github.com/kosmos.io/kosmos/cmd/floater/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/floater/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"k8s.io/klog/v2"
controllerruntime "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/network-manager/app/options"
networkmanager "github.com/kosmos.io/kosmos/pkg/network-manager"
"github.com/kosmos.io/kosmos/cmd/clusterlink/network-manager/app/options"
networkmanager "github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager"
"github.com/kosmos.io/kosmos/pkg/scheme"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"

"github.com/kosmos.io/kosmos/cmd/link-agent/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/network-manager/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/kosmos.io/kosmos/cmd/operator/app/options"
"github.com/kosmos.io/kosmos/pkg/operator"
"github.com/kosmos.io/kosmos/cmd/clusterlink/operator/app/options"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator"
"github.com/kosmos.io/kosmos/pkg/scheme"
"github.com/kosmos.io/kosmos/pkg/sharedcli"
"github.com/kosmos.io/kosmos/pkg/sharedcli/klogflag"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/operator/main.go → cmd/clusterlink/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"

"github.com/kosmos.io/kosmos/cmd/operator/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/operator/app"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"k8s.io/component-base/term"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/cmd/link-proxy/app/options"
"github.com/kosmos.io/kosmos/cmd/clusterlink/proxy/app/options"
)

// NewClusterLinkProxyCommand creates a *cobra.Command object with default parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"k8s.io/component-base/logs"
logsapi "k8s.io/component-base/logs/api/v1"

"github.com/kosmos.io/kosmos/pkg/proxy"
"github.com/kosmos.io/kosmos/pkg/clusterlink/proxy"
)

// Options contains command line parameters for clusterlink-proxy
Expand Down
2 changes: 1 addition & 1 deletion cmd/link-proxy/main.go → cmd/clusterlink/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/component-base/cli"

"github.com/kosmos.io/kosmos/cmd/link-proxy/app"
"github.com/kosmos.io/kosmos/cmd/clusterlink/proxy/app"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function build_binary_for_platform() {
set +x

if [[ "${target}" == "clusterlink-floater" ]]; then
cp -r "cmd/floater/certificate" "_output/bin/${platform}/"
cp -r "cmd/clusterlink/floater/certificate" "_output/bin/${platform}/"
fi
}

Expand Down
14 changes: 7 additions & 7 deletions hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ CLUSTERLINK_GO_PACKAGE="github.com/kosmos.io/kosmos"
MIN_Go_VERSION=go1.19.0

CLUSTERLINK_TARGET_SOURCE=(
clusterlink-proxy=cmd/link-proxy
clusterlink-operator=cmd/operator
clusterlink-elector=cmd/link-elector
clusterlink-agent=cmd/link-agent
clusterlink-controller-manager=cmd/link-controller-manager
clusterlink-proxy=cmd/clusterlink/proxy
clusterlink-operator=cmd/clusterlink/operator
clusterlink-elector=cmd/clusterlink/elector
clusterlink-agent=cmd/clusterlink/agent
clusterlink-floater=cmd/clusterlink/floater
clusterlink-network-manager=cmd/clusterlink/network-manager
clusterlink-controller-manager=cmd/clusterlink/controller-manager
kosmosctl=cmd/kosmosctl
clusterlink-floater=cmd/floater
clusterlink-network-manager=cmd/network-manager
)

#https://textkool.com/en/ascii-art-generator?hl=default&vl=default&font=DOS%20Rebel&text=KOSMOS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package link_agent
package agent

import (
"context"
Expand All @@ -18,9 +18,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"

kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
networkmanager "github.com/kosmos.io/kosmos/pkg/clusterlink/agent/network-manager"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network"
kosmosv1alpha1lister "github.com/kosmos.io/kosmos/pkg/generated/listers/kosmos/v1alpha1"
networkmanager "github.com/kosmos.io/kosmos/pkg/link-agent/network-manager"
"github.com/kosmos.io/kosmos/pkg/network"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"k8s.io/klog/v2"

clusterlinkv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network"
)

var lock = &sync.RWMutex{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"k8s.io/klog/v2"

kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
helper "github.com/kosmos.io/kosmos/pkg/clusterlink/controllers/cluster"
"github.com/kosmos.io/kosmos/pkg/generated/clientset/versioned"
"github.com/kosmos.io/kosmos/pkg/generated/informers/externalversions"
"github.com/kosmos.io/kosmos/pkg/generated/listers/kosmos/v1alpha1"
helper "github.com/kosmos.io/kosmos/pkg/link-controllers/cluster"
"github.com/kosmos.io/kosmos/pkg/utils"
"github.com/kosmos.io/kosmos/pkg/utils/flags"
"github.com/kosmos.io/kosmos/pkg/utils/keys"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/source"

clusterlinkv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network-manager/handlers"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/handlers"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package handlers

import (
"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
)

// Context Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/constants"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
)

type GlobalMap struct {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
)

// NodeConfig network configuration of the node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/constants"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
utilnet "github.com/kosmos.io/kosmos/pkg/utils/net"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package handlers

import (
"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/constants"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
)

type VxBridgeNetwork struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package handlers

import (
"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/constants"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
)

type VxLocalNetwork struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network-manager/handlers"
"github.com/kosmos.io/kosmos/pkg/network-manager/helpers"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/handlers"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network-manager/helpers"
)

type Manager struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/network/env.go → pkg/clusterlink/network/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
ipt "github.com/coreos/go-iptables/iptables"
"github.com/pkg/errors"

"github.com/kosmos.io/kosmos/pkg/network/iptables"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network/iptables"
)

func UpdateDefaultIp6tablesBehavior(ifaceName string) error {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"k8s.io/klog/v2"

clusterlinkv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1"
"github.com/kosmos.io/kosmos/pkg/network/iptables"
"github.com/kosmos.io/kosmos/pkg/clusterlink/network/iptables"
)

type IptablesRecord struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/operator/util"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/clusterlink/operator/util"
utils2 "github.com/kosmos.io/kosmos/pkg/utils"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
clientsetscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/operator/util"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/clusterlink/operator/util"
utils2 "github.com/kosmos.io/kosmos/pkg/utils"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
clientsetscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog/v2"

"github.com/kosmos.io/kosmos/pkg/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/operator/util"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/option"
"github.com/kosmos.io/kosmos/pkg/clusterlink/operator/addons/utils"
cmdutil "github.com/kosmos.io/kosmos/pkg/clusterlink/operator/util"
)

type Installer struct {
Expand Down
File renamed without changes.
Loading

0 comments on commit 525aee7

Please sign in to comment.