From 03b9006c6ae6442ac7e42aab558d5aba79a48e8d Mon Sep 17 00:00:00 2001 From: staebler Date: Wed, 12 Dec 2018 16:02:14 -0500 Subject: [PATCH] asset/templates: remove fileName field The fileName field is not needed. The template assets do not need to store this information. This change is part of work that is on-going to add tests to ensure that targeted assets are not assessed as dirty when read back in without being modified. The problem with the fileName field is that it is not set when the asset is loaded from the state file or from on-disk. This causes road-trip tests that compare a generated asset to a read asset to fail. --- .../bootkube/04-openshift-machine-config-operator.go | 7 +++---- .../content/bootkube/05-openshift-cluster-api-namespace.go | 7 +++---- .../bootkube/09-openshift-service-cert-signer-namespace.go | 7 +++---- pkg/asset/templates/content/bootkube/cvo-overrides.go | 7 +++---- pkg/asset/templates/content/bootkube/etcd-service.go | 7 +++---- .../content/bootkube/host-etcd-service-endpoints.go | 7 +++---- pkg/asset/templates/content/bootkube/host-etcd-service.go | 7 +++---- pkg/asset/templates/content/bootkube/kube-cloud-config.go | 7 +++---- .../bootkube/kube-system-configmap-etcd-serving-ca.go | 7 +++---- .../content/bootkube/kube-system-configmap-root-ca.go | 7 +++---- .../content/bootkube/kube-system-secret-etcd-client.go | 7 +++---- .../content/bootkube/machine-config-server-tls-secret.go | 7 +++---- .../bootkube/openshift-service-cert-signer-ca-secret.go | 7 +++---- pkg/asset/templates/content/bootkube/pull.go | 7 +++---- pkg/asset/templates/content/openshift/binding-discovery.go | 7 +++---- .../templates/content/openshift/cloud-creds-secret.go | 7 +++---- .../content/openshift/kubeadmin-password-secret.go | 7 +++---- .../content/openshift/role-cloud-creds-secret-reader.go | 7 +++---- 18 files changed, 54 insertions(+), 72 deletions(-) diff --git a/pkg/asset/templates/content/bootkube/04-openshift-machine-config-operator.go b/pkg/asset/templates/content/bootkube/04-openshift-machine-config-operator.go index 3b5676ddc52..a304ec5b835 100644 --- a/pkg/asset/templates/content/bootkube/04-openshift-machine-config-operator.go +++ b/pkg/asset/templates/content/bootkube/04-openshift-machine-config-operator.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*OpenshiftMachineConfigOperator)(nil) // OpenshiftMachineConfigOperator is the constant to represent contents of Openshift_MachineConfigOperator.yaml file type OpenshiftMachineConfigOperator struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *OpenshiftMachineConfigOperator) Name() string { // Generate generates the actual files by this asset func (t *OpenshiftMachineConfigOperator) Generate(parents asset.Parents) error { - t.fileName = openshiftMachineConfigOperatorFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := openshiftMachineConfigOperatorFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/05-openshift-cluster-api-namespace.go b/pkg/asset/templates/content/bootkube/05-openshift-cluster-api-namespace.go index ff83d97094f..117245e5f11 100644 --- a/pkg/asset/templates/content/bootkube/05-openshift-cluster-api-namespace.go +++ b/pkg/asset/templates/content/bootkube/05-openshift-cluster-api-namespace.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*OpenshiftClusterAPINamespace)(nil) // OpenshiftClusterAPINamespace is the constant to represent contents of Openshift_ClusterApiNamespace.yaml file type OpenshiftClusterAPINamespace struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *OpenshiftClusterAPINamespace) Name() string { // Generate generates the actual files by this asset func (t *OpenshiftClusterAPINamespace) Generate(parents asset.Parents) error { - t.fileName = openshiftClusterAPINamespaceFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := openshiftClusterAPINamespaceFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/09-openshift-service-cert-signer-namespace.go b/pkg/asset/templates/content/bootkube/09-openshift-service-cert-signer-namespace.go index a5d9650846b..f5941e923f6 100644 --- a/pkg/asset/templates/content/bootkube/09-openshift-service-cert-signer-namespace.go +++ b/pkg/asset/templates/content/bootkube/09-openshift-service-cert-signer-namespace.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*OpenshiftServiceCertSignerNamespace)(nil) // OpenshiftServiceCertSignerNamespace is the constant to represent the contents of 09-openshift-service-signer-namespace.yaml type OpenshiftServiceCertSignerNamespace struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *OpenshiftServiceCertSignerNamespace) Name() string { // Generate generates the actual files by this asset func (t *OpenshiftServiceCertSignerNamespace) Generate(parents asset.Parents) error { - t.fileName = openshiftServiceCertSignerNamespaceFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := openshiftServiceCertSignerNamespaceFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/cvo-overrides.go b/pkg/asset/templates/content/bootkube/cvo-overrides.go index f331ba39032..a65ba274cf5 100644 --- a/pkg/asset/templates/content/bootkube/cvo-overrides.go +++ b/pkg/asset/templates/content/bootkube/cvo-overrides.go @@ -19,7 +19,6 @@ var _ asset.WritableAsset = (*CVOOverrides)(nil) // with resources already owned by other operators. // This files can be dropped when the overrides list becomes empty. type CVOOverrides struct { - fileName string FileList []*asset.File } @@ -35,14 +34,14 @@ func (t *CVOOverrides) Name() string { // Generate generates the actual files by this asset func (t *CVOOverrides) Generate(parents asset.Parents) error { - t.fileName = cVOOverridesFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := cVOOverridesFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/etcd-service.go b/pkg/asset/templates/content/bootkube/etcd-service.go index 90fdcdae699..6200c04789e 100644 --- a/pkg/asset/templates/content/bootkube/etcd-service.go +++ b/pkg/asset/templates/content/bootkube/etcd-service.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*EtcdServiceKubeSystem)(nil) // EtcdServiceKubeSystem is the constant to represent contents of etcd-service.yaml file type EtcdServiceKubeSystem struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *EtcdServiceKubeSystem) Name() string { // Generate generates the actual files by this asset func (t *EtcdServiceKubeSystem) Generate(parents asset.Parents) error { - t.fileName = etcdServiceKubeSystemFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := etcdServiceKubeSystemFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/host-etcd-service-endpoints.go b/pkg/asset/templates/content/bootkube/host-etcd-service-endpoints.go index e7d56072bf0..30f9b663e19 100644 --- a/pkg/asset/templates/content/bootkube/host-etcd-service-endpoints.go +++ b/pkg/asset/templates/content/bootkube/host-etcd-service-endpoints.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*HostEtcdServiceEndpointsKubeSystem)(nil) // HostEtcdServiceEndpointsKubeSystem is the constant to represent contents of etcd-service-endpoints.yaml.template file. type HostEtcdServiceEndpointsKubeSystem struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *HostEtcdServiceEndpointsKubeSystem) Name() string { // Generate generates the actual files by this asset func (t *HostEtcdServiceEndpointsKubeSystem) Generate(parents asset.Parents) error { - t.fileName = hostEtcdServiceEndpointsKubeSystemFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := hostEtcdServiceEndpointsKubeSystemFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/host-etcd-service.go b/pkg/asset/templates/content/bootkube/host-etcd-service.go index 95b3eac7af7..a1840f62c2b 100644 --- a/pkg/asset/templates/content/bootkube/host-etcd-service.go +++ b/pkg/asset/templates/content/bootkube/host-etcd-service.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*HostEtcdServiceKubeSystem)(nil) // HostEtcdServiceKubeSystem is the constant to represent contents of etcd-service.yaml file type HostEtcdServiceKubeSystem struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *HostEtcdServiceKubeSystem) Name() string { // Generate generates the actual files by this asset func (t *HostEtcdServiceKubeSystem) Generate(parents asset.Parents) error { - t.fileName = hostEtcdServiceKubeSystemFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := hostEtcdServiceKubeSystemFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/kube-cloud-config.go b/pkg/asset/templates/content/bootkube/kube-cloud-config.go index 1b5e649e486..59c097a5191 100644 --- a/pkg/asset/templates/content/bootkube/kube-cloud-config.go +++ b/pkg/asset/templates/content/bootkube/kube-cloud-config.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*KubeCloudConfig)(nil) // KubeCloudConfig is the constant to represent contents of kube_cloudconfig.yaml file type KubeCloudConfig struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *KubeCloudConfig) Name() string { // Generate generates the actual files by this asset func (t *KubeCloudConfig) Generate(parents asset.Parents) error { - t.fileName = kubeCloudConfigFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := kubeCloudConfigFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/kube-system-configmap-etcd-serving-ca.go b/pkg/asset/templates/content/bootkube/kube-system-configmap-etcd-serving-ca.go index 0d152ddba95..b578a0663b2 100644 --- a/pkg/asset/templates/content/bootkube/kube-system-configmap-etcd-serving-ca.go +++ b/pkg/asset/templates/content/bootkube/kube-system-configmap-etcd-serving-ca.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*KubeSystemConfigmapEtcdServingCA)(nil) // KubeSystemConfigmapEtcdServingCA is the constant to represent contents of kube-system-configmap-etcd-serving-ca.yaml.template file. type KubeSystemConfigmapEtcdServingCA struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *KubeSystemConfigmapEtcdServingCA) Name() string { // Generate generates the actual files by this asset func (t *KubeSystemConfigmapEtcdServingCA) Generate(parents asset.Parents) error { - t.fileName = kubeSystemConfigmapEtcdServingCAFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := kubeSystemConfigmapEtcdServingCAFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/kube-system-configmap-root-ca.go b/pkg/asset/templates/content/bootkube/kube-system-configmap-root-ca.go index 99a5b70a751..765961c36c8 100644 --- a/pkg/asset/templates/content/bootkube/kube-system-configmap-root-ca.go +++ b/pkg/asset/templates/content/bootkube/kube-system-configmap-root-ca.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*KubeSystemConfigmapRootCA)(nil) // KubeSystemConfigmapRootCA is the constant to represent contents of kube-system-configmap-root-ca.yaml.template file. type KubeSystemConfigmapRootCA struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *KubeSystemConfigmapRootCA) Name() string { // Generate generates the actual files by this asset func (t *KubeSystemConfigmapRootCA) Generate(parents asset.Parents) error { - t.fileName = kubeSystemConfigmapRootCAFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := kubeSystemConfigmapRootCAFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/kube-system-secret-etcd-client.go b/pkg/asset/templates/content/bootkube/kube-system-secret-etcd-client.go index 3ba3af00f4e..994d4b92f78 100644 --- a/pkg/asset/templates/content/bootkube/kube-system-secret-etcd-client.go +++ b/pkg/asset/templates/content/bootkube/kube-system-secret-etcd-client.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*KubeSystemSecretEtcdClient)(nil) // KubeSystemSecretEtcdClient is the constant to represent contents of kube-system-secret-etcd-client.yaml.template file. type KubeSystemSecretEtcdClient struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *KubeSystemSecretEtcdClient) Name() string { // Generate generates the actual files by this asset func (t *KubeSystemSecretEtcdClient) Generate(parents asset.Parents) error { - t.fileName = kubeSystemSecretEtcdClientFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := kubeSystemSecretEtcdClientFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/machine-config-server-tls-secret.go b/pkg/asset/templates/content/bootkube/machine-config-server-tls-secret.go index f5403bbdd6e..2246609fe4c 100644 --- a/pkg/asset/templates/content/bootkube/machine-config-server-tls-secret.go +++ b/pkg/asset/templates/content/bootkube/machine-config-server-tls-secret.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*MachineConfigServerTLSSecret)(nil) // MachineConfigServerTLSSecret is the constant to represent contents of machine_configservertlssecret.yaml.template file type MachineConfigServerTLSSecret struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *MachineConfigServerTLSSecret) Name() string { // Generate generates the actual files by this asset func (t *MachineConfigServerTLSSecret) Generate(parents asset.Parents) error { - t.fileName = machineConfigServerTLSSecretFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := machineConfigServerTLSSecretFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/openshift-service-cert-signer-ca-secret.go b/pkg/asset/templates/content/bootkube/openshift-service-cert-signer-ca-secret.go index ac84b473ddf..ea412ce1cd5 100644 --- a/pkg/asset/templates/content/bootkube/openshift-service-cert-signer-ca-secret.go +++ b/pkg/asset/templates/content/bootkube/openshift-service-cert-signer-ca-secret.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*OpenshiftServiceCertSignerSecret)(nil) // OpenshiftServiceCertSignerSecret is the constant to represent the contents of openshift-service-signer-secret.yaml.template type OpenshiftServiceCertSignerSecret struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *OpenshiftServiceCertSignerSecret) Name() string { // Generate generates the actual files by this asset func (t *OpenshiftServiceCertSignerSecret) Generate(parents asset.Parents) error { - t.fileName = openshiftServiceCertSignerSecretFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := openshiftServiceCertSignerSecretFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/bootkube/pull.go b/pkg/asset/templates/content/bootkube/pull.go index 02c5701bc2c..ba6627b032e 100644 --- a/pkg/asset/templates/content/bootkube/pull.go +++ b/pkg/asset/templates/content/bootkube/pull.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*Pull)(nil) // Pull is the constant to represent contents of pull.yaml.template file type Pull struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *Pull) Name() string { // Generate generates the actual files by this asset func (t *Pull) Generate(parents asset.Parents) error { - t.fileName = pullFileName - data, err := content.GetBootkubeTemplate(t.fileName) + fileName := pullFileName + data, err := content.GetBootkubeTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/openshift/binding-discovery.go b/pkg/asset/templates/content/openshift/binding-discovery.go index 1a5efcf2ccc..d6c8941bd12 100644 --- a/pkg/asset/templates/content/openshift/binding-discovery.go +++ b/pkg/asset/templates/content/openshift/binding-discovery.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*BindingDiscovery)(nil) // BindingDiscovery is the variable/constant representing the contents of the respective file type BindingDiscovery struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *BindingDiscovery) Name() string { // Generate generates the actual files by this asset func (t *BindingDiscovery) Generate(parents asset.Parents) error { - t.fileName = bindingDiscoveryFileName - data, err := content.GetOpenshiftTemplate(t.fileName) + fileName := bindingDiscoveryFileName + data, err := content.GetOpenshiftTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/openshift/cloud-creds-secret.go b/pkg/asset/templates/content/openshift/cloud-creds-secret.go index 0fde33ccfad..f2f661137b3 100644 --- a/pkg/asset/templates/content/openshift/cloud-creds-secret.go +++ b/pkg/asset/templates/content/openshift/cloud-creds-secret.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*CloudCredsSecret)(nil) // CloudCredsSecret is the constant to represent contents of corresponding yaml file type CloudCredsSecret struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *CloudCredsSecret) Name() string { // Generate generates the actual files by this asset func (t *CloudCredsSecret) Generate(parents asset.Parents) error { - t.fileName = cloudCredsSecretFileName - data, err := content.GetOpenshiftTemplate(t.fileName) + fileName := cloudCredsSecretFileName + data, err := content.GetOpenshiftTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/openshift/kubeadmin-password-secret.go b/pkg/asset/templates/content/openshift/kubeadmin-password-secret.go index aeedb196826..a132823fd12 100644 --- a/pkg/asset/templates/content/openshift/kubeadmin-password-secret.go +++ b/pkg/asset/templates/content/openshift/kubeadmin-password-secret.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*KubeadminPasswordSecret)(nil) // KubeadminPasswordSecret is the constant to represent contents of kubeadmin-password-secret.yaml.template file type KubeadminPasswordSecret struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *KubeadminPasswordSecret) Name() string { // Generate generates the actual files by this asset func (t *KubeadminPasswordSecret) Generate(parents asset.Parents) error { - t.fileName = kubeadminPasswordSecretFileName - data, err := content.GetOpenshiftTemplate(t.fileName) + fileName := kubeadminPasswordSecretFileName + data, err := content.GetOpenshiftTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, } diff --git a/pkg/asset/templates/content/openshift/role-cloud-creds-secret-reader.go b/pkg/asset/templates/content/openshift/role-cloud-creds-secret-reader.go index 127b0414307..fbd35e31d36 100644 --- a/pkg/asset/templates/content/openshift/role-cloud-creds-secret-reader.go +++ b/pkg/asset/templates/content/openshift/role-cloud-creds-secret-reader.go @@ -16,7 +16,6 @@ var _ asset.WritableAsset = (*RoleCloudCredsSecretReader)(nil) // RoleCloudCredsSecretReader is the variable to represent contents of corresponding file type RoleCloudCredsSecretReader struct { - fileName string FileList []*asset.File } @@ -32,14 +31,14 @@ func (t *RoleCloudCredsSecretReader) Name() string { // Generate generates the actual files by this asset func (t *RoleCloudCredsSecretReader) Generate(parents asset.Parents) error { - t.fileName = roleCloudCredsSecretReaderFileName - data, err := content.GetOpenshiftTemplate(t.fileName) + fileName := roleCloudCredsSecretReaderFileName + data, err := content.GetOpenshiftTemplate(fileName) if err != nil { return err } t.FileList = []*asset.File{ { - Filename: filepath.Join(content.TemplateDir, t.fileName), + Filename: filepath.Join(content.TemplateDir, fileName), Data: []byte(data), }, }