summaryrefslogtreecommitdiffstats
path: root/src/rsync/pkg/resource/resource.go
diff options
context:
space:
mode:
authorManjunath Ranganathaiah <manjunath.ranganathaiah@intel.com>2020-06-26 22:22:13 +0000
committerRitu Sood <ritu.sood@intel.com>2020-06-27 20:11:33 -0700
commit8f338f5fb69c509439eb7f9ac7cfe7bd47849f8b (patch)
tree5839a7e861033ec259da8bcf31e496997b6143fe /src/rsync/pkg/resource/resource.go
parent8e446beb55c68314896f16cb3105816cacc05f84 (diff)
Remove config and yaml file creation
Signed-off-by: Manjunath Ranganathaiah <manjunath.ranganathaiah@intel.com> Issue-ID: MULTICLOUD-1005 Change-Id: Iaa8b70f38cf1fc1f89cf2d95fbe37c242fc44f65
Diffstat (limited to 'src/rsync/pkg/resource/resource.go')
-rw-r--r--src/rsync/pkg/resource/resource.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rsync/pkg/resource/resource.go b/src/rsync/pkg/resource/resource.go
index 9d715697..8b45c341 100644
--- a/src/rsync/pkg/resource/resource.go
+++ b/src/rsync/pkg/resource/resource.go
@@ -29,7 +29,7 @@ type Resource struct {
}
// Create deployment object in a specific Kubernetes cluster
-func (r Resource) Create(yamlFilePath string, namespace string, client connector.KubernetesConnector) (string, error) {
+func (r Resource) Create(data string, namespace string, client connector.KubernetesConnector) (string, error) {
if namespace == "" {
namespace = "default"
}
@@ -37,7 +37,7 @@ func (r Resource) Create(yamlFilePath string, namespace string, client connector
//Decode the yaml file to create a runtime.Object
unstruct := &unstructured.Unstructured{}
//Ignore the returned obj as we expect the data in unstruct
- _, err := utils.DecodeYAML(yamlFilePath, unstruct)
+ _, err := utils.DecodeYAMLData(data, unstruct)
if err != nil {
return "", pkgerrors.Wrap(err, "Decode deployment object error")
}
@@ -85,7 +85,7 @@ func (r Resource) Create(yamlFilePath string, namespace string, client connector
}
// Delete an existing resource hosted in a specific Kubernetes cluster
-func (r Resource) Delete(yamlFilePath string, resname string, namespace string, client connector.KubernetesConnector) error {
+func (r Resource) Delete(data string, resname string, namespace string, client connector.KubernetesConnector) error {
if namespace == "" {
namespace = "default"
}
@@ -93,7 +93,7 @@ func (r Resource) Delete(yamlFilePath string, resname string, namespace string,
//Decode the yaml file to create a runtime.Object
unstruct := &unstructured.Unstructured{}
//Ignore the returned obj as we expect the data in unstruct
- _, err := utils.DecodeYAML(yamlFilePath, unstruct)
+ _, err := utils.DecodeYAMLData(data, unstruct)
if err != nil {
return pkgerrors.Wrap(err, "Decode deployment object error")
}