From 0dc6858e5ba4b110eac9ca74294eb3a29790a323 Mon Sep 17 00:00:00 2001 From: Dmitriy Matrenichev Date: Wed, 15 Feb 2023 17:14:33 +0300 Subject: [PATCH] chore: bump cosi-project/runtime And update all `ResourceDefinition` docs and type names. Drop unused functions and names. Signed-off-by: Dmitriy Matrenichev --- go.mod | 2 +- go.sum | 4 ++-- pkg/machinery/go.mod | 2 +- pkg/machinery/go.sum | 4 ++-- pkg/machinery/resources/cluster/affiliate.go | 12 +++++------ pkg/machinery/resources/cluster/config.go | 12 +++++------ pkg/machinery/resources/cluster/identity.go | 12 +++++------ pkg/machinery/resources/cluster/member.go | 12 +++++------ .../resources/cri/seccomp_profile.go | 10 ++++----- pkg/machinery/resources/etcd/config.go | 12 +++++------ pkg/machinery/resources/etcd/member.go | 12 +++++------ pkg/machinery/resources/etcd/pki_status.go | 12 +++++------ pkg/machinery/resources/etcd/spec.go | 12 +++++------ pkg/machinery/resources/files/etcfile_spec.go | 10 ++++----- .../resources/files/etcfile_status.go | 2 +- .../resources/hardware/memorymodule.go | 12 +++++------ pkg/machinery/resources/hardware/processor.go | 12 +++++------ .../resources/hardware/system_information.go | 12 +++++------ .../resources/k8s/admissioncontrol_config.go | 10 ++++----- .../resources/k8s/apiserver_config.go | 10 ++++----- .../resources/k8s/auditpolicy_config.go | 10 ++++----- pkg/machinery/resources/k8s/config_status.go | 12 +++++------ .../resources/k8s/controllermanager_config.go | 10 ++++----- pkg/machinery/resources/k8s/endpoint.go | 12 +++++------ .../resources/k8s/extramanifests_config.go | 10 ++++----- pkg/machinery/resources/k8s/kubelet_config.go | 12 +++++------ .../resources/k8s/kubelet_lifecycle.go | 12 +++++------ pkg/machinery/resources/k8s/kubelet_spec.go | 12 +++++------ pkg/machinery/resources/k8s/manifest.go | 12 +++++------ .../resources/k8s/manifest_status.go | 12 +++++------ .../resources/k8s/manifests_config.go | 10 ++++----- .../resources/k8s/node_label_spec.go | 21 +++++-------------- pkg/machinery/resources/k8s/nodeip.go | 12 +++++------ pkg/machinery/resources/k8s/nodeip_config.go | 12 +++++------ pkg/machinery/resources/k8s/nodename.go | 12 +++++------ .../resources/k8s/scheduler_config.go | 10 ++++----- pkg/machinery/resources/k8s/secrets_status.go | 12 +++++------ pkg/machinery/resources/k8s/static_pod.go | 12 +++++------ .../resources/k8s/static_pod_server_status.go | 12 +++++------ .../resources/k8s/static_pod_status.go | 12 +++++------ pkg/machinery/resources/kubeaccess/config.go | 12 +++++------ pkg/machinery/resources/kubespan/config.go | 12 +++++------ pkg/machinery/resources/kubespan/endpoint.go | 12 +++++------ pkg/machinery/resources/kubespan/identity.go | 12 +++++------ pkg/machinery/resources/kubespan/peer_spec.go | 12 +++++------ .../resources/kubespan/peer_status.go | 12 +++++------ .../resources/network/address_spec.go | 12 +++++------ .../resources/network/address_status.go | 12 +++++------ .../resources/network/device_config_spec.go | 12 +++++------ .../resources/network/hardrware_addr.go | 12 +++++------ .../resources/network/hostname_spec.go | 12 +++++------ .../resources/network/hostname_status.go | 12 +++++------ .../resources/network/link_refresh.go | 12 +++++------ pkg/machinery/resources/network/link_spec.go | 12 +++++------ .../resources/network/link_status.go | 12 +++++------ .../resources/network/node_address.go | 12 +++++------ .../resources/network/node_address_filter.go | 12 +++++------ .../resources/network/operator_spec.go | 12 +++++------ .../resources/network/resolver_spec.go | 12 +++++------ .../resources/network/resolver_status.go | 12 +++++------ pkg/machinery/resources/network/route_spec.go | 12 +++++------ .../resources/network/route_status.go | 12 +++++------ pkg/machinery/resources/network/status.go | 12 +++++------ .../resources/network/timeserver_spec.go | 12 +++++------ .../resources/network/timeserver_status.go | 12 +++++------ pkg/machinery/resources/perf/cpu.go | 10 ++++----- pkg/machinery/resources/perf/mem.go | 10 ++++----- .../resources/runtime/extension_status.go | 10 ++++----- .../resources/runtime/kernel_module_spec.go | 10 ++++----- .../resources/runtime/kernel_params_spec.go | 20 +++++++++--------- .../resources/runtime/kernel_params_status.go | 10 ++++----- .../resources/runtime/machine_status.go | 10 ++++----- .../resources/runtime/mount_status.go | 10 ++++----- .../resources/runtime/platform_metadata.go | 14 ++++++------- pkg/machinery/resources/secrets/api.go | 10 ++++----- pkg/machinery/resources/secrets/cert_sans.go | 10 ++++----- pkg/machinery/resources/secrets/etcd.go | 10 ++++----- pkg/machinery/resources/secrets/etcd_root.go | 10 ++++----- pkg/machinery/resources/secrets/kubelet.go | 10 ++++----- pkg/machinery/resources/secrets/kubernetes.go | 10 ++++----- .../resources/secrets/kubernetes_root.go | 10 ++++----- pkg/machinery/resources/secrets/os_root.go | 10 ++++----- pkg/machinery/resources/secrets/trustd.go | 10 ++++----- pkg/machinery/resources/time/status.go | 10 ++++----- pkg/machinery/resources/v1alpha1/service.go | 10 ++++----- 85 files changed, 464 insertions(+), 475 deletions(-) diff --git a/go.mod b/go.mod index 55897b55e2..abeaea84bf 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/containernetworking/plugins v1.2.0 github.com/coreos/go-iptables v0.6.0 github.com/coreos/go-semver v0.3.1 - github.com/cosi-project/runtime v0.3.0-alpha.5 + github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4 github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v23.0.1+incompatible github.com/docker/go-connections v0.4.0 diff --git a/go.sum b/go.sum index 57873808ae..b96446a3ec 100644 --- a/go.sum +++ b/go.sum @@ -455,8 +455,8 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosi-project/runtime v0.3.0-alpha.5 h1:Auu00ImAwcoMFfeQibpNjpR7RsVV6lVxlfYw/cq0HpM= -github.com/cosi-project/runtime v0.3.0-alpha.5/go.mod h1:pKny4SfaG5BBJ1x4aIWc5OyN90oXMhcbrNdC3wgdoYg= +github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4 h1:hrwax0fYagtHoQTZSalAoKxhYp10h4+y9muH2BxJy/8= +github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4/go.mod h1:pKny4SfaG5BBJ1x4aIWc5OyN90oXMhcbrNdC3wgdoYg= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= diff --git a/pkg/machinery/go.mod b/pkg/machinery/go.mod index 218b2cf389..c90bae8a18 100644 --- a/pkg/machinery/go.mod +++ b/pkg/machinery/go.mod @@ -8,7 +8,7 @@ replace gopkg.in/yaml.v3 => github.com/unix4ever/yaml v0.0.0-20220527175918-f17b require ( github.com/containerd/go-cni v1.1.8 - github.com/cosi-project/runtime v0.3.0-alpha.5 + github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4 github.com/dustin/go-humanize v1.0.1 github.com/evanphx/json-patch v5.6.0+incompatible github.com/ghodss/yaml v1.0.0 diff --git a/pkg/machinery/go.sum b/pkg/machinery/go.sum index 0c7484e4b5..ed646b3ff3 100644 --- a/pkg/machinery/go.sum +++ b/pkg/machinery/go.sum @@ -20,8 +20,8 @@ github.com/containerd/go-cni v1.1.8 h1:/tPhnTpTmu/LPywPEMVqn2nJCZ7VEsuMFwcFLPdF4 github.com/containerd/go-cni v1.1.8/go.mod h1:fTJBazSSt2KF+XqfQArQICbF/cuHa1w1BYrHKPNkzZU= github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ= github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= -github.com/cosi-project/runtime v0.3.0-alpha.5 h1:Auu00ImAwcoMFfeQibpNjpR7RsVV6lVxlfYw/cq0HpM= -github.com/cosi-project/runtime v0.3.0-alpha.5/go.mod h1:pKny4SfaG5BBJ1x4aIWc5OyN90oXMhcbrNdC3wgdoYg= +github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4 h1:hrwax0fYagtHoQTZSalAoKxhYp10h4+y9muH2BxJy/8= +github.com/cosi-project/runtime v0.3.0-alpha.5.0.20230214191708-e6466f3cfde4/go.mod h1:pKny4SfaG5BBJ1x4aIWc5OyN90oXMhcbrNdC3wgdoYg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/pkg/machinery/resources/cluster/affiliate.go b/pkg/machinery/resources/cluster/affiliate.go index 28a8e840d0..8ca45dfc27 100644 --- a/pkg/machinery/resources/cluster/affiliate.go +++ b/pkg/machinery/resources/cluster/affiliate.go @@ -25,7 +25,7 @@ const AffiliateType = resource.Type("Affiliates.cluster.talos.dev") // Affiliate resource holds information about cluster affiliate: it is discovered potential cluster member and/or KubeSpan peer. // // Controller builds local Affiliate structure for the node itself, other Affiliates are pulled from the registry during the discovery process. -type Affiliate = typed.Resource[AffiliateSpec, AffiliateRD] +type Affiliate = typed.Resource[AffiliateSpec, AffiliateExtension] // KubeSpanAffiliateSpec describes additional information specific for the KubeSpan. // @@ -39,17 +39,17 @@ type KubeSpanAffiliateSpec struct { // NewAffiliate initializes the Affiliate resource. func NewAffiliate(namespace resource.Namespace, id resource.ID) *Affiliate { - return typed.NewResource[AffiliateSpec, AffiliateRD]( + return typed.NewResource[AffiliateSpec, AffiliateExtension]( resource.NewMetadata(namespace, AffiliateType, id, resource.VersionUndefined), AffiliateSpec{}, ) } -// AffiliateRD provides auxiliary methods for Affiliate. -type AffiliateRD struct{} +// AffiliateExtension provides auxiliary methods for Affiliate. +type AffiliateExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (r AffiliateRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (r AffiliateExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: AffiliateType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/cluster/config.go b/pkg/machinery/resources/cluster/config.go index b4a2d81f47..9aceff236c 100644 --- a/pkg/machinery/resources/cluster/config.go +++ b/pkg/machinery/resources/cluster/config.go @@ -21,7 +21,7 @@ const ConfigType = resource.Type("DiscoveryConfigs.cluster.talos.dev") const ConfigID = resource.ID("cluster") // Config resource holds KubeSpan configuration. -type Config = typed.Resource[ConfigSpec, ConfigRD] +type Config = typed.Resource[ConfigSpec, ConfigExtension] // ConfigSpec describes KubeSpan configuration. // @@ -38,17 +38,17 @@ type ConfigSpec struct { // NewConfig initializes a Config resource. func NewConfig(namespace resource.Namespace, id resource.ID) *Config { - return typed.NewResource[ConfigSpec, ConfigRD]( + return typed.NewResource[ConfigSpec, ConfigExtension]( resource.NewMetadata(namespace, ConfigType, id, resource.VersionUndefined), ConfigSpec{}, ) } -// ConfigRD provides auxiliary methods for Config. -type ConfigRD struct{} +// ConfigExtension provides auxiliary methods for Config. +type ConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c ConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/cluster/identity.go b/pkg/machinery/resources/cluster/identity.go index 732210a767..168fd84e06 100644 --- a/pkg/machinery/resources/cluster/identity.go +++ b/pkg/machinery/resources/cluster/identity.go @@ -20,7 +20,7 @@ const IdentityType = resource.Type("Identities.cluster.talos.dev") const LocalIdentity = resource.ID("local") // Identity resource holds node identity (as a member of the cluster). -type Identity = typed.Resource[IdentitySpec, IdentityRD] +type Identity = typed.Resource[IdentitySpec, IdentityExtension] // IdentitySpec describes status of rendered secrets. // @@ -36,17 +36,17 @@ type IdentitySpec struct { // NewIdentity initializes a Identity resource. func NewIdentity(namespace resource.Namespace, id resource.ID) *Identity { - return typed.NewResource[IdentitySpec, IdentityRD]( + return typed.NewResource[IdentitySpec, IdentityExtension]( resource.NewMetadata(namespace, IdentityType, id, resource.VersionUndefined), IdentitySpec{}, ) } -// IdentityRD provides auxiliary methods for Identity. -type IdentityRD struct{} +// IdentityExtension provides auxiliary methods for Identity. +type IdentityExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c IdentityRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (IdentityExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: IdentityType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/cluster/member.go b/pkg/machinery/resources/cluster/member.go index 946c31e8a7..a9a7017f3e 100644 --- a/pkg/machinery/resources/cluster/member.go +++ b/pkg/machinery/resources/cluster/member.go @@ -22,7 +22,7 @@ const MemberType = resource.Type("Members.cluster.talos.dev") // Member resource contains information about discovered cluster members. // // Members are usually derived from Affiliates. -type Member = typed.Resource[MemberSpec, MemberRD] +type Member = typed.Resource[MemberSpec, MemberExtension] // MemberSpec describes Member state. // @@ -37,17 +37,17 @@ type MemberSpec struct { // NewMember initializes a Member resource. func NewMember(namespace resource.Namespace, id resource.ID) *Member { - return typed.NewResource[MemberSpec, MemberRD]( + return typed.NewResource[MemberSpec, MemberExtension]( resource.NewMetadata(namespace, MemberType, id, resource.VersionUndefined), MemberSpec{}, ) } -// MemberRD provides auxiliary methods for Member. -type MemberRD struct{} +// MemberExtension provides auxiliary methods for Member. +type MemberExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (MemberRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (MemberExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MemberType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/cri/seccomp_profile.go b/pkg/machinery/resources/cri/seccomp_profile.go index a6ab6da5c9..9870d370e6 100644 --- a/pkg/machinery/resources/cri/seccomp_profile.go +++ b/pkg/machinery/resources/cri/seccomp_profile.go @@ -20,7 +20,7 @@ import ( const SeccompProfileType = resource.Type("SeccompProfiles.cri.talos.dev") // SeccompProfile represents SeccompProfile typed resource. -type SeccompProfile = typed.Resource[SeccompProfileSpec, SeccompProfileRD] +type SeccompProfile = typed.Resource[SeccompProfileSpec, SeccompProfileExtension] // SeccompProfileSpec represents the SeccompProfile. // @@ -32,17 +32,17 @@ type SeccompProfileSpec struct { // NewSeccompProfile creates new SeccompProfile object. func NewSeccompProfile(id string) *SeccompProfile { - return typed.NewResource[SeccompProfileSpec, SeccompProfileRD]( + return typed.NewResource[SeccompProfileSpec, SeccompProfileExtension]( resource.NewMetadata(NamespaceName, SeccompProfileType, id, resource.VersionUndefined), SeccompProfileSpec{}, ) } -// SeccompProfileRD is an auxiliary type for SeccompProfile resource. -type SeccompProfileRD struct{} +// SeccompProfileExtension is an auxiliary type for SeccompProfile resource. +type SeccompProfileExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (SeccompProfileRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (SeccompProfileExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: SeccompProfileType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/etcd/config.go b/pkg/machinery/resources/etcd/config.go index 8c382fd41c..45cbe2d1b1 100644 --- a/pkg/machinery/resources/etcd/config.go +++ b/pkg/machinery/resources/etcd/config.go @@ -20,7 +20,7 @@ const ConfigType = resource.Type("EtcdConfigs.etcd.talos.dev") const ConfigID = resource.ID("etcd") // Config resource holds status of rendered secrets. -type Config = typed.Resource[ConfigSpec, ConfigRD] +type Config = typed.Resource[ConfigSpec, ConfigExtension] // ConfigSpec describes (some) configuration settings of etcd. // @@ -38,17 +38,17 @@ type ConfigSpec struct { // NewConfig initializes a Config resource. func NewConfig(namespace resource.Namespace, id resource.ID) *Config { - return typed.NewResource[ConfigSpec, ConfigRD]( + return typed.NewResource[ConfigSpec, ConfigExtension]( resource.NewMetadata(namespace, ConfigType, id, resource.VersionUndefined), ConfigSpec{}, ) } -// ConfigRD provides auxiliary methods for Config. -type ConfigRD struct{} +// ConfigExtension provides auxiliary methods for Config. +type ConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/etcd/member.go b/pkg/machinery/resources/etcd/member.go index c7db288dab..84d1f639e8 100644 --- a/pkg/machinery/resources/etcd/member.go +++ b/pkg/machinery/resources/etcd/member.go @@ -20,7 +20,7 @@ const MemberType = resource.Type("EtcdMembers.etcd.talos.dev") const LocalMemberID = resource.ID("local") // Member resource holds status of rendered secrets. -type Member = typed.Resource[MemberSpec, MemberRD] +type Member = typed.Resource[MemberSpec, MemberExtension] // MemberSpec holds information about an etcd member. // @@ -31,17 +31,17 @@ type MemberSpec struct { // NewMember initializes a Member resource. func NewMember(namespace resource.Namespace, id resource.ID) *Member { - return typed.NewResource[MemberSpec, MemberRD]( + return typed.NewResource[MemberSpec, MemberExtension]( resource.NewMetadata(namespace, MemberType, id, resource.VersionUndefined), MemberSpec{}, ) } -// MemberRD provides auxiliary methods for Member. -type MemberRD struct{} +// MemberExtension provides auxiliary methods for Member. +type MemberExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (MemberRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (MemberExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MemberType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/etcd/pki_status.go b/pkg/machinery/resources/etcd/pki_status.go index 92d1252473..bf07683fab 100644 --- a/pkg/machinery/resources/etcd/pki_status.go +++ b/pkg/machinery/resources/etcd/pki_status.go @@ -20,7 +20,7 @@ const PKIStatusType = resource.Type("PKIStatuses.etcd.talos.dev") const PKIID = resource.ID("etcd") // PKIStatus resource holds status of rendered secrets. -type PKIStatus = typed.Resource[PKIStatusSpec, PKIStatusRD] +type PKIStatus = typed.Resource[PKIStatusSpec, PKIStatusExtension] // PKIStatusSpec describes status of rendered secrets. // @@ -32,17 +32,17 @@ type PKIStatusSpec struct { // NewPKIStatus initializes a PKIStatus resource. func NewPKIStatus(namespace resource.Namespace, id resource.ID) *PKIStatus { - return typed.NewResource[PKIStatusSpec, PKIStatusRD]( + return typed.NewResource[PKIStatusSpec, PKIStatusExtension]( resource.NewMetadata(namespace, PKIStatusType, id, resource.VersionUndefined), PKIStatusSpec{}, ) } -// PKIStatusRD provides auxiliary methods for PKIStatus. -type PKIStatusRD struct{} +// PKIStatusExtension provides auxiliary methods for PKIStatus. +type PKIStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (PKIStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (PKIStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: PKIStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/etcd/spec.go b/pkg/machinery/resources/etcd/spec.go index bb7e2b8e55..41e7e60ba5 100644 --- a/pkg/machinery/resources/etcd/spec.go +++ b/pkg/machinery/resources/etcd/spec.go @@ -22,7 +22,7 @@ const SpecType = resource.Type("EtcdSpecs.etcd.talos.dev") const SpecID = resource.ID("etcd") // Spec resource holds status of rendered secrets. -type Spec = typed.Resource[SpecSpec, SpecRD] +type Spec = typed.Resource[SpecSpec, SpecExtension] // SpecSpec describes (some) Specuration settings of etcd. // @@ -38,17 +38,17 @@ type SpecSpec struct { // NewSpec initializes a Spec resource. func NewSpec(namespace resource.Namespace, id resource.ID) *Spec { - return typed.NewResource[SpecSpec, SpecRD]( + return typed.NewResource[SpecSpec, SpecExtension]( resource.NewMetadata(namespace, SpecType, id, resource.VersionUndefined), SpecSpec{}, ) } -// SpecRD provides auxiliary methods for Spec. -type SpecRD struct{} +// SpecExtension provides auxiliary methods for Spec. +type SpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (SpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (SpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: SpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/files/etcfile_spec.go b/pkg/machinery/resources/files/etcfile_spec.go index f4c0537dff..c0178a858a 100644 --- a/pkg/machinery/resources/files/etcfile_spec.go +++ b/pkg/machinery/resources/files/etcfile_spec.go @@ -21,7 +21,7 @@ import ( const EtcFileSpecType = resource.Type("EtcFileSpecs.files.talos.dev") // EtcFileSpec resource holds contents of the file which should be put to `/etc` directory. -type EtcFileSpec = typed.Resource[EtcFileSpecSpec, EtcFileSpecMD] +type EtcFileSpec = typed.Resource[EtcFileSpecSpec, EtcFileSpecExtension] // EtcFileSpecSpec describes status of rendered secrets. // @@ -33,17 +33,17 @@ type EtcFileSpecSpec struct { // NewEtcFileSpec initializes a EtcFileSpec resource. func NewEtcFileSpec(namespace resource.Namespace, id resource.ID) *EtcFileSpec { - return typed.NewResource[EtcFileSpecSpec, EtcFileSpecMD]( + return typed.NewResource[EtcFileSpecSpec, EtcFileSpecExtension]( resource.NewMetadata(namespace, EtcFileSpecType, id, resource.VersionUndefined), EtcFileSpecSpec{}, ) } -// EtcFileSpecMD provides auxiliary methods for EtcFileSpec. -type EtcFileSpecMD struct{} +// EtcFileSpecExtension provides auxiliary methods for EtcFileSpec. +type EtcFileSpecExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (EtcFileSpecMD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (EtcFileSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EtcFileSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/files/etcfile_status.go b/pkg/machinery/resources/files/etcfile_status.go index 0c5d63378b..71ac78d0be 100644 --- a/pkg/machinery/resources/files/etcfile_status.go +++ b/pkg/machinery/resources/files/etcfile_status.go @@ -37,7 +37,7 @@ func NewEtcFileStatus(namespace resource.Namespace, id resource.ID) *EtcFileStat // EtcFileStatusMD provides auxiliary methods for EtcFileStatus. type EtcFileStatusMD struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. +// ResourceDefinition implements [typed.Extension] interface. func (EtcFileStatusMD) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EtcFileStatusType, diff --git a/pkg/machinery/resources/hardware/memorymodule.go b/pkg/machinery/resources/hardware/memorymodule.go index 91e1177eb5..2f36b1a7a6 100644 --- a/pkg/machinery/resources/hardware/memorymodule.go +++ b/pkg/machinery/resources/hardware/memorymodule.go @@ -17,7 +17,7 @@ import ( const MemoryModuleType = resource.Type("MemoryModules.hardware.talos.dev") // MemoryModule resource holds node MemoryModule information. -type MemoryModule = typed.Resource[MemoryModuleSpec, MemoryModuleRD] +type MemoryModule = typed.Resource[MemoryModuleSpec, MemoryModuleExtension] // MemoryModuleSpec represents a single Memory. // @@ -35,17 +35,17 @@ type MemoryModuleSpec struct { // NewMemoryModuleInfo initializes a MemoryModuleInfo resource. func NewMemoryModuleInfo(id string) *MemoryModule { - return typed.NewResource[MemoryModuleSpec, MemoryModuleRD]( + return typed.NewResource[MemoryModuleSpec, MemoryModuleExtension]( resource.NewMetadata(NamespaceName, MemoryModuleType, id, resource.VersionUndefined), MemoryModuleSpec{}, ) } -// MemoryModuleRD provides auxiliary methods for Memory info. -type MemoryModuleRD struct{} +// MemoryModuleExtension provides auxiliary methods for Memory info. +type MemoryModuleExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c MemoryModuleRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (MemoryModuleExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MemoryModuleType, Aliases: []resource.Type{ diff --git a/pkg/machinery/resources/hardware/processor.go b/pkg/machinery/resources/hardware/processor.go index 0939c7de8d..4d40fec9b0 100644 --- a/pkg/machinery/resources/hardware/processor.go +++ b/pkg/machinery/resources/hardware/processor.go @@ -17,7 +17,7 @@ import ( const ProcessorType = resource.Type("Processors.hardware.talos.dev") // Processor resource holds node Processor information. -type Processor = typed.Resource[ProcessorSpec, ProcessorRD] +type Processor = typed.Resource[ProcessorSpec, ProcessorExtension] // ProcessorSpec represents a single processor. // @@ -41,17 +41,17 @@ type ProcessorSpec struct { // NewProcessorInfo initializes a ProcessorInfo resource. func NewProcessorInfo(id string) *Processor { - return typed.NewResource[ProcessorSpec, ProcessorRD]( + return typed.NewResource[ProcessorSpec, ProcessorExtension]( resource.NewMetadata(NamespaceName, ProcessorType, id, resource.VersionUndefined), ProcessorSpec{}, ) } -// ProcessorRD provides auxiliary methods for Processor info. -type ProcessorRD struct{} +// ProcessorExtension provides auxiliary methods for Processor info. +type ProcessorExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c ProcessorRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ProcessorExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ProcessorType, Aliases: []resource.Type{ diff --git a/pkg/machinery/resources/hardware/system_information.go b/pkg/machinery/resources/hardware/system_information.go index bbf8a71a6b..3cc3cef456 100644 --- a/pkg/machinery/resources/hardware/system_information.go +++ b/pkg/machinery/resources/hardware/system_information.go @@ -17,7 +17,7 @@ import ( const SystemInformationType = resource.Type("SystemInformations.hardware.talos.dev") // SystemInformation resource holds node SystemInformation information. -type SystemInformation = typed.Resource[SystemInformationSpec, SystemInformationRD] +type SystemInformation = typed.Resource[SystemInformationSpec, SystemInformationExtension] // SystemInformationSpec represents the system information obtained from smbios. // @@ -34,17 +34,17 @@ type SystemInformationSpec struct { // NewSystemInformation initializes a SystemInformationInfo resource. func NewSystemInformation(id string) *SystemInformation { - return typed.NewResource[SystemInformationSpec, SystemInformationRD]( + return typed.NewResource[SystemInformationSpec, SystemInformationExtension]( resource.NewMetadata(NamespaceName, SystemInformationType, id, resource.VersionUndefined), SystemInformationSpec{}, ) } -// SystemInformationRD provides auxiliary methods for SystemInformation. -type SystemInformationRD struct{} +// SystemInformationExtension provides auxiliary methods for SystemInformation. +type SystemInformationExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c SystemInformationRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (SystemInformationExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: SystemInformationType, Aliases: []resource.Type{ diff --git a/pkg/machinery/resources/k8s/admissioncontrol_config.go b/pkg/machinery/resources/k8s/admissioncontrol_config.go index 9bca6abcf8..08e7f01265 100644 --- a/pkg/machinery/resources/k8s/admissioncontrol_config.go +++ b/pkg/machinery/resources/k8s/admissioncontrol_config.go @@ -23,7 +23,7 @@ const AdmissionControlConfigType = resource.Type("AdmissionControlConfigs.kubern const AdmissionControlConfigID = resource.ID("admission-control") // AdmissionControlConfig represents configuration for kube-apiserver Admission Control plugins. -type AdmissionControlConfig = typed.Resource[AdmissionControlConfigSpec, AdmissionControlConfigRD] +type AdmissionControlConfig = typed.Resource[AdmissionControlConfigSpec, AdmissionControlConfigExtension] // AdmissionControlConfigSpec is configuration for kube-apiserver. // @@ -42,16 +42,16 @@ type AdmissionPluginSpec struct { // NewAdmissionControlConfig returns new AdmissionControlConfig resource. func NewAdmissionControlConfig() *AdmissionControlConfig { - return typed.NewResource[AdmissionControlConfigSpec, AdmissionControlConfigRD]( + return typed.NewResource[AdmissionControlConfigSpec, AdmissionControlConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, AdmissionControlConfigType, AdmissionControlConfigID, resource.VersionUndefined), AdmissionControlConfigSpec{}) } -// AdmissionControlConfigRD defines AdmissionControlConfig resource definition. -type AdmissionControlConfigRD struct{} +// AdmissionControlConfigExtension defines AdmissionControlConfig resource definition. +type AdmissionControlConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (AdmissionControlConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (AdmissionControlConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: AdmissionControlConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/apiserver_config.go b/pkg/machinery/resources/k8s/apiserver_config.go index 2567e1ea6d..0d273e3dbc 100644 --- a/pkg/machinery/resources/k8s/apiserver_config.go +++ b/pkg/machinery/resources/k8s/apiserver_config.go @@ -23,7 +23,7 @@ const APIServerConfigType = resource.Type("APIServerConfigs.kubernetes.talos.dev const APIServerConfigID = resource.ID(APIServerID) // APIServerConfig represents configuration for kube-apiserver. -type APIServerConfig = typed.Resource[APIServerConfigSpec, APIServerConfigRD] +type APIServerConfig = typed.Resource[APIServerConfigSpec, APIServerConfigExtension] // ExtraVolume is a configuration of extra volume. // @@ -54,16 +54,16 @@ type APIServerConfigSpec struct { // NewAPIServerConfig returns new APIServerConfig resource. func NewAPIServerConfig() *APIServerConfig { - return typed.NewResource[APIServerConfigSpec, APIServerConfigRD]( + return typed.NewResource[APIServerConfigSpec, APIServerConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, APIServerConfigType, APIServerConfigID, resource.VersionUndefined), APIServerConfigSpec{}) } -// APIServerConfigRD defines APIServerConfig resource definition. -type APIServerConfigRD struct{} +// APIServerConfigExtension defines APIServerConfig resource definition. +type APIServerConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (APIServerConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (APIServerConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: APIServerConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/auditpolicy_config.go b/pkg/machinery/resources/k8s/auditpolicy_config.go index d72b4749b9..ecfe50fcc4 100644 --- a/pkg/machinery/resources/k8s/auditpolicy_config.go +++ b/pkg/machinery/resources/k8s/auditpolicy_config.go @@ -23,7 +23,7 @@ const AuditPolicyConfigType = resource.Type("AuditPolicyConfigs.kubernetes.talos const AuditPolicyConfigID = resource.ID("audit-policy") // AuditPolicyConfig represents configuration for kube-apiserver audit policy. -type AuditPolicyConfig = typed.Resource[AuditPolicyConfigSpec, AuditPolicyConfigRD] +type AuditPolicyConfig = typed.Resource[AuditPolicyConfigSpec, AuditPolicyConfigExtension] // AuditPolicyConfigSpec is audit policy configuration for kube-apiserver. // @@ -34,16 +34,16 @@ type AuditPolicyConfigSpec struct { // NewAuditPolicyConfig returns new AuditPolicyConfig resource. func NewAuditPolicyConfig() *AuditPolicyConfig { - return typed.NewResource[AuditPolicyConfigSpec, AuditPolicyConfigRD]( + return typed.NewResource[AuditPolicyConfigSpec, AuditPolicyConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, AuditPolicyConfigType, AuditPolicyConfigID, resource.VersionUndefined), AuditPolicyConfigSpec{}) } -// AuditPolicyConfigRD defines AuditPolicyConfig resource definition. -type AuditPolicyConfigRD struct{} +// AuditPolicyConfigExtension defines AuditPolicyConfig resource definition. +type AuditPolicyConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (AuditPolicyConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (AuditPolicyConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: AuditPolicyConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/config_status.go b/pkg/machinery/resources/k8s/config_status.go index 470362d7cb..d073405c38 100644 --- a/pkg/machinery/resources/k8s/config_status.go +++ b/pkg/machinery/resources/k8s/config_status.go @@ -23,7 +23,7 @@ const ConfigStatusType = resource.Type("ConfigStatuses.kubernetes.talos.dev") const ConfigStatusStaticPodID = resource.ID("static-pods") // ConfigStatus resource holds definition of rendered secrets. -type ConfigStatus = typed.Resource[ConfigStatusSpec, ConfigStatusRD] +type ConfigStatus = typed.Resource[ConfigStatusSpec, ConfigStatusExtension] // ConfigStatusSpec describes status of rendered secrets. // @@ -35,17 +35,17 @@ type ConfigStatusSpec struct { // NewConfigStatus initializes a ConfigStatus resource. func NewConfigStatus(namespace resource.Namespace, id resource.ID) *ConfigStatus { - return typed.NewResource[ConfigStatusSpec, ConfigStatusRD]( + return typed.NewResource[ConfigStatusSpec, ConfigStatusExtension]( resource.NewMetadata(namespace, ConfigStatusType, id, resource.VersionUndefined), ConfigStatusSpec{}, ) } -// ConfigStatusRD provides auxiliary methods for ConfigStatus. -type ConfigStatusRD struct{} +// ConfigStatusExtension provides auxiliary methods for ConfigStatus. +type ConfigStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ConfigStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ConfigStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ConfigStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/controllermanager_config.go b/pkg/machinery/resources/k8s/controllermanager_config.go index b463ec2039..2eeac55534 100644 --- a/pkg/machinery/resources/k8s/controllermanager_config.go +++ b/pkg/machinery/resources/k8s/controllermanager_config.go @@ -23,7 +23,7 @@ const ControllerManagerConfigType = resource.Type("ControllerManagerConfigs.kube const ControllerManagerConfigID = resource.ID(ControllerManagerID) // ControllerManagerConfig represents configuration for kube-controller-manager. -type ControllerManagerConfig = typed.Resource[ControllerManagerConfigSpec, ControllerManagerConfigRD] +type ControllerManagerConfig = typed.Resource[ControllerManagerConfigSpec, ControllerManagerConfigExtension] // ControllerManagerConfigSpec is configuration for kube-controller-manager. // @@ -41,16 +41,16 @@ type ControllerManagerConfigSpec struct { // NewControllerManagerConfig returns new ControllerManagerConfig resource. func NewControllerManagerConfig() *ControllerManagerConfig { - return typed.NewResource[ControllerManagerConfigSpec, ControllerManagerConfigRD]( + return typed.NewResource[ControllerManagerConfigSpec, ControllerManagerConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, ControllerManagerConfigType, ControllerManagerConfigID, resource.VersionUndefined), ControllerManagerConfigSpec{}) } -// ControllerManagerConfigRD defines ControllerManagerConfig resource definition. -type ControllerManagerConfigRD struct{} +// ControllerManagerConfigExtension defines ControllerManagerConfig resource definition. +type ControllerManagerConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (ControllerManagerConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (ControllerManagerConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ControllerManagerConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/endpoint.go b/pkg/machinery/resources/k8s/endpoint.go index 57d14b333c..8b9447d903 100644 --- a/pkg/machinery/resources/k8s/endpoint.go +++ b/pkg/machinery/resources/k8s/endpoint.go @@ -30,7 +30,7 @@ const ControlPlaneDiscoveredEndpointsID = resource.ID("discovery") const ControlPlaneKubernetesEndpointsID = resource.ID("controlplane") // Endpoint resource holds definition of rendered secrets. -type Endpoint = typed.Resource[EndpointSpec, EndpointRD] +type Endpoint = typed.Resource[EndpointSpec, EndpointExtension] // EndpointSpec describes status of rendered secrets. // @@ -41,17 +41,17 @@ type EndpointSpec struct { // NewEndpoint initializes the Endpoint resource. func NewEndpoint(namespace resource.Namespace, id resource.ID) *Endpoint { - return typed.NewResource[EndpointSpec, EndpointRD]( + return typed.NewResource[EndpointSpec, EndpointExtension]( resource.NewMetadata(namespace, EndpointType, id, resource.VersionUndefined), EndpointSpec{}, ) } -// EndpointRD provides auxiliary methods for Endpoint. -type EndpointRD struct{} +// EndpointExtension provides auxiliary methods for Endpoint. +type EndpointExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (EndpointRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (EndpointExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EndpointType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/extramanifests_config.go b/pkg/machinery/resources/k8s/extramanifests_config.go index 4577a004a5..3dc81e0a1a 100644 --- a/pkg/machinery/resources/k8s/extramanifests_config.go +++ b/pkg/machinery/resources/k8s/extramanifests_config.go @@ -23,7 +23,7 @@ const ExtraManifestsConfigType = resource.Type("ExtraManifestsConfigs.kubernetes const ExtraManifestsConfigID = resource.ID("extra-manifests") // ExtraManifestsConfig represents configuration for extra bootstrap manifests. -type ExtraManifestsConfig = typed.Resource[ExtraManifestsConfigSpec, ExtraManifestsConfigRD] +type ExtraManifestsConfig = typed.Resource[ExtraManifestsConfigSpec, ExtraManifestsConfigExtension] // ExtraManifestsConfigSpec is configuration for extra bootstrap manifests. // @@ -45,16 +45,16 @@ type ExtraManifest struct { // NewExtraManifestsConfig returns new ExtraManifestsConfig resource. func NewExtraManifestsConfig() *ExtraManifestsConfig { - return typed.NewResource[ExtraManifestsConfigSpec, ExtraManifestsConfigRD]( + return typed.NewResource[ExtraManifestsConfigSpec, ExtraManifestsConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, ExtraManifestsConfigType, ExtraManifestsConfigID, resource.VersionUndefined), ExtraManifestsConfigSpec{}) } -// ExtraManifestsConfigRD defines ExtraManifestsConfig resource definition. -type ExtraManifestsConfigRD struct{} +// ExtraManifestsConfigExtension defines ExtraManifestsConfig resource definition. +type ExtraManifestsConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (ExtraManifestsConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (ExtraManifestsConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ExtraManifestsConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/kubelet_config.go b/pkg/machinery/resources/k8s/kubelet_config.go index 229573cb0a..4381134ded 100644 --- a/pkg/machinery/resources/k8s/kubelet_config.go +++ b/pkg/machinery/resources/k8s/kubelet_config.go @@ -21,7 +21,7 @@ const KubeletConfigType = resource.Type("KubeletConfigs.kubernetes.talos.dev") const KubeletID = resource.ID("kubelet") // KubeletConfig resource holds source of kubelet configuration. -type KubeletConfig = typed.Resource[KubeletConfigSpec, KubeletConfigRD] +type KubeletConfig = typed.Resource[KubeletConfigSpec, KubeletConfigExtension] // KubeletConfigSpec holds the source of kubelet configuration. // @@ -42,17 +42,17 @@ type KubeletConfigSpec struct { // NewKubeletConfig initializes an empty KubeletConfig resource. func NewKubeletConfig(namespace resource.Namespace, id resource.ID) *KubeletConfig { - return typed.NewResource[KubeletConfigSpec, KubeletConfigRD]( + return typed.NewResource[KubeletConfigSpec, KubeletConfigExtension]( resource.NewMetadata(namespace, KubeletConfigType, id, resource.VersionUndefined), KubeletConfigSpec{}, ) } -// KubeletConfigRD provides auxiliary methods for KubeletConfig. -type KubeletConfigRD struct{} +// KubeletConfigExtension provides auxiliary methods for KubeletConfig. +type KubeletConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (KubeletConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (KubeletConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubeletConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/kubelet_lifecycle.go b/pkg/machinery/resources/k8s/kubelet_lifecycle.go index 8511ef8fe8..9297dfe1f6 100644 --- a/pkg/machinery/resources/k8s/kubelet_lifecycle.go +++ b/pkg/machinery/resources/k8s/kubelet_lifecycle.go @@ -26,24 +26,24 @@ const KubeletLifecycleID = resource.ID("kubelet") // // KubeletLifecycle is mostly about status of the workloads kubelet is running vs. // the actual status of the kubelet service itself. -type KubeletLifecycle = typed.Resource[KubeletLifecycleSpec, KubeletLifecycleRD] +type KubeletLifecycle = typed.Resource[KubeletLifecycleSpec, KubeletLifecycleExtension] // KubeletLifecycleSpec is empty. type KubeletLifecycleSpec struct{} // NewKubeletLifecycle initializes an empty KubeletLifecycle resource. func NewKubeletLifecycle(namespace resource.Namespace, id resource.ID) *KubeletLifecycle { - return typed.NewResource[KubeletLifecycleSpec, KubeletLifecycleRD]( + return typed.NewResource[KubeletLifecycleSpec, KubeletLifecycleExtension]( resource.NewMetadata(namespace, KubeletLifecycleType, id, resource.VersionUndefined), KubeletLifecycleSpec{}, ) } -// KubeletLifecycleRD provides auxiliary methods for KubeletLifecycle. -type KubeletLifecycleRD struct{} +// KubeletLifecycleExtension provides auxiliary methods for KubeletLifecycle. +type KubeletLifecycleExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (KubeletLifecycleRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (KubeletLifecycleExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubeletLifecycleType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/kubelet_spec.go b/pkg/machinery/resources/k8s/kubelet_spec.go index c12ab9ad41..5b095f852c 100644 --- a/pkg/machinery/resources/k8s/kubelet_spec.go +++ b/pkg/machinery/resources/k8s/kubelet_spec.go @@ -18,7 +18,7 @@ import ( const KubeletSpecType = resource.Type("KubeletSpecs.kubernetes.talos.dev") // KubeletSpec resource holds final definition of kubelet runtime configuration. -type KubeletSpec = typed.Resource[KubeletSpecSpec, KubeletSpecRD] +type KubeletSpec = typed.Resource[KubeletSpecSpec, KubeletSpecExtension] // KubeletSpecSpec holds the source of kubelet configuration. // @@ -33,17 +33,17 @@ type KubeletSpecSpec struct { // NewKubeletSpec initializes an empty KubeletSpec resource. func NewKubeletSpec(namespace resource.Namespace, id resource.ID) *KubeletSpec { - return typed.NewResource[KubeletSpecSpec, KubeletSpecRD]( + return typed.NewResource[KubeletSpecSpec, KubeletSpecExtension]( resource.NewMetadata(namespace, KubeletSpecType, id, resource.VersionUndefined), KubeletSpecSpec{}, ) } -// KubeletSpecRD provides auxiliary methods for KubeletSpec. -type KubeletSpecRD struct{} +// KubeletSpecExtension provides auxiliary methods for KubeletSpec. +type KubeletSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (KubeletSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (KubeletSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubeletSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/manifest.go b/pkg/machinery/resources/k8s/manifest.go index 4eaa667432..0f2eddd145 100644 --- a/pkg/machinery/resources/k8s/manifest.go +++ b/pkg/machinery/resources/k8s/manifest.go @@ -17,7 +17,7 @@ import ( const ManifestType = resource.Type("Manifests.kubernetes.talos.dev") // Manifest resource holds definition of kubelet static pod. -type Manifest = typed.Resource[ManifestSpec, ManifestRD] +type Manifest = typed.Resource[ManifestSpec, ManifestExtension] // ManifestSpec holds the Kubernetes resources spec. // @@ -40,17 +40,17 @@ func (spec ManifestSpec) MarshalYAML() (interface{}, error) { // NewManifest initializes an empty Manifest resource. func NewManifest(namespace resource.Namespace, id resource.ID) *Manifest { - return typed.NewResource[ManifestSpec, ManifestRD]( + return typed.NewResource[ManifestSpec, ManifestExtension]( resource.NewMetadata(namespace, ManifestType, id, resource.VersionUndefined), ManifestSpec{}, ) } -// ManifestRD provides auxiliary methods for Manifest. -type ManifestRD struct{} +// ManifestExtension provides auxiliary methods for Manifest. +type ManifestExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ManifestRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ManifestExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ManifestType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/manifest_status.go b/pkg/machinery/resources/k8s/manifest_status.go index b4f94ad4c8..3ce03aa68d 100644 --- a/pkg/machinery/resources/k8s/manifest_status.go +++ b/pkg/machinery/resources/k8s/manifest_status.go @@ -20,7 +20,7 @@ const ManifestStatusType = resource.Type("ManifestStatuses.kubernetes.talos.dev" const ManifestStatusID = resource.ID("manifests") // ManifestStatus resource holds definition of kubelet static pod. -type ManifestStatus = typed.Resource[ManifestStatusSpec, ManifestStatusRD] +type ManifestStatus = typed.Resource[ManifestStatusSpec, ManifestStatusExtension] // ManifestStatusSpec describes manifest application status. // @@ -31,17 +31,17 @@ type ManifestStatusSpec struct { // NewManifestStatus initializes an empty ManifestStatus resource. func NewManifestStatus(namespace resource.Namespace) *ManifestStatus { - return typed.NewResource[ManifestStatusSpec, ManifestStatusRD]( + return typed.NewResource[ManifestStatusSpec, ManifestStatusExtension]( resource.NewMetadata(namespace, ManifestStatusType, ManifestStatusID, resource.VersionUndefined), ManifestStatusSpec{}, ) } -// ManifestStatusRD provides auxiliary methods for ManifestStatus. -type ManifestStatusRD struct{} +// ManifestStatusExtension provides auxiliary methods for ManifestStatus. +type ManifestStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ManifestStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ManifestStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ManifestStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/manifests_config.go b/pkg/machinery/resources/k8s/manifests_config.go index ecba497b22..bdd63149d8 100644 --- a/pkg/machinery/resources/k8s/manifests_config.go +++ b/pkg/machinery/resources/k8s/manifests_config.go @@ -23,7 +23,7 @@ const BootstrapManifestsConfigType = resource.Type("BootstrapManifestsConfigs.ku const BootstrapManifestsConfigID = resource.ID("manifests") // BootstrapManifestsConfig represents configuration for bootstrap manifests. -type BootstrapManifestsConfig = typed.Resource[BootstrapManifestsConfigSpec, BootstrapManifestsConfigRD] +type BootstrapManifestsConfig = typed.Resource[BootstrapManifestsConfigSpec, BootstrapManifestsConfigExtension] // BootstrapManifestsConfigSpec is configuration for bootstrap manifests. // @@ -55,16 +55,16 @@ type BootstrapManifestsConfigSpec struct { // NewBootstrapManifestsConfig returns new BootstrapManifestsConfig resource. func NewBootstrapManifestsConfig() *BootstrapManifestsConfig { - return typed.NewResource[BootstrapManifestsConfigSpec, BootstrapManifestsConfigRD]( + return typed.NewResource[BootstrapManifestsConfigSpec, BootstrapManifestsConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, BootstrapManifestsConfigType, BootstrapManifestsConfigID, resource.VersionUndefined), BootstrapManifestsConfigSpec{}) } -// BootstrapManifestsConfigRD defines BootstrapManifestsConfig resource definition. -type BootstrapManifestsConfigRD struct{} +// BootstrapManifestsConfigExtension defines BootstrapManifestsConfig resource definition. +type BootstrapManifestsConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (BootstrapManifestsConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (BootstrapManifestsConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: BootstrapManifestsConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/node_label_spec.go b/pkg/machinery/resources/k8s/node_label_spec.go index ec7643e4a0..1385e9b3df 100644 --- a/pkg/machinery/resources/k8s/node_label_spec.go +++ b/pkg/machinery/resources/k8s/node_label_spec.go @@ -25,32 +25,21 @@ type NodeLabelSpecSpec struct { } // NodeLabelSpec ... -type NodeLabelSpec = typed.Resource[NodeLabelSpecSpec, NodeLabelSpecRD] +type NodeLabelSpec = typed.Resource[NodeLabelSpecSpec, NodeLabelSpecExtension] // NewNodeLabelSpec initializes a NodeLabel resource. func NewNodeLabelSpec(id resource.ID) *NodeLabelSpec { - return typed.NewResource[NodeLabelSpecSpec, NodeLabelSpecRD]( + return typed.NewResource[NodeLabelSpecSpec, NodeLabelSpecExtension]( resource.NewMetadata(NamespaceName, NodeLabelSpecType, id, resource.VersionUndefined), NodeLabelSpecSpec{}, ) } -// NewPopulatedNodeLabelSpec initializes a NodeLabel resource and populates it. -func NewPopulatedNodeLabelSpec(id resource.ID, key, value string, createdByTalos bool) *NodeLabelSpec { - return typed.NewResource[NodeLabelSpecSpec, NodeLabelSpecRD]( - resource.NewMetadata(NamespaceName, NodeLabelSpecType, id, resource.VersionUndefined), - NodeLabelSpecSpec{ - Key: key, - Value: value, - }, - ) -} - -// NodeLabelSpecRD provides auxiliary methods for NodeLabel. -type NodeLabelSpecRD struct{} +// NodeLabelSpecExtension provides auxiliary methods for NodeLabel. +type NodeLabelSpecExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (NodeLabelSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (NodeLabelSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodeLabelSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/nodeip.go b/pkg/machinery/resources/k8s/nodeip.go index 622f687a76..081521ef6a 100644 --- a/pkg/machinery/resources/k8s/nodeip.go +++ b/pkg/machinery/resources/k8s/nodeip.go @@ -19,7 +19,7 @@ import ( const NodeIPType = resource.Type("NodeIPs.kubernetes.talos.dev") // NodeIP resource holds definition of Node IP specification. -type NodeIP = typed.Resource[NodeIPSpec, NodeIPRD] +type NodeIP = typed.Resource[NodeIPSpec, NodeIPExtension] // NodeIPSpec holds the Node IP specification. // @@ -30,17 +30,17 @@ type NodeIPSpec struct { // NewNodeIP initializes an empty NodeIP resource. func NewNodeIP(namespace resource.Namespace, id resource.ID) *NodeIP { - return typed.NewResource[NodeIPSpec, NodeIPRD]( + return typed.NewResource[NodeIPSpec, NodeIPExtension]( resource.NewMetadata(namespace, NodeIPType, id, resource.VersionUndefined), NodeIPSpec{}, ) } -// NodeIPRD provides auxiliary methods for NodeIP. -type NodeIPRD struct{} +// NodeIPExtension provides auxiliary methods for NodeIP. +type NodeIPExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (NodeIPRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (NodeIPExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodeIPType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/nodeip_config.go b/pkg/machinery/resources/k8s/nodeip_config.go index cd39fd6a57..9a0b86854f 100644 --- a/pkg/machinery/resources/k8s/nodeip_config.go +++ b/pkg/machinery/resources/k8s/nodeip_config.go @@ -17,7 +17,7 @@ import ( const NodeIPConfigType = resource.Type("NodeIPConfigs.kubernetes.talos.dev") // NodeIPConfig resource holds definition of Node IP specification. -type NodeIPConfig = typed.Resource[NodeIPConfigSpec, NodeIPConfigRD] +type NodeIPConfig = typed.Resource[NodeIPConfigSpec, NodeIPConfigExtension] // NodeIPConfigSpec holds the Node IP specification. // @@ -29,17 +29,17 @@ type NodeIPConfigSpec struct { // NewNodeIPConfig initializes an empty NodeIPConfig resource. func NewNodeIPConfig(namespace resource.Namespace, id resource.ID) *NodeIPConfig { - return typed.NewResource[NodeIPConfigSpec, NodeIPConfigRD]( + return typed.NewResource[NodeIPConfigSpec, NodeIPConfigExtension]( resource.NewMetadata(namespace, NodeIPConfigType, id, resource.VersionUndefined), NodeIPConfigSpec{}, ) } -// NodeIPConfigRD provides auxiliary methods for NodeIPConfig. -type NodeIPConfigRD struct{} +// NodeIPConfigExtension provides auxiliary methods for NodeIPConfig. +type NodeIPConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (NodeIPConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (NodeIPConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodeIPConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/nodename.go b/pkg/machinery/resources/k8s/nodename.go index 3e88f3c27b..7d8b17f2f4 100644 --- a/pkg/machinery/resources/k8s/nodename.go +++ b/pkg/machinery/resources/k8s/nodename.go @@ -20,7 +20,7 @@ const NodenameType = resource.Type("Nodenames.kubernetes.talos.dev") const NodenameID = resource.ID("nodename") // Nodename resource holds Kubernetes nodename. -type Nodename = typed.Resource[NodenameSpec, NodenameRD] +type Nodename = typed.Resource[NodenameSpec, NodenameExtension] // NodenameSpec describes Kubernetes nodename. // @@ -32,17 +32,17 @@ type NodenameSpec struct { // NewNodename initializes a Nodename resource. func NewNodename(namespace resource.Namespace, id resource.ID) *Nodename { - return typed.NewResource[NodenameSpec, NodenameRD]( + return typed.NewResource[NodenameSpec, NodenameExtension]( resource.NewMetadata(namespace, NodenameType, id, resource.VersionUndefined), NodenameSpec{}, ) } -// NodenameRD provides auxiliary methods for Nodename. -type NodenameRD struct{} +// NodenameExtension provides auxiliary methods for Nodename. +type NodenameExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (NodenameRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (NodenameExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodenameType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/scheduler_config.go b/pkg/machinery/resources/k8s/scheduler_config.go index 2e1f6a7fa4..907f1a8382 100644 --- a/pkg/machinery/resources/k8s/scheduler_config.go +++ b/pkg/machinery/resources/k8s/scheduler_config.go @@ -23,7 +23,7 @@ const SchedulerConfigType = resource.Type("SchedulerConfigs.kubernetes.talos.dev const SchedulerConfigID = resource.ID(SchedulerID) // SchedulerConfig represents configuration for kube-scheduler. -type SchedulerConfig = typed.Resource[SchedulerConfigSpec, SchedulerConfigRD] +type SchedulerConfig = typed.Resource[SchedulerConfigSpec, SchedulerConfigExtension] // SchedulerConfigSpec is configuration for kube-scheduler. // @@ -38,16 +38,16 @@ type SchedulerConfigSpec struct { // NewSchedulerConfig returns new SchedulerConfig resource. func NewSchedulerConfig() *SchedulerConfig { - return typed.NewResource[SchedulerConfigSpec, SchedulerConfigRD]( + return typed.NewResource[SchedulerConfigSpec, SchedulerConfigExtension]( resource.NewMetadata(ControlPlaneNamespaceName, SchedulerConfigType, SchedulerConfigID, resource.VersionUndefined), SchedulerConfigSpec{}) } -// SchedulerConfigRD defines SchedulerConfig resource definition. -type SchedulerConfigRD struct{} +// SchedulerConfigExtension defines SchedulerConfig resource definition. +type SchedulerConfigExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (SchedulerConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (SchedulerConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: SchedulerConfigType, DefaultNamespace: ControlPlaneNamespaceName, diff --git a/pkg/machinery/resources/k8s/secrets_status.go b/pkg/machinery/resources/k8s/secrets_status.go index c4c981028b..7f4273a001 100644 --- a/pkg/machinery/resources/k8s/secrets_status.go +++ b/pkg/machinery/resources/k8s/secrets_status.go @@ -23,7 +23,7 @@ const SecretsStatusType = resource.Type("SecretStatuses.kubernetes.talos.dev") const StaticPodSecretsStaticPodID = resource.ID("static-pods") // SecretsStatus resource holds definition of rendered secrets. -type SecretsStatus = typed.Resource[SecretsStatusSpec, SecretsStatusRD] +type SecretsStatus = typed.Resource[SecretsStatusSpec, SecretsStatusExtension] // SecretsStatusSpec describes status of rendered secrets. // @@ -35,17 +35,17 @@ type SecretsStatusSpec struct { // NewSecretsStatus initializes a SecretsStatus resource. func NewSecretsStatus(namespace resource.Namespace, id resource.ID) *SecretsStatus { - return typed.NewResource[SecretsStatusSpec, SecretsStatusRD]( + return typed.NewResource[SecretsStatusSpec, SecretsStatusExtension]( resource.NewMetadata(namespace, SecretsStatusType, id, resource.VersionUndefined), SecretsStatusSpec{}, ) } -// SecretsStatusRD provides auxiliary methods for SecretsStatus. -type SecretsStatusRD struct{} +// SecretsStatusExtension provides auxiliary methods for SecretsStatus. +type SecretsStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (SecretsStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (SecretsStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: SecretsStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/static_pod.go b/pkg/machinery/resources/k8s/static_pod.go index 158906b26e..aba076f037 100644 --- a/pkg/machinery/resources/k8s/static_pod.go +++ b/pkg/machinery/resources/k8s/static_pod.go @@ -17,7 +17,7 @@ import ( const StaticPodType = resource.Type("StaticPods.kubernetes.talos.dev") // StaticPod resource holds definition of kubelet static pod. -type StaticPod = typed.Resource[StaticPodSpec, StaticPodRD] +type StaticPod = typed.Resource[StaticPodSpec, StaticPodExtension] // StaticPodSpec describes static pod spec, it contains marshaled *v1.Pod spec. // @@ -33,17 +33,17 @@ func (spec StaticPodSpec) MarshalYAML() (interface{}, error) { // NewStaticPod initializes a StaticPod resource. func NewStaticPod(namespace resource.Namespace, id resource.ID) *StaticPod { - return typed.NewResource[StaticPodSpec, StaticPodRD]( + return typed.NewResource[StaticPodSpec, StaticPodExtension]( resource.NewMetadata(namespace, StaticPodType, id, resource.VersionUndefined), StaticPodSpec{}, ) } -// StaticPodRD provides auxiliary methods for StaticPod. -type StaticPodRD struct{} +// StaticPodExtension provides auxiliary methods for StaticPod. +type StaticPodExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (StaticPodRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (StaticPodExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: StaticPodType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/static_pod_server_status.go b/pkg/machinery/resources/k8s/static_pod_server_status.go index 3dc27e63b7..f643dfc94c 100644 --- a/pkg/machinery/resources/k8s/static_pod_server_status.go +++ b/pkg/machinery/resources/k8s/static_pod_server_status.go @@ -17,7 +17,7 @@ import ( const StaticPodServerStatusType = resource.Type("StaticPodServerStatuses.kubernetes.talos.dev") // StaticPodServerStatus resource holds definition of kubelet static pod. -type StaticPodServerStatus = typed.Resource[StaticPodServerStatusSpec, StaticPodServerStatusRD] +type StaticPodServerStatus = typed.Resource[StaticPodServerStatusSpec, StaticPodServerStatusExtension] // StaticPodServerStatusSpec describes static pod spec, it contains marshaled *v1.Pod spec. // @@ -31,17 +31,17 @@ const StaticPodServerStatusResourceID = "static-pod-server-status" // NewStaticPodServerStatus initializes a StaticPodServerStatus resource. func NewStaticPodServerStatus(namespace resource.Namespace, id resource.ID) *StaticPodServerStatus { - return typed.NewResource[StaticPodServerStatusSpec, StaticPodServerStatusRD]( + return typed.NewResource[StaticPodServerStatusSpec, StaticPodServerStatusExtension]( resource.NewMetadata(namespace, StaticPodServerStatusType, id, resource.VersionUndefined), StaticPodServerStatusSpec{}, ) } -// StaticPodServerStatusRD provides auxiliary methods for StaticPodServerStatus. -type StaticPodServerStatusRD struct{} +// StaticPodServerStatusExtension provides auxiliary methods for StaticPodServerStatus. +type StaticPodServerStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (StaticPodServerStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (StaticPodServerStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: StaticPodServerStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/k8s/static_pod_status.go b/pkg/machinery/resources/k8s/static_pod_status.go index 7bc11dbc50..ed2e1480c6 100644 --- a/pkg/machinery/resources/k8s/static_pod_status.go +++ b/pkg/machinery/resources/k8s/static_pod_status.go @@ -17,7 +17,7 @@ import ( const StaticPodStatusType = resource.Type("StaticPodStatuses.kubernetes.talos.dev") // StaticPodStatus resource holds definition of kubelet static pod. -type StaticPodStatus = typed.Resource[StaticPodStatusSpec, StaticPodStatusRD] +type StaticPodStatus = typed.Resource[StaticPodStatusSpec, StaticPodStatusExtension] // StaticPodStatusSpec describes kubelet static pod status. // @@ -33,17 +33,17 @@ func (spec StaticPodStatusSpec) MarshalYAML() (interface{}, error) { // NewStaticPodStatus initializes a StaticPodStatus resource. func NewStaticPodStatus(namespace resource.Namespace, id resource.ID) *StaticPodStatus { - return typed.NewResource[StaticPodStatusSpec, StaticPodStatusRD]( + return typed.NewResource[StaticPodStatusSpec, StaticPodStatusExtension]( resource.NewMetadata(namespace, StaticPodStatusType, id, resource.VersionUndefined), StaticPodStatusSpec{}, ) } -// StaticPodStatusRD provides auxiliary methods for StaticPodStatus. -type StaticPodStatusRD struct{} +// StaticPodStatusExtension provides auxiliary methods for StaticPodStatus. +type StaticPodStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (StaticPodStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (StaticPodStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: StaticPodStatusType, Aliases: []resource.Type{"podstatus"}, diff --git a/pkg/machinery/resources/kubeaccess/config.go b/pkg/machinery/resources/kubeaccess/config.go index e001972296..78f8be575c 100644 --- a/pkg/machinery/resources/kubeaccess/config.go +++ b/pkg/machinery/resources/kubeaccess/config.go @@ -21,7 +21,7 @@ const ConfigType = resource.Type("KubernetesAccessConfigs.cluster.talos.dev") const ConfigID = resource.ID("config") // Config resource holds KubeSpan configuration. -type Config = typed.Resource[ConfigSpec, ConfigRD] +type Config = typed.Resource[ConfigSpec, ConfigExtension] // ConfigSpec describes KubeSpan configuration.. // @@ -51,17 +51,17 @@ func (cs ConfigSpec) DeepCopy() ConfigSpec { // NewConfig initializes a Config resource. func NewConfig(namespace resource.Namespace, id resource.ID) *Config { - return typed.NewResource[ConfigSpec, ConfigRD]( + return typed.NewResource[ConfigSpec, ConfigExtension]( resource.NewMetadata(namespace, ConfigType, id, resource.VersionUndefined), ConfigSpec{}, ) } -// ConfigRD provides auxiliary methods for Config. -type ConfigRD struct{} +// ConfigExtension provides auxiliary methods for Config. +type ConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (c ConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (c ConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/kubespan/config.go b/pkg/machinery/resources/kubespan/config.go index 432dfbb4cf..780e8ccd7f 100644 --- a/pkg/machinery/resources/kubespan/config.go +++ b/pkg/machinery/resources/kubespan/config.go @@ -24,7 +24,7 @@ const ConfigType = resource.Type("KubeSpanConfigs.kubespan.talos.dev") const ConfigID = resource.ID("kubespan") // Config resource holds KubeSpan configuration. -type Config = typed.Resource[ConfigSpec, ConfigRD] +type Config = typed.Resource[ConfigSpec, ConfigExtension] // ConfigSpec describes KubeSpan configuration.. // @@ -45,17 +45,17 @@ type ConfigSpec struct { // NewConfig initializes a Config resource. func NewConfig(namespace resource.Namespace, id resource.ID) *Config { - return typed.NewResource[ConfigSpec, ConfigRD]( + return typed.NewResource[ConfigSpec, ConfigExtension]( resource.NewMetadata(namespace, ConfigType, id, resource.VersionUndefined), ConfigSpec{}, ) } -// ConfigRD provides auxiliary methods for Config. -type ConfigRD struct{} +// ConfigExtension provides auxiliary methods for Config. +type ConfigExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ConfigRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ConfigType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/kubespan/endpoint.go b/pkg/machinery/resources/kubespan/endpoint.go index 99105d3f79..a5781db19d 100644 --- a/pkg/machinery/resources/kubespan/endpoint.go +++ b/pkg/machinery/resources/kubespan/endpoint.go @@ -21,7 +21,7 @@ const EndpointType = resource.Type("KubeSpanEndpoints.kubespan.talos.dev") // Endpoint is produced from KubeSpanPeerStatuses by mapping back discovered endpoints to the affiliates. // // Endpoint is identified by the public key of the peer. -type Endpoint = typed.Resource[EndpointSpec, EndpointRD] +type Endpoint = typed.Resource[EndpointSpec, EndpointExtension] // EndpointSpec describes Endpoint state. // @@ -33,17 +33,17 @@ type EndpointSpec struct { // NewEndpoint initializes a Endpoint resource. func NewEndpoint(namespace resource.Namespace, id resource.ID) *Endpoint { - return typed.NewResource[EndpointSpec, EndpointRD]( + return typed.NewResource[EndpointSpec, EndpointExtension]( resource.NewMetadata(namespace, EndpointType, id, resource.VersionUndefined), EndpointSpec{}, ) } -// EndpointRD provides auxiliary methods for Endpoint. -type EndpointRD struct{} +// EndpointExtension provides auxiliary methods for Endpoint. +type EndpointExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (EndpointRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (EndpointExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EndpointType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/kubespan/identity.go b/pkg/machinery/resources/kubespan/identity.go index 78b6f4f15d..07d5244b48 100644 --- a/pkg/machinery/resources/kubespan/identity.go +++ b/pkg/machinery/resources/kubespan/identity.go @@ -22,7 +22,7 @@ const IdentityType = resource.Type("KubeSpanIdentities.kubespan.talos.dev") const LocalIdentity = resource.ID("local") // Identity resource holds node identity (as a member of the cluster). -type Identity = typed.Resource[IdentitySpec, IdentityRD] +type Identity = typed.Resource[IdentitySpec, IdentityExtension] // IdentitySpec describes KubeSpan keys and address. // @@ -41,17 +41,17 @@ type IdentitySpec struct { // NewIdentity initializes a Identity resource. func NewIdentity(namespace resource.Namespace, id resource.ID) *Identity { - return typed.NewResource[IdentitySpec, IdentityRD]( + return typed.NewResource[IdentitySpec, IdentityExtension]( resource.NewMetadata(namespace, IdentityType, id, resource.VersionUndefined), IdentitySpec{}, ) } -// IdentityRD provides auxiliary methods for Identity. -type IdentityRD struct{} +// IdentityExtension provides auxiliary methods for Identity. +type IdentityExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (IdentityRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (IdentityExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: IdentityType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/kubespan/peer_spec.go b/pkg/machinery/resources/kubespan/peer_spec.go index f5699946ec..002cce942a 100644 --- a/pkg/machinery/resources/kubespan/peer_spec.go +++ b/pkg/machinery/resources/kubespan/peer_spec.go @@ -21,7 +21,7 @@ const PeerSpecType = resource.Type("KubeSpanPeerSpecs.kubespan.talos.dev") // PeerSpec is produced from cluster.Affiliate which has KubeSpan information attached. // // PeerSpec is identified by the public key. -type PeerSpec = typed.Resource[PeerSpecSpec, PeerSpecRD] +type PeerSpec = typed.Resource[PeerSpecSpec, PeerSpecExtension] // PeerSpecSpec describes PeerSpec state. // @@ -35,17 +35,17 @@ type PeerSpecSpec struct { // NewPeerSpec initializes a PeerSpec resource. func NewPeerSpec(namespace resource.Namespace, id resource.ID) *PeerSpec { - return typed.NewResource[PeerSpecSpec, PeerSpecRD]( + return typed.NewResource[PeerSpecSpec, PeerSpecExtension]( resource.NewMetadata(namespace, PeerSpecType, id, resource.VersionUndefined), PeerSpecSpec{}, ) } -// PeerSpecRD provides auxiliary methods for PeerSpec. -type PeerSpecRD struct{} +// PeerSpecExtension provides auxiliary methods for PeerSpec. +type PeerSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (PeerSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (PeerSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: PeerSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/kubespan/peer_status.go b/pkg/machinery/resources/kubespan/peer_status.go index 78235195d2..d2325894e5 100644 --- a/pkg/machinery/resources/kubespan/peer_status.go +++ b/pkg/machinery/resources/kubespan/peer_status.go @@ -22,7 +22,7 @@ const PeerStatusType = resource.Type("KubeSpanPeerStatuses.kubespan.talos.dev") // PeerStatus the Wireguard peer state for KubeSpan. // // PeerStatus is identified by the public key. -type PeerStatus = typed.Resource[PeerStatusSpec, PeerStatusRD] +type PeerStatus = typed.Resource[PeerStatusSpec, PeerStatusExtension] // PeerStatusSpec describes PeerStatus state. // @@ -46,17 +46,17 @@ type PeerStatusSpec struct { // NewPeerStatus initializes a PeerStatus resource. func NewPeerStatus(namespace resource.Namespace, id resource.ID) *PeerStatus { - return typed.NewResource[PeerStatusSpec, PeerStatusRD]( + return typed.NewResource[PeerStatusSpec, PeerStatusExtension]( resource.NewMetadata(namespace, PeerStatusType, id, resource.VersionUndefined), PeerStatusSpec{}, ) } -// PeerStatusRD provides auxiliary methods for PeerStatus. -type PeerStatusRD struct{} +// PeerStatusExtension provides auxiliary methods for PeerStatus. +type PeerStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (PeerStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (PeerStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: PeerStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/address_spec.go b/pkg/machinery/resources/network/address_spec.go index c6d5cdea29..469a0bb9be 100644 --- a/pkg/machinery/resources/network/address_spec.go +++ b/pkg/machinery/resources/network/address_spec.go @@ -23,7 +23,7 @@ import ( const AddressSpecType = resource.Type("AddressSpecs.net.talos.dev") // AddressSpec resource holds physical network link status. -type AddressSpec = typed.Resource[AddressSpecSpec, AddressSpecRD] +type AddressSpec = typed.Resource[AddressSpecSpec, AddressSpecExtension] // AddressSpecSpec describes status of rendered secrets. // @@ -40,17 +40,17 @@ type AddressSpecSpec struct { // NewAddressSpec initializes a AddressSpec resource. func NewAddressSpec(namespace resource.Namespace, id resource.ID) *AddressSpec { - return typed.NewResource[AddressSpecSpec, AddressSpecRD]( + return typed.NewResource[AddressSpecSpec, AddressSpecExtension]( resource.NewMetadata(namespace, AddressSpecType, id, resource.VersionUndefined), AddressSpecSpec{}, ) } -// AddressSpecRD provides auxiliary methods for AddressSpec. -type AddressSpecRD struct{} +// AddressSpecExtension provides auxiliary methods for AddressSpec. +type AddressSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (AddressSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (AddressSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: AddressSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/address_status.go b/pkg/machinery/resources/network/address_status.go index 0780e6da2a..1bf8dc0bb2 100644 --- a/pkg/machinery/resources/network/address_status.go +++ b/pkg/machinery/resources/network/address_status.go @@ -20,7 +20,7 @@ import ( const AddressStatusType = resource.Type("AddressStatuses.net.talos.dev") // AddressStatus resource holds physical network link status. -type AddressStatus = typed.Resource[AddressStatusSpec, AddressStatusRD] +type AddressStatus = typed.Resource[AddressStatusSpec, AddressStatusExtension] // AddressStatusSpec describes status of rendered secrets. // @@ -40,17 +40,17 @@ type AddressStatusSpec struct { // NewAddressStatus initializes a AddressStatus resource. func NewAddressStatus(namespace resource.Namespace, id resource.ID) *AddressStatus { - return typed.NewResource[AddressStatusSpec, AddressStatusRD]( + return typed.NewResource[AddressStatusSpec, AddressStatusExtension]( resource.NewMetadata(namespace, AddressStatusType, id, resource.VersionUndefined), AddressStatusSpec{}, ) } -// AddressStatusRD provides auxiliary methods for AddressStatus. -type AddressStatusRD struct{} +// AddressStatusExtension provides auxiliary methods for AddressStatus. +type AddressStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (AddressStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (AddressStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: AddressStatusType, Aliases: []resource.Type{"address", "addresses"}, diff --git a/pkg/machinery/resources/network/device_config_spec.go b/pkg/machinery/resources/network/device_config_spec.go index ced0f76018..72dfad76ed 100644 --- a/pkg/machinery/resources/network/device_config_spec.go +++ b/pkg/machinery/resources/network/device_config_spec.go @@ -21,7 +21,7 @@ import ( const DeviceConfigSpecType = resource.Type("DeviceConfigSpecs.net.talos.dev") // DeviceConfigSpec resource holds network interface configs. -type DeviceConfigSpec = typed.Resource[DeviceConfigSpecSpec, DeviceConfigSpecRD] +type DeviceConfigSpec = typed.Resource[DeviceConfigSpecSpec, DeviceConfigSpecExtension] // DeviceConfigSpecSpec contains the spec of a device config. // @@ -32,7 +32,7 @@ type DeviceConfigSpecSpec struct { // NewDeviceConfig creates new interface config. func NewDeviceConfig(id resource.ID, device config.Device) *DeviceConfigSpec { - return typed.NewResource[DeviceConfigSpecSpec, DeviceConfigSpecRD]( + return typed.NewResource[DeviceConfigSpecSpec, DeviceConfigSpecExtension]( resource.NewMetadata(NamespaceName, DeviceConfigSpecType, id, resource.VersionUndefined), DeviceConfigSpecSpec{Device: device}, ) @@ -46,11 +46,11 @@ func (spec DeviceConfigSpecSpec) DeepCopy() DeviceConfigSpecSpec { return cp } -// DeviceConfigSpecRD providers auxiliary methods for DeviceConfigSpec. -type DeviceConfigSpecRD struct{} +// DeviceConfigSpecExtension providers auxiliary methods for DeviceConfigSpec. +type DeviceConfigSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (DeviceConfigSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (DeviceConfigSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: DeviceConfigSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/hardrware_addr.go b/pkg/machinery/resources/network/hardrware_addr.go index e35f18623b..5e8edce940 100644 --- a/pkg/machinery/resources/network/hardrware_addr.go +++ b/pkg/machinery/resources/network/hardrware_addr.go @@ -21,7 +21,7 @@ const HardwareAddrType = resource.Type("HardwareAddresses.net.talos.dev") const FirstHardwareAddr = resource.ID("first") // HardwareAddr resource describes hardware address of the physical links. -type HardwareAddr = typed.Resource[HardwareAddrSpec, HardwareAddrRD] +type HardwareAddr = typed.Resource[HardwareAddrSpec, HardwareAddrExtension] // HardwareAddrSpec describes spec for the link. // @@ -36,17 +36,17 @@ type HardwareAddrSpec struct { // NewHardwareAddr initializes a HardwareAddr resource. func NewHardwareAddr(namespace resource.Namespace, id resource.ID) *HardwareAddr { - return typed.NewResource[HardwareAddrSpec, HardwareAddrRD]( + return typed.NewResource[HardwareAddrSpec, HardwareAddrExtension]( resource.NewMetadata(namespace, HardwareAddrType, id, resource.VersionUndefined), HardwareAddrSpec{}, ) } -// HardwareAddrRD provides auxiliary methods for HardwareAddr. -type HardwareAddrRD struct{} +// HardwareAddrExtension provides auxiliary methods for HardwareAddr. +type HardwareAddrExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (HardwareAddrRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (HardwareAddrExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: HardwareAddrType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/hostname_spec.go b/pkg/machinery/resources/network/hostname_spec.go index e153160bf8..d9ba855578 100644 --- a/pkg/machinery/resources/network/hostname_spec.go +++ b/pkg/machinery/resources/network/hostname_spec.go @@ -20,7 +20,7 @@ import ( const HostnameSpecType = resource.Type("HostnameSpecs.net.talos.dev") // HostnameSpec resource holds node hostname. -type HostnameSpec = typed.Resource[HostnameSpecSpec, HostnameSpecRD] +type HostnameSpec = typed.Resource[HostnameSpecSpec, HostnameSpecExtension] // HostnameID is the ID of the singleton instance. const HostnameID resource.ID = "hostname" @@ -73,17 +73,17 @@ func (spec *HostnameSpecSpec) ParseFQDN(fqdn string) error { // NewHostnameSpec initializes a HostnameSpec resource. func NewHostnameSpec(namespace resource.Namespace, id resource.ID) *HostnameSpec { - return typed.NewResource[HostnameSpecSpec, HostnameSpecRD]( + return typed.NewResource[HostnameSpecSpec, HostnameSpecExtension]( resource.NewMetadata(namespace, HostnameSpecType, id, resource.VersionUndefined), HostnameSpecSpec{}, ) } -// HostnameSpecRD provides auxiliary methods for HostnameSpec. -type HostnameSpecRD struct{} +// HostnameSpecExtension provides auxiliary methods for HostnameSpec. +type HostnameSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (HostnameSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (HostnameSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: HostnameSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/hostname_status.go b/pkg/machinery/resources/network/hostname_status.go index 90139318d6..9dcf3236e6 100644 --- a/pkg/machinery/resources/network/hostname_status.go +++ b/pkg/machinery/resources/network/hostname_status.go @@ -17,7 +17,7 @@ import ( const HostnameStatusType = resource.Type("HostnameStatuses.net.talos.dev") // HostnameStatus resource holds node hostname. -type HostnameStatus = typed.Resource[HostnameStatusSpec, HostnameStatusRD] +type HostnameStatus = typed.Resource[HostnameStatusSpec, HostnameStatusExtension] // HostnameStatusSpec describes node nostname. // @@ -49,17 +49,17 @@ func (spec *HostnameStatusSpec) DNSNames() []string { // NewHostnameStatus initializes a HostnameStatus resource. func NewHostnameStatus(namespace resource.Namespace, id resource.ID) *HostnameStatus { - return typed.NewResource[HostnameStatusSpec, HostnameStatusRD]( + return typed.NewResource[HostnameStatusSpec, HostnameStatusExtension]( resource.NewMetadata(namespace, HostnameStatusType, id, resource.VersionUndefined), HostnameStatusSpec{}, ) } -// HostnameStatusRD provides auxiliary methods for HostnameStatus. -type HostnameStatusRD struct{} +// HostnameStatusExtension provides auxiliary methods for HostnameStatus. +type HostnameStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (HostnameStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (HostnameStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: HostnameStatusType, Aliases: []resource.Type{"hostname"}, diff --git a/pkg/machinery/resources/network/link_refresh.go b/pkg/machinery/resources/network/link_refresh.go index 3d8778158c..a693e96df9 100644 --- a/pkg/machinery/resources/network/link_refresh.go +++ b/pkg/machinery/resources/network/link_refresh.go @@ -23,7 +23,7 @@ const LinkRefreshType = resource.Type("LinkRefreshes.net.talos.dev") // // Whenever Wireguard interface is updated, LinkRefresh resource is modified to trigger a reconcile // loop in the LinkStatusController. -type LinkRefresh = typed.Resource[LinkRefreshSpec, LinkRefreshRD] +type LinkRefresh = typed.Resource[LinkRefreshSpec, LinkRefreshExtension] // LinkRefreshSpec describes status of rendered secrets. // @@ -39,17 +39,17 @@ func (s *LinkRefreshSpec) Bump() { // NewLinkRefresh initializes a LinkRefresh resource. func NewLinkRefresh(namespace resource.Namespace, id resource.ID) *LinkRefresh { - return typed.NewResource[LinkRefreshSpec, LinkRefreshRD]( + return typed.NewResource[LinkRefreshSpec, LinkRefreshExtension]( resource.NewMetadata(namespace, LinkRefreshType, id, resource.VersionUndefined), LinkRefreshSpec{}, ) } -// LinkRefreshRD provides auxiliary methods for LinkRefresh. -type LinkRefreshRD struct{} +// LinkRefreshExtension provides auxiliary methods for LinkRefresh. +type LinkRefreshExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (LinkRefreshRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (LinkRefreshExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: LinkRefreshType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/link_spec.go b/pkg/machinery/resources/network/link_spec.go index c0e7742fb4..7231a16047 100644 --- a/pkg/machinery/resources/network/link_spec.go +++ b/pkg/machinery/resources/network/link_spec.go @@ -18,7 +18,7 @@ import ( const LinkSpecType = resource.Type("LinkSpecs.net.talos.dev") // LinkSpec resource describes desired state of the link (network interface). -type LinkSpec = typed.Resource[LinkSpecSpec, LinkSpecRD] +type LinkSpec = typed.Resource[LinkSpecSpec, LinkSpecExtension] // LinkSpecSpec describes spec for the link. // @@ -121,17 +121,17 @@ func updateIfNotZero[T comparable](target *T, source T) { // NewLinkSpec initializes a LinkSpec resource. func NewLinkSpec(namespace resource.Namespace, id resource.ID) *LinkSpec { - return typed.NewResource[LinkSpecSpec, LinkSpecRD]( + return typed.NewResource[LinkSpecSpec, LinkSpecExtension]( resource.NewMetadata(namespace, LinkSpecType, id, resource.VersionUndefined), LinkSpecSpec{}, ) } -// LinkSpecRD provides auxiliary methods for LinkSpec. -type LinkSpecRD struct{} +// LinkSpecExtension provides auxiliary methods for LinkSpec. +type LinkSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (LinkSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (LinkSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: LinkSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/link_status.go b/pkg/machinery/resources/network/link_status.go index a9559f9011..1fe75fe5e9 100644 --- a/pkg/machinery/resources/network/link_status.go +++ b/pkg/machinery/resources/network/link_status.go @@ -18,7 +18,7 @@ import ( const LinkStatusType = resource.Type("LinkStatuses.net.talos.dev") // LinkStatus resource holds physical network link status. -type LinkStatus = typed.Resource[LinkStatusSpec, LinkStatusRD] +type LinkStatus = typed.Resource[LinkStatusSpec, LinkStatusExtension] // LinkStatusSpec describes status of rendered secrets. // @@ -66,17 +66,17 @@ func (s LinkStatusSpec) Physical() bool { // NewLinkStatus initializes a LinkStatus resource. func NewLinkStatus(namespace resource.Namespace, id resource.ID) *LinkStatus { - return typed.NewResource[LinkStatusSpec, LinkStatusRD]( + return typed.NewResource[LinkStatusSpec, LinkStatusExtension]( resource.NewMetadata(namespace, LinkStatusType, id, resource.VersionUndefined), LinkStatusSpec{}, ) } -// LinkStatusRD provides auxiliary methods for LinkStatus. -type LinkStatusRD struct{} +// LinkStatusExtension provides auxiliary methods for LinkStatus. +type LinkStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (LinkStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (LinkStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: LinkStatusType, Aliases: []resource.Type{"link", "links"}, diff --git a/pkg/machinery/resources/network/node_address.go b/pkg/machinery/resources/network/node_address.go index 293fa3c5c2..2b62463315 100644 --- a/pkg/machinery/resources/network/node_address.go +++ b/pkg/machinery/resources/network/node_address.go @@ -21,7 +21,7 @@ import ( const NodeAddressType = resource.Type("NodeAddresses.net.talos.dev") // NodeAddress resource holds physical network link status. -type NodeAddress = typed.Resource[NodeAddressSpec, NodeAddressRD] +type NodeAddress = typed.Resource[NodeAddressSpec, NodeAddressExtension] // NodeAddress well-known IDs. const ( @@ -54,17 +54,17 @@ type NodeAddressSpec struct { // NewNodeAddress initializes a NodeAddress resource. func NewNodeAddress(namespace resource.Namespace, id resource.ID) *NodeAddress { - return typed.NewResource[NodeAddressSpec, NodeAddressRD]( + return typed.NewResource[NodeAddressSpec, NodeAddressExtension]( resource.NewMetadata(namespace, NodeAddressType, id, resource.VersionUndefined), NodeAddressSpec{}, ) } -// NodeAddressRD provides auxiliary methods for NodeAddress. -type NodeAddressRD struct{} +// NodeAddressExtension provides auxiliary methods for NodeAddress. +type NodeAddressExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (NodeAddressRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (NodeAddressExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodeAddressType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/node_address_filter.go b/pkg/machinery/resources/network/node_address_filter.go index e720ceecf0..b0991224ed 100644 --- a/pkg/machinery/resources/network/node_address_filter.go +++ b/pkg/machinery/resources/network/node_address_filter.go @@ -19,7 +19,7 @@ import ( const NodeAddressFilterType = resource.Type("NodeAddressFilters.net.talos.dev") // NodeAddressFilter resource holds filter for NodeAddress resources. -type NodeAddressFilter = typed.Resource[NodeAddressFilterSpec, NodeAddressFilterRD] +type NodeAddressFilter = typed.Resource[NodeAddressFilterSpec, NodeAddressFilterExtension] // NodeAddressFilterSpec describes a filter for NodeAddresses. // @@ -33,17 +33,17 @@ type NodeAddressFilterSpec struct { // NewNodeAddressFilter initializes a NodeAddressFilter resource. func NewNodeAddressFilter(namespace resource.Namespace, id resource.ID) *NodeAddressFilter { - return typed.NewResource[NodeAddressFilterSpec, NodeAddressFilterRD]( + return typed.NewResource[NodeAddressFilterSpec, NodeAddressFilterExtension]( resource.NewMetadata(namespace, NodeAddressFilterType, id, resource.VersionUndefined), NodeAddressFilterSpec{}, ) } -// NodeAddressFilterRD provides auxiliary methods for NodeAddressFilter. -type NodeAddressFilterRD struct{} +// NodeAddressFilterExtension provides auxiliary methods for NodeAddressFilter. +type NodeAddressFilterExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (NodeAddressFilterRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (NodeAddressFilterExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: NodeAddressFilterType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/operator_spec.go b/pkg/machinery/resources/network/operator_spec.go index f51f615cdd..d3fdd06ab2 100644 --- a/pkg/machinery/resources/network/operator_spec.go +++ b/pkg/machinery/resources/network/operator_spec.go @@ -19,7 +19,7 @@ import ( const OperatorSpecType = resource.Type("OperatorSpecs.net.talos.dev") // OperatorSpec resource holds DNS resolver info. -type OperatorSpec = typed.Resource[OperatorSpecSpec, OperatorSpecRD] +type OperatorSpec = typed.Resource[OperatorSpecSpec, OperatorSpecExtension] // OperatorSpecSpec describes DNS resolvers. // @@ -84,17 +84,17 @@ type VIPHCloudSpec struct { // NewOperatorSpec initializes a OperatorSpec resource. func NewOperatorSpec(namespace resource.Namespace, id resource.ID) *OperatorSpec { - return typed.NewResource[OperatorSpecSpec, OperatorSpecRD]( + return typed.NewResource[OperatorSpecSpec, OperatorSpecExtension]( resource.NewMetadata(namespace, OperatorSpecType, id, resource.VersionUndefined), OperatorSpecSpec{}, ) } -// OperatorSpecRD provides auxiliary methods for OperatorSpec. -type OperatorSpecRD struct{} +// OperatorSpecExtension provides auxiliary methods for OperatorSpec. +type OperatorSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (OperatorSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (OperatorSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: OperatorSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/resolver_spec.go b/pkg/machinery/resources/network/resolver_spec.go index af6a3f0552..2756aed9e1 100644 --- a/pkg/machinery/resources/network/resolver_spec.go +++ b/pkg/machinery/resources/network/resolver_spec.go @@ -19,7 +19,7 @@ import ( const ResolverSpecType = resource.Type("ResolverSpecs.net.talos.dev") // ResolverSpec resource holds DNS resolver info. -type ResolverSpec = typed.Resource[ResolverSpecSpec, ResolverSpecRD] +type ResolverSpec = typed.Resource[ResolverSpecSpec, ResolverSpecExtension] // ResolverID is the ID of the singleton instance. const ResolverID resource.ID = "resolvers" @@ -34,17 +34,17 @@ type ResolverSpecSpec struct { // NewResolverSpec initializes a ResolverSpec resource. func NewResolverSpec(namespace resource.Namespace, id resource.ID) *ResolverSpec { - return typed.NewResource[ResolverSpecSpec, ResolverSpecRD]( + return typed.NewResource[ResolverSpecSpec, ResolverSpecExtension]( resource.NewMetadata(namespace, ResolverSpecType, id, resource.VersionUndefined), ResolverSpecSpec{}, ) } -// ResolverSpecRD provides auxiliary methods for ResolverSpec. -type ResolverSpecRD struct{} +// ResolverSpecExtension provides auxiliary methods for ResolverSpec. +type ResolverSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ResolverSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ResolverSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ResolverSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/resolver_status.go b/pkg/machinery/resources/network/resolver_status.go index 164ae02ae2..7fd9b0a09e 100644 --- a/pkg/machinery/resources/network/resolver_status.go +++ b/pkg/machinery/resources/network/resolver_status.go @@ -19,7 +19,7 @@ import ( const ResolverStatusType = resource.Type("ResolverStatuses.net.talos.dev") // ResolverStatus resource holds DNS resolver info. -type ResolverStatus = typed.Resource[ResolverStatusSpec, ResolverStatusRD] +type ResolverStatus = typed.Resource[ResolverStatusSpec, ResolverStatusExtension] // ResolverStatusSpec describes DNS resolvers. // @@ -30,17 +30,17 @@ type ResolverStatusSpec struct { // NewResolverStatus initializes a ResolverStatus resource. func NewResolverStatus(namespace resource.Namespace, id resource.ID) *ResolverStatus { - return typed.NewResource[ResolverStatusSpec, ResolverStatusRD]( + return typed.NewResource[ResolverStatusSpec, ResolverStatusExtension]( resource.NewMetadata(namespace, ResolverStatusType, id, resource.VersionUndefined), ResolverStatusSpec{}, ) } -// ResolverStatusRD provides auxiliary methods for ResolverStatus. -type ResolverStatusRD struct{} +// ResolverStatusExtension provides auxiliary methods for ResolverStatus. +type ResolverStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (ResolverStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (ResolverStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ResolverStatusType, Aliases: []resource.Type{"resolvers"}, diff --git a/pkg/machinery/resources/network/route_spec.go b/pkg/machinery/resources/network/route_spec.go index 72c7933980..a1375c3986 100644 --- a/pkg/machinery/resources/network/route_spec.go +++ b/pkg/machinery/resources/network/route_spec.go @@ -21,7 +21,7 @@ import ( const RouteSpecType = resource.Type("RouteSpecs.net.talos.dev") // RouteSpec resource holds route specification to be applied to the kernel. -type RouteSpec = typed.Resource[RouteSpecSpec, RouteSpecRD] +type RouteSpec = typed.Resource[RouteSpecSpec, RouteSpecExtension] // RouteSpecSpec describes the route. // @@ -74,17 +74,17 @@ func (route *RouteSpecSpec) Normalize() { // NewRouteSpec initializes a RouteSpec resource. func NewRouteSpec(namespace resource.Namespace, id resource.ID) *RouteSpec { - return typed.NewResource[RouteSpecSpec, RouteSpecRD]( + return typed.NewResource[RouteSpecSpec, RouteSpecExtension]( resource.NewMetadata(namespace, RouteSpecType, id, resource.VersionUndefined), RouteSpecSpec{}, ) } -// RouteSpecRD provides auxiliary methods for RouteSpec. -type RouteSpecRD struct{} +// RouteSpecExtension provides auxiliary methods for RouteSpec. +type RouteSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (RouteSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (RouteSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: RouteSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/route_status.go b/pkg/machinery/resources/network/route_status.go index fccdbf108c..e533dfb5fd 100644 --- a/pkg/machinery/resources/network/route_status.go +++ b/pkg/machinery/resources/network/route_status.go @@ -20,7 +20,7 @@ import ( const RouteStatusType = resource.Type("RouteStatuses.net.talos.dev") // RouteStatus resource holds physical network link status. -type RouteStatus = typed.Resource[RouteStatusSpec, RouteStatusRD] +type RouteStatus = typed.Resource[RouteStatusSpec, RouteStatusExtension] // RouteStatusSpec describes status of rendered secrets. // @@ -43,17 +43,17 @@ type RouteStatusSpec struct { // NewRouteStatus initializes a RouteStatus resource. func NewRouteStatus(namespace resource.Namespace, id resource.ID) *RouteStatus { - return typed.NewResource[RouteStatusSpec, RouteStatusRD]( + return typed.NewResource[RouteStatusSpec, RouteStatusExtension]( resource.NewMetadata(namespace, RouteStatusType, id, resource.VersionUndefined), RouteStatusSpec{}, ) } -// RouteStatusRD provides auxiliary methods for RouteStatus. -type RouteStatusRD struct{} +// RouteStatusExtension provides auxiliary methods for RouteStatus. +type RouteStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (RouteStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (RouteStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: RouteStatusType, Aliases: []resource.Type{"route", "routes"}, diff --git a/pkg/machinery/resources/network/status.go b/pkg/machinery/resources/network/status.go index d70352abc9..e7f7acdab5 100644 --- a/pkg/machinery/resources/network/status.go +++ b/pkg/machinery/resources/network/status.go @@ -17,7 +17,7 @@ import ( const StatusType = resource.Type("NetworkStatuses.net.talos.dev") // Status resource holds status of networking setup. -type Status = typed.Resource[StatusSpec, StatusRD] +type Status = typed.Resource[StatusSpec, StatusExtension] // StatusSpec describes network state. // @@ -34,17 +34,17 @@ const StatusID resource.ID = "status" // NewStatus initializes a Status resource. func NewStatus(namespace resource.Namespace, id resource.ID) *Status { - return typed.NewResource[StatusSpec, StatusRD]( + return typed.NewResource[StatusSpec, StatusExtension]( resource.NewMetadata(namespace, StatusType, id, resource.VersionUndefined), StatusSpec{}, ) } -// StatusRD provides auxiliary methods for Status. -type StatusRD struct{} +// StatusExtension provides auxiliary methods for Status. +type StatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (StatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (StatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: StatusType, Aliases: []resource.Type{"netstatus", "netstatuses"}, diff --git a/pkg/machinery/resources/network/timeserver_spec.go b/pkg/machinery/resources/network/timeserver_spec.go index c74a440758..0a91eb27fc 100644 --- a/pkg/machinery/resources/network/timeserver_spec.go +++ b/pkg/machinery/resources/network/timeserver_spec.go @@ -17,7 +17,7 @@ import ( const TimeServerSpecType = resource.Type("TimeServerSpecs.net.talos.dev") // TimeServerSpec resource holds NTP server info. -type TimeServerSpec = typed.Resource[TimeServerSpecSpec, TimeServerSpecRD] +type TimeServerSpec = typed.Resource[TimeServerSpecSpec, TimeServerSpecExtension] // TimeServerID is the ID of the singleton instance. const TimeServerID resource.ID = "timeservers" @@ -32,17 +32,17 @@ type TimeServerSpecSpec struct { // NewTimeServerSpec initializes a TimeServerSpec resource. func NewTimeServerSpec(namespace resource.Namespace, id resource.ID) *TimeServerSpec { - return typed.NewResource[TimeServerSpecSpec, TimeServerSpecRD]( + return typed.NewResource[TimeServerSpecSpec, TimeServerSpecExtension]( resource.NewMetadata(namespace, TimeServerSpecType, id, resource.VersionUndefined), TimeServerSpecSpec{}, ) } -// TimeServerSpecRD provides auxiliary methods for TimeServerSpec. -type TimeServerSpecRD struct{} +// TimeServerSpecExtension provides auxiliary methods for TimeServerSpec. +type TimeServerSpecExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (TimeServerSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (TimeServerSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: TimeServerSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/network/timeserver_status.go b/pkg/machinery/resources/network/timeserver_status.go index 72a3a39cf2..2e94c312eb 100644 --- a/pkg/machinery/resources/network/timeserver_status.go +++ b/pkg/machinery/resources/network/timeserver_status.go @@ -17,7 +17,7 @@ import ( const TimeServerStatusType = resource.Type("TimeServerStatuses.net.talos.dev") // TimeServerStatus resource holds NTP server info. -type TimeServerStatus = typed.Resource[TimeServerStatusSpec, TimeServerStatusRD] +type TimeServerStatus = typed.Resource[TimeServerStatusSpec, TimeServerStatusExtension] // TimeServerStatusSpec describes NTP servers. // @@ -28,17 +28,17 @@ type TimeServerStatusSpec struct { // NewTimeServerStatus initializes a TimeServerStatus resource. func NewTimeServerStatus(namespace resource.Namespace, id resource.ID) *TimeServerStatus { - return typed.NewResource[TimeServerStatusSpec, TimeServerStatusRD]( + return typed.NewResource[TimeServerStatusSpec, TimeServerStatusExtension]( resource.NewMetadata(namespace, TimeServerStatusType, id, resource.VersionUndefined), TimeServerStatusSpec{}, ) } -// TimeServerStatusRD provides auxiliary methods for TimeServerStatus. -type TimeServerStatusRD struct{} +// TimeServerStatusExtension provides auxiliary methods for TimeServerStatus. +type TimeServerStatusExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (TimeServerStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (TimeServerStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: TimeServerStatusType, Aliases: []resource.Type{"timeserver", "timeservers"}, diff --git a/pkg/machinery/resources/perf/cpu.go b/pkg/machinery/resources/perf/cpu.go index 9ed3c45279..148fbe1f0e 100644 --- a/pkg/machinery/resources/perf/cpu.go +++ b/pkg/machinery/resources/perf/cpu.go @@ -23,7 +23,7 @@ const CPUType = resource.Type("CPUStats.perf.talos.dev") const CPUID = resource.ID("latest") // CPU represents the last CPU stats snapshot. -type CPU = typed.Resource[CPUSpec, CPURD] +type CPU = typed.Resource[CPUSpec, CPUExtension] // CPUSpec represents the last CPU stats snapshot. // @@ -57,17 +57,17 @@ type CPUStat struct { // NewCPU creates new default CPU stats object. func NewCPU() *CPU { - return typed.NewResource[CPUSpec, CPURD]( + return typed.NewResource[CPUSpec, CPUExtension]( resource.NewMetadata(NamespaceName, CPUType, CPUID, resource.VersionUndefined), CPUSpec{}, ) } -// CPURD is an auxiliary type for CPU resource. -type CPURD struct{} +// CPUExtension is an auxiliary type for CPU resource. +type CPUExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (CPURD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (CPUExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: CPUType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/perf/mem.go b/pkg/machinery/resources/perf/mem.go index 8f5fbda74b..3af24f021a 100644 --- a/pkg/machinery/resources/perf/mem.go +++ b/pkg/machinery/resources/perf/mem.go @@ -20,7 +20,7 @@ const MemoryType = resource.Type("MemoryStats.perf.talos.dev") const MemoryID = resource.ID("latest") // Memory represents the last Memory stats snapshot. -type Memory = typed.Resource[MemorySpec, MemoryRD] +type Memory = typed.Resource[MemorySpec, MemoryExtension] // MemorySpec represents the last Memory stats snapshot. // @@ -78,17 +78,17 @@ type MemorySpec struct { // NewMemory creates new default Memory stats object. func NewMemory() *Memory { - return typed.NewResource[MemorySpec, MemoryRD]( + return typed.NewResource[MemorySpec, MemoryExtension]( resource.NewMetadata(NamespaceName, MemoryType, MemoryID, resource.VersionUndefined), MemorySpec{}, ) } -// MemoryRD is an auxiliary type for Memory resource. -type MemoryRD struct{} +// MemoryExtension is an auxiliary type for Memory resource. +type MemoryExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (MemoryRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (MemoryExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MemoryType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/runtime/extension_status.go b/pkg/machinery/resources/runtime/extension_status.go index 88adf6af0d..262123ddef 100644 --- a/pkg/machinery/resources/runtime/extension_status.go +++ b/pkg/machinery/resources/runtime/extension_status.go @@ -18,24 +18,24 @@ import ( const ExtensionStatusType = resource.Type("ExtensionStatuses.runtime.talos.dev") // ExtensionStatus resource holds status of installed system extensions. -type ExtensionStatus = typed.Resource[ExtensionStatusSpec, ExtensionStatusRD] +type ExtensionStatus = typed.Resource[ExtensionStatusSpec, ExtensionStatusExtension] // ExtensionStatusSpec is the spec for system extensions. type ExtensionStatusSpec = extensions.Layer // NewExtensionStatus initializes a ExtensionStatus resource. func NewExtensionStatus(namespace resource.Namespace, id resource.ID) *ExtensionStatus { - return typed.NewResource[ExtensionStatusSpec, ExtensionStatusRD]( + return typed.NewResource[ExtensionStatusSpec, ExtensionStatusExtension]( resource.NewMetadata(namespace, ExtensionStatusType, id, resource.VersionUndefined), ExtensionStatusSpec{}, ) } -// ExtensionStatusRD is auxiliary resource data for ExtensionStatus. -type ExtensionStatusRD struct{} +// ExtensionStatusExtension is auxiliary resource data for ExtensionStatus. +type ExtensionStatusExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (ExtensionStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (ExtensionStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ExtensionStatusType, Aliases: []resource.Type{"extensions"}, diff --git a/pkg/machinery/resources/runtime/kernel_module_spec.go b/pkg/machinery/resources/runtime/kernel_module_spec.go index d659d206ad..fb700f2f72 100644 --- a/pkg/machinery/resources/runtime/kernel_module_spec.go +++ b/pkg/machinery/resources/runtime/kernel_module_spec.go @@ -17,7 +17,7 @@ import ( const KernelModuleSpecType = resource.Type("KernelModuleSpecs.runtime.talos.dev") // KernelModuleSpec resource holds information about Linux kernel module to load. -type KernelModuleSpec = typed.Resource[KernelModuleSpecSpec, KernelModuleSpecRD] +type KernelModuleSpec = typed.Resource[KernelModuleSpecSpec, KernelModuleSpecExtension] // KernelModuleSpecSpec describes Linux kernel module to load. // @@ -30,17 +30,17 @@ type KernelModuleSpecSpec struct { // NewKernelModuleSpec initializes a KernelModuleSpec resource. func NewKernelModuleSpec(namespace resource.Namespace, id resource.ID) *KernelModuleSpec { - return typed.NewResource[KernelModuleSpecSpec, KernelModuleSpecRD]( + return typed.NewResource[KernelModuleSpecSpec, KernelModuleSpecExtension]( resource.NewMetadata(namespace, KernelModuleSpecType, id, resource.VersionUndefined), KernelModuleSpecSpec{}, ) } -// KernelModuleSpecRD is auxiliary resource data for KernelModuleSpec. -type KernelModuleSpecRD struct{} +// KernelModuleSpecExtension is auxiliary resource data for KernelModuleSpec. +type KernelModuleSpecExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KernelModuleSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KernelModuleSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KernelModuleSpecType, Aliases: []resource.Type{"modules"}, diff --git a/pkg/machinery/resources/runtime/kernel_params_spec.go b/pkg/machinery/resources/runtime/kernel_params_spec.go index eb75ad5e18..393635cff0 100644 --- a/pkg/machinery/resources/runtime/kernel_params_spec.go +++ b/pkg/machinery/resources/runtime/kernel_params_spec.go @@ -29,7 +29,7 @@ type KernelParam interface { } // KernelParamSpec resource holds sysctl flags to define. -type KernelParamSpec = typed.Resource[KernelParamSpecSpec, KernelParamSpecRD] +type KernelParamSpec = typed.Resource[KernelParamSpecSpec, KernelParamSpecExtension] // KernelParamSpecSpec describes status of the defined sysctls. // @@ -41,17 +41,17 @@ type KernelParamSpecSpec struct { // NewKernelParamSpec initializes a KernelParamSpec resource. func NewKernelParamSpec(namespace resource.Namespace, id resource.ID) *KernelParamSpec { - return typed.NewResource[KernelParamSpecSpec, KernelParamSpecRD]( + return typed.NewResource[KernelParamSpecSpec, KernelParamSpecExtension]( resource.NewMetadata(namespace, KernelParamSpecType, id, resource.VersionUndefined), KernelParamSpecSpec{}, ) } -// KernelParamSpecRD is the ResourceDefinition for KernelParamSpec. -type KernelParamSpecRD struct{} +// KernelParamSpecExtension is the typed.Extension for KernelParamSpec. +type KernelParamSpecExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KernelParamSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KernelParamSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KernelParamSpecType, Aliases: []resource.Type{}, @@ -61,24 +61,24 @@ func (KernelParamSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { } // KernelParamDefaultSpec implements meta.ResourceDefinitionProvider interface. -type KernelParamDefaultSpec = typed.Resource[KernelParamDefaultSpecSpec, KernelParamDefaultSpecRD] +type KernelParamDefaultSpec = typed.Resource[KernelParamDefaultSpecSpec, KernelParamDefaultSpecExtension] // KernelParamDefaultSpecSpec is same as KernelParamSpecSpec. type KernelParamDefaultSpecSpec = KernelParamSpecSpec // NewKernelParamDefaultSpec initializes a KernelParamDefaultSpec resource. func NewKernelParamDefaultSpec(namespace resource.Namespace, id resource.ID) *KernelParamDefaultSpec { - return typed.NewResource[KernelParamDefaultSpecSpec, KernelParamDefaultSpecRD]( + return typed.NewResource[KernelParamDefaultSpecSpec, KernelParamDefaultSpecExtension]( resource.NewMetadata(namespace, KernelParamDefaultSpecType, id, resource.VersionUndefined), KernelParamSpecSpec{}, ) } -// KernelParamDefaultSpecRD is the ResourceDefinition for KernelParamDefaultSpec. -type KernelParamDefaultSpecRD struct{} +// KernelParamDefaultSpecExtension is the typed.Extension for KernelParamDefaultSpec. +type KernelParamDefaultSpecExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KernelParamDefaultSpecRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KernelParamDefaultSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KernelParamDefaultSpecType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/runtime/kernel_params_status.go b/pkg/machinery/resources/runtime/kernel_params_status.go index c7373d3e28..98ecdbb6db 100644 --- a/pkg/machinery/resources/runtime/kernel_params_status.go +++ b/pkg/machinery/resources/runtime/kernel_params_status.go @@ -17,7 +17,7 @@ import ( const KernelParamStatusType = resource.Type("KernelParamStatuses.runtime.talos.dev") // KernelParamStatus resource holds defined sysctl flags status. -type KernelParamStatus = typed.Resource[KernelParamStatusSpec, KernelParamStatusRD] +type KernelParamStatus = typed.Resource[KernelParamStatusSpec, KernelParamStatusExtension] // KernelParamStatusSpec describes status of the defined sysctls. // @@ -30,17 +30,17 @@ type KernelParamStatusSpec struct { // NewKernelParamStatus initializes a KernelParamStatus resource. func NewKernelParamStatus(namespace resource.Namespace, id resource.ID) *KernelParamStatus { - return typed.NewResource[KernelParamStatusSpec, KernelParamStatusRD]( + return typed.NewResource[KernelParamStatusSpec, KernelParamStatusExtension]( resource.NewMetadata(namespace, KernelParamStatusType, id, resource.VersionUndefined), KernelParamStatusSpec{}, ) } -// KernelParamStatusRD is auxiliary resource data for KernelParamStatus. -type KernelParamStatusRD struct{} +// KernelParamStatusExtension is auxiliary resource data for KernelParamStatus. +type KernelParamStatusExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KernelParamStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KernelParamStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KernelParamStatusType, Aliases: []resource.Type{"sysctls", "kernelparameters", "kernelparams"}, diff --git a/pkg/machinery/resources/runtime/machine_status.go b/pkg/machinery/resources/runtime/machine_status.go index 537902edb2..50496184f8 100644 --- a/pkg/machinery/resources/runtime/machine_status.go +++ b/pkg/machinery/resources/runtime/machine_status.go @@ -20,7 +20,7 @@ const MachineStatusType = resource.Type("MachineStatuses.runtime.talos.dev") const MachineStatusID = resource.ID("machine") // MachineStatus resource holds information about aggregated machine status. -type MachineStatus = typed.Resource[MachineStatusSpec, MachineStatusRD] +type MachineStatus = typed.Resource[MachineStatusSpec, MachineStatusExtension] // MachineStatusSpec describes status of the defined sysctls. // @@ -48,17 +48,17 @@ type UnmetCondition struct { // NewMachineStatus initializes a MachineStatus resource. func NewMachineStatus() *MachineStatus { - return typed.NewResource[MachineStatusSpec, MachineStatusRD]( + return typed.NewResource[MachineStatusSpec, MachineStatusExtension]( resource.NewMetadata(NamespaceName, MachineStatusType, MachineStatusID, resource.VersionUndefined), MachineStatusSpec{}, ) } -// MachineStatusRD is auxiliary resource data for MachineStatus. -type MachineStatusRD struct{} +// MachineStatusExtension is auxiliary resource data for MachineStatus. +type MachineStatusExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (MachineStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (MachineStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MachineStatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/runtime/mount_status.go b/pkg/machinery/resources/runtime/mount_status.go index e82958c08e..93e62707cd 100644 --- a/pkg/machinery/resources/runtime/mount_status.go +++ b/pkg/machinery/resources/runtime/mount_status.go @@ -17,7 +17,7 @@ import ( const MountStatusType = resource.Type("MountStatuses.runtime.talos.dev") // MountStatus resource holds defined sysctl flags status. -type MountStatus = typed.Resource[MountStatusSpec, MountStatusRD] +type MountStatus = typed.Resource[MountStatusSpec, MountStatusExtension] // MountStatusSpec describes status of the defined sysctls. // @@ -31,17 +31,17 @@ type MountStatusSpec struct { // NewMountStatus initializes a MountStatus resource. func NewMountStatus(namespace resource.Namespace, id resource.ID) *MountStatus { - return typed.NewResource[MountStatusSpec, MountStatusRD]( + return typed.NewResource[MountStatusSpec, MountStatusExtension]( resource.NewMetadata(namespace, MountStatusType, id, resource.VersionUndefined), MountStatusSpec{}, ) } -// MountStatusRD is auxiliary resource data for MountStatus. -type MountStatusRD struct{} +// MountStatusExtension is auxiliary resource data for MountStatus. +type MountStatusExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (MountStatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (MountStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: MountStatusType, Aliases: []resource.Type{"mounts"}, diff --git a/pkg/machinery/resources/runtime/platform_metadata.go b/pkg/machinery/resources/runtime/platform_metadata.go index d378be02b3..b4324179e9 100644 --- a/pkg/machinery/resources/runtime/platform_metadata.go +++ b/pkg/machinery/resources/runtime/platform_metadata.go @@ -20,7 +20,7 @@ const PlatformMetadataType = resource.Type("PlatformMetadatas.talos.dev") const PlatformMetadataID resource.ID = "platformmetadata" // PlatformMetadata resource holds. -type PlatformMetadata = typed.Resource[PlatformMetadataSpec, PlatformMetadataRD] +type PlatformMetadata = typed.Resource[PlatformMetadataSpec, PlatformMetadataExtension] // PlatformMetadataSpec describes platform metadata properties. // @@ -37,18 +37,18 @@ type PlatformMetadataSpec struct { } // NewPlatformMetadataSpec initializes a MetadataSpec resource. -func NewPlatformMetadataSpec(namespace resource.Namespace, id resource.ID) *PlatformMetadata { - return typed.NewResource[PlatformMetadataSpec, PlatformMetadataRD]( +func NewPlatformMetadataSpec(namespace resource.Namespace, _ resource.ID) *PlatformMetadata { + return typed.NewResource[PlatformMetadataSpec, PlatformMetadataExtension]( resource.NewMetadata(namespace, PlatformMetadataType, PlatformMetadataID, resource.VersionUndefined), PlatformMetadataSpec{}, ) } -// PlatformMetadataRD provides auxiliary methods for PlatformMetadata. -type PlatformMetadataRD struct{} +// PlatformMetadataExtension provides auxiliary methods for PlatformMetadata. +type PlatformMetadataExtension struct{} -// ResourceDefinition implements typed.ResourceDefinition interface. -func (PlatformMetadataRD) ResourceDefinition() meta.ResourceDefinitionSpec { +// ResourceDefinition implements [typed.Extension] interface. +func (PlatformMetadataExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: PlatformMetadataType, DefaultNamespace: NamespaceName, diff --git a/pkg/machinery/resources/secrets/api.go b/pkg/machinery/resources/secrets/api.go index 473a5b0f96..22dddf2f1e 100644 --- a/pkg/machinery/resources/secrets/api.go +++ b/pkg/machinery/resources/secrets/api.go @@ -21,7 +21,7 @@ const APIType = resource.Type("ApiCertificates.secrets.talos.dev") const APIID = resource.ID("api") // API contains apid generated secrets. -type API = typed.Resource[APICertsSpec, APIRD] +type API = typed.Resource[APICertsSpec, APIExtension] // APICertsSpec describes etcd certs secrets. // @@ -34,17 +34,17 @@ type APICertsSpec struct { // NewAPI initializes an API resource. func NewAPI() *API { - return typed.NewResource[APICertsSpec, APIRD]( + return typed.NewResource[APICertsSpec, APIExtension]( resource.NewMetadata(NamespaceName, APIType, APIID, resource.VersionUndefined), APICertsSpec{}, ) } -// APIRD provides auxiliary methods for API. -type APIRD struct{} +// APIExtension provides auxiliary methods for API. +type APIExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (APIRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (APIExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: APIType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/cert_sans.go b/pkg/machinery/resources/secrets/cert_sans.go index 9b3ae30ea0..e501477493 100644 --- a/pkg/machinery/resources/secrets/cert_sans.go +++ b/pkg/machinery/resources/secrets/cert_sans.go @@ -28,7 +28,7 @@ const CertSANAPIID = resource.ID("api") const CertSANKubernetesID = resource.ID("k8s") // CertSAN contains certficiate subject alternative names. -type CertSAN = typed.Resource[CertSANSpec, CertSANRD] +type CertSAN = typed.Resource[CertSANSpec, CertSANExtension] // CertSANSpec describes fields of the cert SANs. // @@ -41,17 +41,17 @@ type CertSANSpec struct { // NewCertSAN initializes a Etc resource. func NewCertSAN(namespace resource.Namespace, id resource.ID) *CertSAN { - return typed.NewResource[CertSANSpec, CertSANRD]( + return typed.NewResource[CertSANSpec, CertSANExtension]( resource.NewMetadata(namespace, CertSANType, id, resource.VersionUndefined), CertSANSpec{}, ) } -// CertSANRD is a resource data of CertSAN. -type CertSANRD struct{} +// CertSANExtension is a resource data of CertSAN. +type CertSANExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (CertSANRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (CertSANExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: CertSANType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/etcd.go b/pkg/machinery/resources/secrets/etcd.go index 4eb02cb63c..55a9b53458 100644 --- a/pkg/machinery/resources/secrets/etcd.go +++ b/pkg/machinery/resources/secrets/etcd.go @@ -21,7 +21,7 @@ const EtcdType = resource.Type("EtcdSecrets.secrets.talos.dev") const EtcdID = resource.ID("etcd") // Etcd contains etcd generated secrets. -type Etcd = typed.Resource[EtcdCertsSpec, EtcdRD] +type Etcd = typed.Resource[EtcdCertsSpec, EtcdExtension] // EtcdCertsSpec describes etcd certs secrets. // @@ -35,17 +35,17 @@ type EtcdCertsSpec struct { // NewEtcd initializes a Etc resource. func NewEtcd() *Etcd { - return typed.NewResource[EtcdCertsSpec, EtcdRD]( + return typed.NewResource[EtcdCertsSpec, EtcdExtension]( resource.NewMetadata(NamespaceName, EtcdType, EtcdID, resource.VersionUndefined), EtcdCertsSpec{}, ) } -// EtcdRD provides auxiliary methods for Etcd. -type EtcdRD struct{} +// EtcdExtension provides auxiliary methods for Etcd. +type EtcdExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (EtcdRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (EtcdExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EtcdType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/etcd_root.go b/pkg/machinery/resources/secrets/etcd_root.go index 7d50ffbb07..7662642a78 100644 --- a/pkg/machinery/resources/secrets/etcd_root.go +++ b/pkg/machinery/resources/secrets/etcd_root.go @@ -21,7 +21,7 @@ const EtcdRootType = resource.Type("EtcdRootSecrets.secrets.talos.dev") const EtcdRootID = resource.ID("etcd") // EtcdRoot contains root (not generated) secrets. -type EtcdRoot = typed.Resource[EtcdRootSpec, EtcdRootRD] +type EtcdRoot = typed.Resource[EtcdRootSpec, EtcdRootExtension] // EtcdRootSpec describes etcd CA secrets. // @@ -32,17 +32,17 @@ type EtcdRootSpec struct { // NewEtcdRoot initializes a EtcdRoot resource. func NewEtcdRoot(id resource.ID) *EtcdRoot { - return typed.NewResource[EtcdRootSpec, EtcdRootRD]( + return typed.NewResource[EtcdRootSpec, EtcdRootExtension]( resource.NewMetadata(NamespaceName, EtcdRootType, id, resource.VersionUndefined), EtcdRootSpec{}, ) } -// EtcdRootRD provides auxiliary methods for EtcdRoot. -type EtcdRootRD struct{} +// EtcdRootExtension provides auxiliary methods for EtcdRoot. +type EtcdRootExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (EtcdRootRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (EtcdRootExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: EtcdRootType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/kubelet.go b/pkg/machinery/resources/secrets/kubelet.go index 825bac9b9c..c88c5d5387 100644 --- a/pkg/machinery/resources/secrets/kubelet.go +++ b/pkg/machinery/resources/secrets/kubelet.go @@ -23,7 +23,7 @@ const KubeletType = resource.Type("KubeletSecrets.secrets.talos.dev") const KubeletID = resource.ID("kubelet") // Kubelet contains root (not generated) secrets. -type Kubelet = typed.Resource[KubeletSpec, KubeletRD] +type Kubelet = typed.Resource[KubeletSpec, KubeletExtension] // KubeletSpec describes root Kubernetes secrets. // @@ -39,17 +39,17 @@ type KubeletSpec struct { // NewKubelet initializes a Kubelet resource. func NewKubelet(id resource.ID) *Kubelet { - return typed.NewResource[KubeletSpec, KubeletRD]( + return typed.NewResource[KubeletSpec, KubeletExtension]( resource.NewMetadata(NamespaceName, KubeletType, id, resource.VersionUndefined), KubeletSpec{}, ) } -// KubeletRD provides auxiliary methods for Kubelet. -type KubeletRD struct{} +// KubeletExtension provides auxiliary methods for Kubelet. +type KubeletExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KubeletRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KubeletExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubeletType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/kubernetes.go b/pkg/machinery/resources/secrets/kubernetes.go index 0f7a452a37..85f5e789e3 100644 --- a/pkg/machinery/resources/secrets/kubernetes.go +++ b/pkg/machinery/resources/secrets/kubernetes.go @@ -21,7 +21,7 @@ const KubernetesType = resource.Type("KubernetesSecrets.secrets.talos.dev") const KubernetesID = resource.ID("k8s-certs") // Kubernetes contains K8s generated secrets. -type Kubernetes = typed.Resource[KubernetesCertsSpec, KubernetesRD] +type Kubernetes = typed.Resource[KubernetesCertsSpec, KubernetesExtension] // KubernetesCertsSpec describes generated Kubernetes certificates. // @@ -41,17 +41,17 @@ type KubernetesCertsSpec struct { // NewKubernetes initializes a Kubernetes resource. func NewKubernetes() *Kubernetes { - return typed.NewResource[KubernetesCertsSpec, KubernetesRD]( + return typed.NewResource[KubernetesCertsSpec, KubernetesExtension]( resource.NewMetadata(NamespaceName, KubernetesType, KubernetesID, resource.VersionUndefined), KubernetesCertsSpec{}, ) } -// KubernetesRD provides auxiliary methods for Kubernetes. -type KubernetesRD struct{} +// KubernetesExtension provides auxiliary methods for Kubernetes. +type KubernetesExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KubernetesRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KubernetesExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubernetesType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/kubernetes_root.go b/pkg/machinery/resources/secrets/kubernetes_root.go index 567a8bb3e9..a50d8ec4b1 100644 --- a/pkg/machinery/resources/secrets/kubernetes_root.go +++ b/pkg/machinery/resources/secrets/kubernetes_root.go @@ -24,7 +24,7 @@ const KubernetesRootType = resource.Type("KubernetesRootSecrets.secrets.talos.de const KubernetesRootID = resource.ID("k8s") // KubernetesRoot contains root (not generated) secrets. -type KubernetesRoot = typed.Resource[KubernetesRootSpec, KubernetesRootRD] +type KubernetesRoot = typed.Resource[KubernetesRootSpec, KubernetesRootExtension] // KubernetesRootSpec describes root Kubernetes secrets. // @@ -51,17 +51,17 @@ type KubernetesRootSpec struct { // NewKubernetesRoot initializes a KubernetesRoot resource. func NewKubernetesRoot(id resource.ID) *KubernetesRoot { - return typed.NewResource[KubernetesRootSpec, KubernetesRootRD]( + return typed.NewResource[KubernetesRootSpec, KubernetesRootExtension]( resource.NewMetadata(NamespaceName, KubernetesRootType, id, resource.VersionUndefined), KubernetesRootSpec{}, ) } -// KubernetesRootRD provides auxiliary methods for KubernetesRoot. -type KubernetesRootRD struct{} +// KubernetesRootExtension provides auxiliary methods for KubernetesRoot. +type KubernetesRootExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (KubernetesRootRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (KubernetesRootExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: KubernetesRootType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/os_root.go b/pkg/machinery/resources/secrets/os_root.go index 33c18123d4..5491cf2a27 100644 --- a/pkg/machinery/resources/secrets/os_root.go +++ b/pkg/machinery/resources/secrets/os_root.go @@ -23,7 +23,7 @@ const OSRootType = resource.Type("OSRootSecrets.secrets.talos.dev") const OSRootID = resource.ID("os") // OSRoot contains root (not generated) secrets. -type OSRoot = typed.Resource[OSRootSpec, OSRootRD] +type OSRoot = typed.Resource[OSRootSpec, OSRootExtension] // OSRootSpec describes operating system CA. // @@ -38,17 +38,17 @@ type OSRootSpec struct { // NewOSRoot initializes a OSRoot resource. func NewOSRoot(id resource.ID) *OSRoot { - return typed.NewResource[OSRootSpec, OSRootRD]( + return typed.NewResource[OSRootSpec, OSRootExtension]( resource.NewMetadata(NamespaceName, OSRootType, id, resource.VersionUndefined), OSRootSpec{}, ) } -// OSRootRD provides auxiliary methods for OSRoot. -type OSRootRD struct{} +// OSRootExtension provides auxiliary methods for OSRoot. +type OSRootExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (OSRootRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (OSRootExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: OSRootType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/secrets/trustd.go b/pkg/machinery/resources/secrets/trustd.go index fd50151201..586c738621 100644 --- a/pkg/machinery/resources/secrets/trustd.go +++ b/pkg/machinery/resources/secrets/trustd.go @@ -21,7 +21,7 @@ const TrustdType = resource.Type("TrustdCertificates.secrets.talos.dev") const TrustdID = resource.ID("trustd") // Trustd contains trustd generated secrets. -type Trustd = typed.Resource[TrustdCertsSpec, TrustdRD] +type Trustd = typed.Resource[TrustdCertsSpec, TrustdExtension] // TrustdCertsSpec describes etcd certs secrets. // @@ -33,17 +33,17 @@ type TrustdCertsSpec struct { // NewTrustd initializes a Trustd resource. func NewTrustd() *Trustd { - return typed.NewResource[TrustdCertsSpec, TrustdRD]( + return typed.NewResource[TrustdCertsSpec, TrustdExtension]( resource.NewMetadata(NamespaceName, TrustdType, TrustdID, resource.VersionUndefined), TrustdCertsSpec{}, ) } -// TrustdRD provides auxiliary methods for Trustd. -type TrustdRD struct{} +// TrustdExtension provides auxiliary methods for Trustd. +type TrustdExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (TrustdRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (TrustdExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: TrustdType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/time/status.go b/pkg/machinery/resources/time/status.go index cc6c42ff3c..7ec5735993 100644 --- a/pkg/machinery/resources/time/status.go +++ b/pkg/machinery/resources/time/status.go @@ -24,7 +24,7 @@ const StatusType = resource.Type("TimeStatuses.v1alpha1.talos.dev") const StatusID = resource.ID("node") // Status describes running current time sync status. -type Status = typed.Resource[StatusSpec, StatusRD] +type Status = typed.Resource[StatusSpec, StatusExtension] // StatusSpec describes time sync state. // @@ -42,17 +42,17 @@ type StatusSpec struct { // NewStatus initializes a TimeSync resource. func NewStatus() *Status { - return typed.NewResource[StatusSpec, StatusRD]( + return typed.NewResource[StatusSpec, StatusExtension]( resource.NewMetadata(v1alpha1.NamespaceName, StatusType, StatusID, resource.VersionUndefined), StatusSpec{}, ) } -// StatusRD provides auxiliary methods for Status. -type StatusRD struct{} +// StatusExtension provides auxiliary methods for Status. +type StatusExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (r StatusRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (StatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: StatusType, Aliases: []resource.Type{}, diff --git a/pkg/machinery/resources/v1alpha1/service.go b/pkg/machinery/resources/v1alpha1/service.go index 23793d906a..79c2570de9 100644 --- a/pkg/machinery/resources/v1alpha1/service.go +++ b/pkg/machinery/resources/v1alpha1/service.go @@ -20,7 +20,7 @@ import ( const ServiceType = resource.Type("Services.v1alpha1.talos.dev") // Service describes running service state. -type Service = typed.Resource[ServiceSpec, ServiceRD] +type Service = typed.Resource[ServiceSpec, ServiceExtension] // ServiceSpec describe service state. // @@ -33,17 +33,17 @@ type ServiceSpec struct { // NewService initializes a Service resource. func NewService(id resource.ID) *Service { - return typed.NewResource[ServiceSpec, ServiceRD]( + return typed.NewResource[ServiceSpec, ServiceExtension]( resource.NewMetadata(NamespaceName, ServiceType, id, resource.VersionUndefined), ServiceSpec{}, ) } -// ServiceRD provides auxiliary methods for Service. -type ServiceRD struct{} +// ServiceExtension provides auxiliary methods for Service. +type ServiceExtension struct{} // ResourceDefinition implements meta.ResourceDefinitionProvider interface. -func (ServiceRD) ResourceDefinition() meta.ResourceDefinitionSpec { +func (ServiceExtension) ResourceDefinition() meta.ResourceDefinitionSpec { return meta.ResourceDefinitionSpec{ Type: ServiceType, Aliases: []resource.Type{"svc"},