Skip to content

Commit 153e81b

Browse files
committed
Rename config structure
"KdnConfig" had no meaning. "KfConfig" is better, stands for "Katafygio config".
1 parent db72dbd commit 153e81b

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

cmd/execute.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
Long: "Backup Kubernetes cluster as yaml files in a git repository",
5252

5353
RunE: func(cmd *cobra.Command, args []string) error {
54-
conf := &config.KdnConfig{
54+
conf := &config.KfConfig{
5555
DryRun: viper.GetBool("dry-run"),
5656
Logger: klog.New(viper.GetString("log.level"), viper.GetString("log.server"), viper.GetString("log.output")),
5757
LocalDir: viper.GetString("local-dir"),

config/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"k8s.io/client-go/rest"
1111
)
1212

13-
// KdnConfig is the configuration struct, passed to controllers's Init()
14-
type KdnConfig struct {
13+
// KfConfig is the configuration struct, passed to controllers's Init()
14+
type KfConfig struct {
1515
// When DryRun is true, we display but don't really send notifications
1616
DryRun bool
1717

@@ -44,7 +44,7 @@ type KdnConfig struct {
4444
}
4545

4646
// Init initialize the config
47-
func (c *KdnConfig) Init(apiserver string, kubeconfig string) (err error) {
47+
func (c *KfConfig) Init(apiserver string, kubeconfig string) (err error) {
4848
c.Client, err = client.NewRestConfig(apiserver, kubeconfig)
4949
if err != nil {
5050
return fmt.Errorf("Failed init Kubernetes clientset: %+v", err)

pkg/controller/controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ type Controller struct {
4242
doneCh chan struct{}
4343
evchan chan Event
4444
name string
45-
config *config.KdnConfig
45+
config *config.KfConfig
4646
queue workqueue.RateLimitingInterface
4747
informer cache.SharedIndexInformer
4848
}
4949

5050
// NewController return an untyped, generic Kubernetes controller
51-
func NewController(lw cache.ListerWatcher, evchan chan Event, name string, config *config.KdnConfig) *Controller {
51+
func NewController(lw cache.ListerWatcher, evchan chan Event, name string, config *config.KfConfig) *Controller {
5252
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
5353

5454
informer := cache.NewSharedIndexInformer(

pkg/controller/observer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Observer struct {
2626
disc *discovery.DiscoveryClient
2727
cpool dynamic.ClientPool
2828
ctrls map[string]*Controller
29-
config *config.KdnConfig
29+
config *config.KfConfig
3030
}
3131

3232
type gvk struct {
@@ -40,7 +40,7 @@ type gvk struct {
4040
type resources map[string]*gvk
4141

4242
// NewObserver creates a new observer, to create an manage Kubernetes controllers
43-
func NewObserver(config *config.KdnConfig, evch chan Event) *Observer {
43+
func NewObserver(config *config.KfConfig, evch chan Event) *Observer {
4444
return &Observer{
4545
config: config,
4646
evch: evch,
@@ -164,7 +164,7 @@ func (c *Observer) expandAndFilterAPIResources(groups []*metav1.APIResourceList)
164164
}
165165

166166
// remove lower priorities "cohabitations". cf. kubernetes/cmd/kube-apiserver/app/server.go
167-
// (the api server may expose some resources under various api groups for backward compat...)
167+
// (the api server may expose some resources under several api groups for backward compat...)
168168
for preferred, obsolete := range preferredVersions {
169169
if _, ok := resources[preferred]; ok {
170170
delete(resources, obsolete)

pkg/health/health.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212

1313
// Listener is an http health check listener
1414
type Listener struct {
15-
config *config.KdnConfig
15+
config *config.KfConfig
1616
donech chan struct{}
1717
srv *http.Server
1818
}
1919

2020
// New create a new http health check listener
21-
func New(config *config.KdnConfig) *Listener {
21+
func New(config *config.KfConfig) *Listener {
2222
return &Listener{
2323
config: config,
2424
donech: make(chan struct{}),

pkg/recorder/recorder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type activeFiles map[string]bool
1616

1717
// Listener receive events from controllers and save them to disk as yaml files
1818
type Listener struct {
19-
config *config.KdnConfig
19+
config *config.KfConfig
2020
evchan chan controller.Event
2121
actives activeFiles
2222
activesLock sync.RWMutex
@@ -25,7 +25,7 @@ type Listener struct {
2525
}
2626

2727
// New creates a new Listener
28-
func New(config *config.KdnConfig, evchan chan controller.Event) *Listener {
28+
func New(config *config.KfConfig, evchan chan controller.Event) *Listener {
2929
return &Listener{
3030
config: config,
3131
evchan: evchan,

pkg/run/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
// Run launchs the services
18-
func Run(config *config.KdnConfig) {
18+
func Run(config *config.KfConfig) {
1919
repo, err := git.New(config).Start()
2020
if err != nil {
2121
config.Logger.Fatalf("failed to start git repo handler: %v", err)

pkg/store/git/git.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Store struct {
3434
}
3535

3636
// New instantiate a new Store
37-
func New(config *config.KdnConfig) *Store {
37+
func New(config *config.KfConfig) *Store {
3838
return &Store{
3939
Logger: config.Logger,
4040
URL: config.GitURL,

0 commit comments

Comments
 (0)