Skip to content

Commit

Permalink
move discovery, scheme and informer to pkg/runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Iceber Gu <[email protected]>
  • Loading branch information
Iceber committed Jun 24, 2024
1 parent 83cb0f0 commit 369cbab
Show file tree
Hide file tree
Showing 31 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cmd/controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/clusterpedia-io/clusterpedia/pkg/controller/pediaclusterlifecycle"
clientset "github.com/clusterpedia-io/clusterpedia/pkg/generated/clientset/versioned"
"github.com/clusterpedia-io/clusterpedia/pkg/generated/informers/externalversions"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer"
clusterpediafeature "github.com/clusterpedia-io/clusterpedia/pkg/utils/feature"
"github.com/clusterpedia-io/clusterpedia/pkg/version/verflag"
)
Expand Down
8 changes: 4 additions & 4 deletions hack/verify-forked-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ set -o nounset
set -o pipefail

reflector=0
diff vendor/k8s.io/client-go/tools/cache/reflector.go pkg/synchromanager/clustersynchro/informer/cache/.reflector.go || reflector=$?
diff vendor/k8s.io/client-go/tools/cache/reflector.go pkg/runtime/informer/cache/.reflector.go || reflector=$?

if [[ $reflector -eq 0 ]]
then
echo "'reflector.go' is up to date."
else
echo "the file 'reflector.go' in vendor has been changed, please update the 'cache/.reflector.go' and 'reflector.go' in the pkg/synchromanager/clustersynchro/informer"
echo "the file 'reflector.go' in vendor has been changed, please update the 'cache/.reflector.go' and 'reflector.go' in the pkg/runtime/informer"
exit 1
fi

pager=0
diff vendor/k8s.io/client-go/tools/pager/pager.go pkg/synchromanager/clustersynchro/informer/pager/.pager.go.copy || pager=$?
diff vendor/k8s.io/client-go/tools/pager/pager.go pkg/runtime/informer/pager/.pager.go.copy || pager=$?

if [[ $pager -eq 0 ]]
then
echo "'pager.go' is up to date."
else
echo "the file 'pager.go' in vendor has been changed, please update the '.pager.go.copy' and 'pager.go' in the pkg/synchromanager/clustersynchro/informer/pager"
echo "the file 'pager.go' in vendor has been changed, please update the '.pager.go.copy' and 'pager.go' in the pkg/runtime/informer/pager"
exit 1
fi
2 changes: 1 addition & 1 deletion pkg/controller/dependentresource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"k8s.io/klog/v2"

policyv1alpha1 "github.com/clusterpedia-io/api/policy/v1alpha1"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer"
)

type DependentResourceManager struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_state_metrics/metrics_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"k8s.io/kube-state-metrics/v2/pkg/optin"
"k8s.io/kube-state-metrics/v2/pkg/options"

"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/storageconfig"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kubeapiserver/restmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"github.com/clusterpedia-io/clusterpedia/pkg/kubeapiserver/discovery"
"github.com/clusterpedia-io/clusterpedia/pkg/kubeapiserver/printers"
"github.com/clusterpedia-io/clusterpedia/pkg/kubeapiserver/resourcerest"
"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
unstructuredscheme "github.com/clusterpedia-io/clusterpedia/pkg/scheme/unstructured"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
unstructuredscheme "github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme/unstructured"
"github.com/clusterpedia-io/clusterpedia/pkg/storage"
"github.com/clusterpedia-io/clusterpedia/pkg/storageconfig"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
)

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

"github.com/clusterpedia-io/clusterpedia/pkg/discovery/controller"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/discovery/controller"
)

type DynamicDiscoveryInterface interface {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ -27,7 +27,7 @@ import (
"k8s.io/utils/clock"
"k8s.io/utils/trace"

clspager "github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer/pager"
clspager "github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer/pager"
)

const defaultExpectedTypeName = "<unspecified>"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/scheme/scheme.go → pkg/runtime/scheme/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/kubernetes/pkg/api/legacyscheme"

unstructuredscheme "github.com/clusterpedia-io/clusterpedia/pkg/scheme/unstructured"
unstructuredscheme "github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme/unstructured"
)

var (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/storage/internalstorage/collectionresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"

internal "github.com/clusterpedia-io/api/clusterpedia"
"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/memorystorage/watchcache/watch_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"k8s.io/utils/strings/slices"

internal "github.com/clusterpedia-io/api/clusterpedia"
"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
utilwatch "github.com/clusterpedia-io/clusterpedia/pkg/utils/watch"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/storageconfig/storageconfig_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
serverstorage "k8s.io/apiserver/pkg/server/storage"
apisstorage "k8s.io/kubernetes/pkg/apis/storage"

"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/storage"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/synchromanager/clustersynchro/cluster_synchro.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
metricsstore "k8s.io/kube-state-metrics/v2/pkg/metrics_store"

clusterv1alpha2 "github.com/clusterpedia-io/api/cluster/v1alpha2"
"github.com/clusterpedia-io/clusterpedia/pkg/discovery"
kubestatemetrics "github.com/clusterpedia-io/clusterpedia/pkg/kube_state_metrics"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/discovery"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/storage"
"github.com/clusterpedia-io/clusterpedia/pkg/storageconfig"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/features"
clusterpediafeature "github.com/clusterpedia-io/clusterpedia/pkg/utils/feature"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/synchromanager/clustersynchro/resource_negotiator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"k8s.io/klog/v2"

clusterv1alpha2 "github.com/clusterpedia-io/api/cluster/v1alpha2"
"github.com/clusterpedia-io/clusterpedia/pkg/discovery"
"github.com/clusterpedia-io/clusterpedia/pkg/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/discovery"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/scheme"
"github.com/clusterpedia-io/clusterpedia/pkg/storage"
"github.com/clusterpedia-io/clusterpedia/pkg/storageconfig"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/features"
Expand Down
2 changes: 1 addition & 1 deletion pkg/synchromanager/clustersynchro/resource_synchro.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

clusterv1alpha2 "github.com/clusterpedia-io/api/cluster/v1alpha2"
kubestatemetrics "github.com/clusterpedia-io/clusterpedia/pkg/kube_state_metrics"
"github.com/clusterpedia-io/clusterpedia/pkg/runtime/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/storage"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/informer"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/clustersynchro/queue"
"github.com/clusterpedia-io/clusterpedia/pkg/synchromanager/features"
"github.com/clusterpedia-io/clusterpedia/pkg/utils"
Expand Down

0 comments on commit 369cbab

Please sign in to comment.