Skip to content

Commit

Permalink
Remove AppWrapper CRD creation from controller
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Aug 4, 2023
1 parent 221f1ad commit 5951c13
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 107 deletions.
87 changes: 0 additions & 87 deletions pkg/client/queuejob.go

This file was deleted.

5 changes: 1 addition & 4 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,11 +1406,8 @@ func (qjm *XController) backoff(ctx context.Context, q *arbv1.AppWrapper, reason
qjm.serverOption.BackoffTime, qjm.qjqueue.IfExistActiveQ(q), qjm.qjqueue.IfExistUnschedulableQ(q), q, q.ResourceVersion, q.Status)
}

// Run start AppWrapper Controller
// Run starts AppWrapper Controller
func (cc *XController) Run(stopCh chan struct{}) {
// initialized
createAppWrapperKind(cc.config)

go cc.appwrapperInformer.Informer().Run(stopCh)

go cc.qjobResControls[arbv1.ResourceTypePod].Run(stopCh)
Expand Down
16 changes: 0 additions & 16 deletions pkg/controller/queuejob/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ package queuejob

import (
corev1 "k8s.io/api/core/v1"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"

arbv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client"
)

func GetXQJFullName(qj *arbv1.AppWrapper) string {
Expand All @@ -37,18 +33,6 @@ func HigherSystemPriorityQJ(qj1, qj2 interface{}) bool {
return qj1.(*arbv1.AppWrapper).Status.SystemPriority > qj2.(*arbv1.AppWrapper).Status.SystemPriority
}

func createAppWrapperKind(config *rest.Config) error {
extensionscs, err := apiextensionsclient.NewForConfig(config)
if err != nil {
return err
}
_, err = client.CreateAppWrapperKind(extensionscs)
if err != nil && !apierrors.IsAlreadyExists(err) {
return err
}
return nil
}

// GenerateAppWrapperCondition returns condition of a AppWrapper condition.
func GenerateAppWrapperCondition(condType arbv1.AppWrapperConditionType, condStatus corev1.ConditionStatus, condReason string, condMsg string) arbv1.AppWrapperCondition {
return arbv1.AppWrapperCondition{
Expand Down

0 comments on commit 5951c13

Please sign in to comment.