resources: Unify resource creation and kind setting
This removes the duplication of the kind string and cleans up things for resource creation.
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
package resources
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
@@ -34,7 +33,6 @@ import (
|
||||
|
||||
func init() {
|
||||
RegisterResource("svc", func() Res { return &SvcRes{} })
|
||||
gob.Register(&SvcRes{})
|
||||
}
|
||||
|
||||
// SvcRes is a service resource for systemd units.
|
||||
@@ -67,7 +65,6 @@ func (obj *SvcRes) Validate() error {
|
||||
|
||||
// Init runs some startup code for this resource.
|
||||
func (obj *SvcRes) Init() error {
|
||||
obj.BaseRes.Kind = "svc"
|
||||
return obj.BaseRes.Init() // call base init, b/c we're overriding
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user