diff options
author | Ritu Sood <Ritu.Sood@intel.com> | 2020-07-17 23:34:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-17 23:34:28 +0000 |
commit | 1e6e473f20fd4a5b87115120344fa4e7363b8a76 (patch) | |
tree | 63e7f2a3107d806efc49e993b48339238fdbb09e /src/orchestrator/pkg/module/instantiation_appcontext_helper.go | |
parent | 38d8eead7c9a62cc25feaccb3cf1f241c3b96967 (diff) | |
parent | 97c6ca4bfdfa4f5e367649ebf6a4e2c583e2cb78 (diff) |
Merge "Move status tracking CR to rsync"
Diffstat (limited to 'src/orchestrator/pkg/module/instantiation_appcontext_helper.go')
-rw-r--r-- | src/orchestrator/pkg/module/instantiation_appcontext_helper.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/orchestrator/pkg/module/instantiation_appcontext_helper.go b/src/orchestrator/pkg/module/instantiation_appcontext_helper.go index a8c6eda7..9ace81b6 100644 --- a/src/orchestrator/pkg/module/instantiation_appcontext_helper.go +++ b/src/orchestrator/pkg/module/instantiation_appcontext_helper.go @@ -25,16 +25,12 @@ import ( "encoding/json" "io/ioutil" - jyaml "github.com/ghodss/yaml" - - rb "github.com/onap/multicloud-k8s/src/monitor/pkg/apis/k8splugin/v1alpha1" "github.com/onap/multicloud-k8s/src/orchestrator/pkg/appcontext" gpic "github.com/onap/multicloud-k8s/src/orchestrator/pkg/gpic" log "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/logutils" "github.com/onap/multicloud-k8s/src/orchestrator/utils" "github.com/onap/multicloud-k8s/src/orchestrator/utils/helm" pkgerrors "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // resource consists of name of reource @@ -99,45 +95,6 @@ func getResources(st []helm.KubernetesResourceTemplate) ([]resource, error) { return resources, nil } -// addStatusResource adds a status monitoring resource to the app -// which consists of name(name+kind) and content -func getStatusResource(id, app string) (resource, error) { - - var statusCr rb.ResourceBundleState - - label := id + "-" + app - name := app + "-" + id - - statusCr.TypeMeta.APIVersion = "k8splugin.io/v1alpha1" - statusCr.TypeMeta.Kind = "ResourceBundleState" - statusCr.SetName(name) - - labels := make(map[string]string) - labels["emco/deployment-id"] = label - statusCr.SetLabels(labels) - - labelSelector, err := metav1.ParseToLabelSelector("emco/deployment-id = " + label) - if err != nil { - log.Info(":: ERROR Parsing Label Selector ::", log.Fields{"Error": err}) - } else { - statusCr.Spec.Selector = labelSelector - } - - // Marshaling to json then convert to yaml works better than marshaling to yaml - // The 'apiVersion' attribute was marshaling to 'apiversion' - // y, _ := yaml.Marshal(&statusCr) - j, _ := json.Marshal(&statusCr) - y, _ := jyaml.JSONToYAML(j) - log.Info(":: RESULTING STATUS CR ::", log.Fields{"StatusCR": y}) - - statusResource := resource{ - name: name + "+" + "ResourceBundleState", - filecontent: string(y), - } - - return statusResource, nil -} - func addResourcesToCluster(ct appcontext.AppContext, ch interface{}, resources []resource) error { var resOrderInstr struct { |