Skip to content

Commit

Permalink
chore: bump cosi-project/runtime
Browse files Browse the repository at this point in the history
And update all `ResourceDefinition` docs and type names. Drop unused functions and names.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
  • Loading branch information
DmitriyMV committed Feb 15, 2023
1 parent da2edb9 commit 0dc6858
Show file tree
Hide file tree
Showing 85 changed files with 464 additions and 475 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/machinery/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/cluster/affiliate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/cluster/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/cluster/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/cluster/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
10 changes: 5 additions & 5 deletions pkg/machinery/resources/cri/seccomp_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/etcd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/etcd/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/etcd/pki_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/etcd/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
10 changes: 5 additions & 5 deletions pkg/machinery/resources/files/etcfile_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{},
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/resources/files/etcfile_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions pkg/machinery/resources/hardware/memorymodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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{
Expand Down
Loading

0 comments on commit 0dc6858

Please sign in to comment.