Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: generic resources #681

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -582,13 +581,10 @@ func (qjm *XController) getAppWrapperCompletionStatus(caw *arbv1.AppWrapper) arb
for i, genericItem := range caw.Spec.AggrResources.GenericItems {
if len(genericItem.CompletionStatus) > 0 {
objectName := genericItem.GenericTemplate
var unstruct unstructured.Unstructured
unstruct.Object = make(map[string]interface{})
var blob interface{}
if err := jsons.Unmarshal(objectName.Raw, &blob); err != nil {
klog.Errorf("[getAppWrapperCompletionStatus] Error unmarshalling, err=%#v", err)
unstruct, err := genericresource.UnmarshalToUnstructured(objectName.Raw)
if err != nil {
klog.Errorf("[getAppWrapperCompletionStatus] Error unmarshalling appwrapper: %v", caw.Name)
}
unstruct.Object = blob.(map[string]interface{}) // set object to the content of the blob after Unmarshalling
name := ""
if md, ok := unstruct.Object["metadata"]; ok {
metadata := md.(map[string]interface{})
Expand Down
Loading
Loading