forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kube-system-secret-etcd-client-ca-deprecated.go
64 lines (54 loc) · 1.86 KB
/
kube-system-secret-etcd-client-ca-deprecated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package bootkube
import (
"os"
"path/filepath"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/templates/content"
)
const (
kubeSystemSecretEtcdClientCADeprecatedFileName = "kube-system-secret-etcd-client-ca-deprecated.yaml.template"
)
var _ asset.WritableAsset = (*KubeSystemSecretEtcdClientCADeprecated)(nil)
// KubeSystemSecretEtcdClientCADeprecated is the constant to represent contents of kube-system-secret-etcd-client-ca-deprecated.yaml.template file.
type KubeSystemSecretEtcdClientCADeprecated struct {
FileList []*asset.File
}
// Dependencies returns all of the dependencies directly needed by the asset
func (t *KubeSystemSecretEtcdClientCADeprecated) Dependencies() []asset.Asset {
return []asset.Asset{}
}
// Name returns the human-friendly name of the asset.
func (t *KubeSystemSecretEtcdClientCADeprecated) Name() string {
return "KubeSystemSecretEtcdClientCADeprecated"
}
// Generate generates the actual files by this asset
func (t *KubeSystemSecretEtcdClientCADeprecated) Generate(parents asset.Parents) error {
fileName := kubeSystemSecretEtcdClientCADeprecatedFileName
data, err := content.GetBootkubeTemplate(fileName)
if err != nil {
return err
}
t.FileList = []*asset.File{
{
Filename: filepath.Join(content.TemplateDir, fileName),
Data: []byte(data),
},
}
return nil
}
// Files returns the files generated by the asset.
func (t *KubeSystemSecretEtcdClientCADeprecated) Files() []*asset.File {
return t.FileList
}
// Load returns the asset from disk.
func (t *KubeSystemSecretEtcdClientCADeprecated) Load(f asset.FileFetcher) (bool, error) {
file, err := f.FetchByName(filepath.Join(content.TemplateDir, kubeSystemSecretEtcdClientCADeprecatedFileName))
if err != nil {
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
t.FileList = []*asset.File{file}
return true, nil
}