diff --git a/go.mod b/go.mod index 81c3d31ff..1afdc4232 100644 --- a/go.mod +++ b/go.mod @@ -46,8 +46,8 @@ require ( kmodules.xyz/custom-resources v0.25.2 kmodules.xyz/go-containerregistry v0.0.11 kmodules.xyz/monitoring-agent-api v0.25.4 - kmodules.xyz/resource-metadata v0.17.28-0.20231023062704-59b3555434ce - kmodules.xyz/resource-metrics v0.25.6 + kmodules.xyz/resource-metadata v0.17.28 + kmodules.xyz/resource-metrics v0.25.7 kmodules.xyz/sets v0.25.0 kubeops.dev/scanner v0.0.15 kubepack.dev/lib-helm v0.7.3 diff --git a/go.sum b/go.sum index 4e8a9f31d..7a626c5e7 100644 --- a/go.sum +++ b/go.sum @@ -2151,10 +2151,10 @@ kmodules.xyz/monitoring-agent-api v0.25.4 h1:OwkvtV23QhUy3f7o9lxPWaAW3jiJMGAMPPR kmodules.xyz/monitoring-agent-api v0.25.4/go.mod h1:3LhrLDGQKQXhxYcjA/WNaO4HPpopYQzOutsEp2i3008= kmodules.xyz/offshoot-api v0.25.4 h1:IjJNvkphcdYUG8XO/pBwXpuP8W+jxAWJZ3yH8vgI/as= kmodules.xyz/offshoot-api v0.25.4/go.mod h1:PUk4EuJFhhyQykCflHj7EgXcljGIqs9vi0IN0RpxtY4= -kmodules.xyz/resource-metadata v0.17.28-0.20231023062704-59b3555434ce h1:04+H7IhbihQSxDSoRkD11Hv9tRBZPRJxBKjVZzspRsc= -kmodules.xyz/resource-metadata v0.17.28-0.20231023062704-59b3555434ce/go.mod h1:4m4L4/EJ3XasyrN5KFHRJDrWd27WNREeuc3alUKUJ9E= -kmodules.xyz/resource-metrics v0.25.6 h1:zYl49zZ0KBdNPgaLJX1GaL8/lpmyZOshSC5Sg1eXihc= -kmodules.xyz/resource-metrics v0.25.6/go.mod h1:y7pDmTWuVLNGSjwckKCwJFhCgi5fhbwS7PAcH2rmGcY= +kmodules.xyz/resource-metadata v0.17.28 h1:zNCRy8TxuXemsKRiRqOVaCPwRJpAsvNG2KhlMq+cJdU= +kmodules.xyz/resource-metadata v0.17.28/go.mod h1:qA/yeimciDU7szGPyRT3jHDPIvm7uJiVOzcB5tIJgxE= +kmodules.xyz/resource-metrics v0.25.7 h1:ne2cK/dlnfYcuu0+pHX15Y53rcKBQq9DuCtQVcx6rY8= +kmodules.xyz/resource-metrics v0.25.7/go.mod h1:y7pDmTWuVLNGSjwckKCwJFhCgi5fhbwS7PAcH2rmGcY= kmodules.xyz/sets v0.25.0 h1:belY/3trp/M/CKc1TEteA40jb2uCIdwKHhjpvrIxG+8= kmodules.xyz/sets v0.25.0/go.mod h1:ICWmplgCsxniWkImSBGlJrLT9npqOXKhX/Bwbc7bmEw= kubeops.dev/scanner v0.0.15 h1:u9hM2096LEa+BPlI/p7tcqvOv7A9fAFEw8AOEGHP5GY= diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/cluster.open-cluster-management.io/v1beta2/managedclustersetbindings.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/cluster.open-cluster-management.io/v1beta2/managedclustersetbindings.yaml index eb7ece8e0..70b582ba3 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/cluster.open-cluster-management.io/v1beta2/managedclustersetbindings.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/cluster.open-cluster-management.io/v1beta2/managedclustersetbindings.yaml @@ -16,7 +16,7 @@ spec: kind: Connection name: ManagedClusterSets query: - byLabel: offshoot + byLabel: ocm_bind type: GraphQL ref: group: cluster.open-cluster-management.io diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml index e5c4899c2..a8c62eedb 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourceblockdefinitions/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml @@ -21,6 +21,17 @@ spec: ref: group: work.open-cluster-management.io kind: ManifestWork + - actions: + create: Never + displayMode: List + kind: Connection + name: Placements + query: + byLabel: placed_into + type: GraphQL + ref: + group: cluster.open-cluster-management.io + kind: Placement resource: group: work.open-cluster-management.io kind: ManifestWorkReplicaSet diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml index 5085f75ec..5c2d675ce 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/work.open-cluster-management.io/v1alpha1/manifestworkreplicasets.yaml @@ -19,6 +19,14 @@ spec: apiVersion: work.open-cluster-management.io/v1 kind: ManifestWork type: MatchSelector + - labels: + - placed_into + references: + - '{range .spec.placementRefs[*]}{.name}{"\n"}{end}' + target: + apiVersion: cluster.open-cluster-management.io/v1beta1 + kind: Placement + type: MatchRef resource: group: work.open-cluster-management.io kind: ManifestWorkReplicaSet diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/calculator.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/calculator.go index 894e36981..253cd9e86 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/calculator.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/calculator.go @@ -22,10 +22,6 @@ import ( core "k8s.io/api/core/v1" ) -func init() { - RegisterPathMapperPluginMembersWithApiPlugin(OpsResourceCalculator{}.ResourceCalculator()) -} - type OpsResourceCalculator struct{} func (r OpsResourceCalculator) ResourceCalculator() api.ResourceCalculator { diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/elasticsearch_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/elasticsearch_mapping.go index 3406b0c52..43b7705bb 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/elasticsearch_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/elasticsearch_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&ElasticsearchOpsRequest{}) + RegisterOpsPathMapperToPlugins(&ElasticsearchOpsRequest{}) } type ElasticsearchOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/kafka_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/kafka_mapping.go index ab6e673e3..3ee45b21e 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/kafka_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/kafka_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&kafkaOpsRequest{}) + RegisterOpsPathMapperToPlugins(&kafkaOpsRequest{}) } type kafkaOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mapper.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mapper.go index 511e9af00..0a369428b 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mapper.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mapper.go @@ -42,15 +42,19 @@ type ( var ( PathMapperPlugin = map[schema.GroupVersionKind]OpsPathMapper{} + OpsCalculator = OpsResourceCalculator{}.ResourceCalculator() lock sync.RWMutex ) func RegisterToPathMapperPlugin(opsObj OpsPathMapper) { - lock.Lock() - defer lock.Unlock() PathMapperPlugin[opsObj.GroupVersionKind()] = opsObj } +func RegisterOpsPathMapperToPlugins(opsObj OpsPathMapper) { + RegisterToPathMapperPlugin(opsObj) + api.Register(opsObj.GroupVersionKind(), OpsCalculator) +} + func LoadOpsPathMapper(opsObj OpsReqObject) (OpsPathMapper, error) { gvk := getGVK(opsObj) @@ -63,11 +67,3 @@ func LoadOpsPathMapper(opsObj OpsReqObject) (OpsPathMapper, error) { return opsMapperObj, nil } - -func RegisterPathMapperPluginMembersWithApiPlugin(rc api.ResourceCalculator) { - lock.RLock() - defer lock.RUnlock() - for gvk := range PathMapperPlugin { - api.Register(gvk, rc) - } -} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mariadb_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mariadb_mapping.go index 6a0df948e..30812bc85 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mariadb_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mariadb_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&MariaDBOpsRequest{}) + RegisterOpsPathMapperToPlugins(&MariaDBOpsRequest{}) } type MariaDBOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/memcached_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/memcached_mapping.go index 5ce87d5b1..e536d0fda 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/memcached_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/memcached_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&MemcachedOpsRequest{}) + RegisterOpsPathMapperToPlugins(&MemcachedOpsRequest{}) } type MemcachedOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mongodb_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mongodb_mapping.go index 8ce76c485..b078d8d74 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mongodb_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mongodb_mapping.go @@ -21,7 +21,7 @@ import ( ) func init() { - RegisterToPathMapperPlugin(&MongoDBOpsRequest{}) + RegisterOpsPathMapperToPlugins(&MongoDBOpsRequest{}) } type MongoDBOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mysql_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mysql_mapping.go index 79e49b731..dee99e73c 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mysql_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/mysql_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&MySqlOpsRequest{}) + RegisterOpsPathMapperToPlugins(&MySqlOpsRequest{}) } type MySqlOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/pgbouncer_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/pgbouncer_mapping.go index 1e2554864..8e10ac9b5 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/pgbouncer_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/pgbouncer_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&PgBouncerOpsRequest{}) + RegisterOpsPathMapperToPlugins(&PgBouncerOpsRequest{}) } type PgBouncerOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/postgres_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/postgres_mapping.go index 4078a8123..08755662e 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/postgres_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/postgres_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&PostgresOpsRequest{}) + RegisterOpsPathMapperToPlugins(&PostgresOpsRequest{}) } type PostgresOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/proxysql_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/proxysql_mapping.go index 70e25a770..eef128402 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/proxysql_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/proxysql_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&ProxySQLOpsRequest{}) + RegisterOpsPathMapperToPlugins(&ProxySQLOpsRequest{}) } type ProxySQLOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redis_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redis_mapping.go index 483f40937..1323442e1 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redis_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redis_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&RedisOpsRequest{}) + RegisterOpsPathMapperToPlugins(&RedisOpsRequest{}) } type RedisOpsRequest struct{} diff --git a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redissentinel_mapping.go b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redissentinel_mapping.go index 4f07376e6..36a1da85f 100644 --- a/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redissentinel_mapping.go +++ b/vendor/kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1/redissentinel_mapping.go @@ -19,7 +19,7 @@ package v1alpha1 import "k8s.io/apimachinery/pkg/runtime/schema" func init() { - RegisterToPathMapperPlugin(&RedisSentinelOpsRequest{}) + RegisterOpsPathMapperToPlugins(&RedisSentinelOpsRequest{}) } type RedisSentinelOpsRequest struct{} diff --git a/vendor/modules.txt b/vendor/modules.txt index ef2989827..863dcc16d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1839,7 +1839,7 @@ kmodules.xyz/monitoring-agent-api/client # kmodules.xyz/offshoot-api v0.25.4 ## explicit; go 1.18 kmodules.xyz/offshoot-api/api/v1 -# kmodules.xyz/resource-metadata v0.17.28-0.20231023062704-59b3555434ce +# kmodules.xyz/resource-metadata v0.17.28 ## explicit; go 1.18 kmodules.xyz/resource-metadata/apis/core/install kmodules.xyz/resource-metadata/apis/core/v1alpha1 @@ -1866,7 +1866,7 @@ kmodules.xyz/resource-metadata/pkg/layouts kmodules.xyz/resource-metadata/pkg/tableconvertor kmodules.xyz/resource-metadata/pkg/tableconvertor/lib kmodules.xyz/resource-metadata/pkg/tableconvertor/printers -# kmodules.xyz/resource-metrics v0.25.6 +# kmodules.xyz/resource-metrics v0.25.7 ## explicit; go 1.18 kmodules.xyz/resource-metrics kmodules.xyz/resource-metrics/api