diff --git a/experiments/compositions/composition/api/v1alpha1/expanderversion_types.go b/experiments/compositions/composition/api/v1alpha1/expanderversion_types.go index 7fd5840806f..b3b41021462 100644 --- a/experiments/compositions/composition/api/v1alpha1/expanderversion_types.go +++ b/experiments/compositions/composition/api/v1alpha1/expanderversion_types.go @@ -38,12 +38,12 @@ const ( // ExpanderVersionSpec defines the desired state of ExpanderVersion type ExpanderVersionSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - // ImageRegistry is the designated registry for where to pull the named expander image ImageRegistry string `json:"imageRegistry,omitempty"` + // Image if different from removePrefix(expanderversion.name , "composition-") + Image string `json:"image,omitempty"` + // ValidVersions is a list of valid versions of the named expander ValidVersions []string `json:"validVersions"` diff --git a/experiments/compositions/composition/api/v1alpha1/plan_types.go b/experiments/compositions/composition/api/v1alpha1/plan_types.go index dee49fac7f9..1b65e24fb5f 100644 --- a/experiments/compositions/composition/api/v1alpha1/plan_types.go +++ b/experiments/compositions/composition/api/v1alpha1/plan_types.go @@ -40,6 +40,10 @@ type StageStatus struct { // PlanStatus defines the observed state of Plan type PlanStatus struct { + // Facade's generation last we successfully reconciled + InputGeneration int64 `json:"inputGeneration,omitempty"` + // Plan generation we last successfully reconciled + Generation int64 `json:"generation,omitempty"` Conditions []metav1.Condition `json:"conditions,omitempty"` Stages map[string]StageStatus `json:"stages,omitempty"` } diff --git a/experiments/compositions/composition/config/crd/bases/composition.google.com_expanderversions.yaml b/experiments/compositions/composition/config/crd/bases/composition.google.com_expanderversions.yaml index 1e5267681a1..4d45b3162db 100644 --- a/experiments/compositions/composition/config/crd/bases/composition.google.com_expanderversions.yaml +++ b/experiments/compositions/composition/config/crd/bases/composition.google.com_expanderversions.yaml @@ -53,6 +53,10 @@ spec: spec: description: ExpanderVersionSpec defines the desired state of ExpanderVersion properties: + image: + description: Image if different from removePrefix(expanderversion.name + , "composition-") + type: string imageRegistry: description: ImageRegistry is the designated registry for where to pull the named expander image diff --git a/experiments/compositions/composition/config/crd/bases/composition.google.com_plans.yaml b/experiments/compositions/composition/config/crd/bases/composition.google.com_plans.yaml index 5cbe33fd998..027c771f530 100644 --- a/experiments/compositions/composition/config/crd/bases/composition.google.com_plans.yaml +++ b/experiments/compositions/composition/config/crd/bases/composition.google.com_plans.yaml @@ -135,6 +135,14 @@ spec: - type type: object type: array + generation: + description: Plan generation we last successfully reconciled + format: int64 + type: integer + inputGeneration: + description: Facade's generation last we successfully reconciled + format: int64 + type: integer stages: additionalProperties: description: StageStatus captures the status of a stage diff --git a/experiments/compositions/composition/config/expanders/expander_versions.yaml b/experiments/compositions/composition/config/expanders/expander_versions.yaml index 511f3c107c4..1af9a4f4d2e 100644 --- a/experiments/compositions/composition/config/expanders/expander_versions.yaml +++ b/experiments/compositions/composition/config/expanders/expander_versions.yaml @@ -15,11 +15,12 @@ apiVersion: composition.google.com/v1alpha1 kind: ExpanderVersion metadata: - name: jinja2 + name: pjinja2 namespace: system spec: type: job imageRegistry: gcr.io/krmapihosting-release + image: expander-jinja2 validVersions: # current golang semver package only support version comparison # in the format of `v{num}.{num}.{num}-{alphabet}`, `v{num}.{num}.{num}` and `{num}.{num}.{num}`. @@ -30,7 +31,7 @@ spec: apiVersion: composition.google.com/v1alpha1 kind: ExpanderVersion metadata: - name: gjinja2 + name: jinja2 namespace: system spec: type: grpc diff --git a/experiments/compositions/composition/config/expanders/jinja2-v0.0.1.yaml b/experiments/compositions/composition/config/expanders/jinja2-v0.0.1.yaml index fdce571dd44..e4069866a50 100644 --- a/experiments/compositions/composition/config/expanders/jinja2-v0.0.1.yaml +++ b/experiments/compositions/composition/config/expanders/jinja2-v0.0.1.yaml @@ -101,7 +101,7 @@ metadata: app.kubernetes.io/part-of: composition app.kubernetes.io/instance: jinja2-v0.0.1 app.kubernetes.io/component: expanders - name: gjinja2-v0-0-1 + name: jinja2-v0-0-1 namespace: system spec: # type: LoadBalancer diff --git a/experiments/compositions/composition/expanders.mk b/experiments/compositions/composition/expanders.mk index 3a33be8485e..47037ec836c 100644 --- a/experiments/compositions/composition/expanders.mk +++ b/experiments/compositions/composition/expanders.mk @@ -59,8 +59,8 @@ docker-run-expander-jinja2: docker-build-expander-jinja2 .PHONY: unit-test-expander-jinja2 unit-test-expander-jinja2: deploy-kind - kubectl patch service -n composition-system composition-gjinja2-v0-0-1 -p '{"spec":{"type":"LoadBalancer"}}' + kubectl patch service -n composition-system composition-jinja2-v0-0-1 -p '{"spec":{"type":"LoadBalancer"}}' nodeip=$$(kubectl get nodes -o json | jq '.items[0].status.addresses[0].address' | xargs echo );\ - nodeport=$$(kubectl get service -n composition-system composition-gjinja2-v0-0-1 -o json | jq ".spec.ports[0].nodePort");\ + nodeport=$$(kubectl get service -n composition-system composition-jinja2-v0-0-1 -o json | jq ".spec.ports[0].nodePort");\ echo $$nodeip:$$nodeport; \ cd expanders/jinja2 && go test -v --addr=$$nodeip:$$nodeport \ No newline at end of file diff --git a/experiments/compositions/composition/internal/controller/expander_reconciler.go b/experiments/compositions/composition/internal/controller/expander_reconciler.go index 93914968976..bf31f114afd 100644 --- a/experiments/compositions/composition/internal/controller/expander_reconciler.go +++ b/experiments/compositions/composition/internal/controller/expander_reconciler.go @@ -20,8 +20,10 @@ import ( "fmt" "strconv" "strings" + "time" "github.com/go-logr/logr" + "golang.org/x/time/rate" compositionv1alpha1 "google.com/composition/api/v1alpha1" "google.com/composition/pkg/containerexecutor/jobcontainerexecutor" pb "google.com/composition/proto" @@ -38,8 +40,10 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" + "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -201,6 +205,7 @@ func (r *ExpanderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c logger.Info("Got valid expander value", "value", value) success := false + planUpdated := false if ev.Spec.Type == compositionv1alpha1.ExpanderTypeJob { reason, err := r.runJob(ctx, logger, &inputcr, expander.Name, planNN.Name, value, ev.Spec.ImageRegistry) if err != nil { @@ -208,11 +213,12 @@ func (r *ExpanderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c return ctrl.Result{}, err } } else { - reason, err := r.evaluateAndSavePlan(ctx, logger, &inputcr, expander, planNN, value) + updated, reason, err := r.evaluateAndSavePlan(ctx, logger, &inputcr, expander, planNN, value) if err != nil { newStatus.AppendErrorCondition(expander.Name, err.Error(), reason) return ctrl.Result{}, err } + planUpdated = updated } // ------------------- APPLIER SECTION ----------------------- @@ -220,11 +226,16 @@ func (r *ExpanderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c // Create Applier and wait for the Applier to complete logger = loggerCR.WithName(expander.Name).WithName("Apply") + oldGeneration := plancr.GetGeneration() // Re-read the Plan CR to load the expanded manifests if err := r.Client.Get(ctx, planNN, &plancr); err != nil { logger.Error(err, "unable to read Plan CR") return ctrl.Result{}, err } + if planUpdated && oldGeneration == plancr.GetGeneration() { + logger.Error(err, "Did not get the latest planCR. Will retry.") + return ctrl.Result{RequeueAfter: 5 * time.Second}, nil + } applier := NewApplier(ctx, logger, r, &plancr, &inputcr, &compositionCR, expander.Name) @@ -291,23 +302,11 @@ func (r *ExpanderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c newStatus.ClearCondition(compositionv1alpha1.Ready) message := fmt.Sprintf("Processed stages: %s", strings.Join(expandersProcessed, ", ")) newStatus.AppendCondition(compositionv1alpha1.Ready, metav1.ConditionTrue, message, "ProcessedAllStages") + newStatus.InputGeneration = inputcr.GetGeneration() + newStatus.Generation = plancr.GetGeneration() return ctrl.Result{}, nil } -// SetupWithManager sets up the controller with the Manager. -func (r *ExpanderReconciler) SetupWithManager(mgr ctrl.Manager, cr *unstructured.Unstructured) error { - var err error - // TODO(barni@): Can we setup dynamic controller at main.go for CompositionReconciler instead of 1 per ExpanderReconciler - r.Dynamic, err = dynamic.NewForConfig(r.Config) - if err != nil { - return fmt.Errorf("error building dynamic client: %w", err) - } - - return ctrl.NewControllerManagedBy(mgr). - For(cr). - Complete(r) -} - func (r *ExpanderReconciler) getExpanderValue( ctx context.Context, inputExpanderVersion string, expanderType string, ) (string, *compositionv1alpha1.ExpanderVersion, string, error) { @@ -381,12 +380,14 @@ func (r *ExpanderReconciler) runJob(ctx context.Context, logger logr.Logger, func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger logr.Logger, cr *unstructured.Unstructured, expander compositionv1alpha1.Expander, - planNN types.NamespacedName, grpcService string) (string, error) { + planNN types.NamespacedName, grpcService string) (bool, string, error) { // Set up a connection to the server. + updated := false + conn, err := grpc.Dial(grpcService, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { logger.Error(err, "grpc dial failed: "+grpcService) - return "GRPCConnError", err + return updated, "GRPCConnError", err } // read context in cr.namespace @@ -395,26 +396,26 @@ func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger log contextNN := types.NamespacedName{Namespace: cr.GetNamespace(), Name: "context"} if err := r.Get(ctx, contextNN, &contextcr); err != nil { logger.Error(err, "unable to fetch Context CR", "context", contextNN) - return "GetContextFailed", err + return updated, "GetContextFailed", err } contextBytes, err := json.Marshal(contextcr.Object) if err != nil { logger.Error(err, "failed to marshal Context Object") - return "MarshallContextFailed", err + return updated, "MarshallContextFailed", err } // marshall facade cr facadeBytes, err := json.Marshal(cr.Object) if err != nil { logger.Error(err, "failed to marshall Facade Object") - return "MarshallFacadeFailed", err + return updated, "MarshallFacadeFailed", err } // marshall expande config configBytes, err := json.Marshal(expander.Template) if err != nil { logger.Error(err, "failed to marshall Expander Config") - return "MarshallExpanderConfigFailed", err + return updated, "MarshallExpanderConfigFailed", err } expanderClient := pb.NewExpanderClient(conn) @@ -429,12 +430,12 @@ func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger log }) if err != nil { logger.Error(err, "expander.Evaluate() Failed", "expander", expander.Name) - return "EvaluateError", err + return updated, "EvaluateError", err } if result.Status != pb.Status_SUCCESS { logger.Error(nil, "expander.Evaluate() Status is not Success", "expander", expander.Name, "status", result.Status) err = fmt.Errorf("Evaluate Failed: %s", result.Error.Message) - return "EvaluateStatusFailed", err + return updated, "EvaluateStatusFailed", err } // Write to Plan object @@ -442,17 +443,25 @@ func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger log plancr := compositionv1alpha1.Plan{} if err := r.Client.Get(ctx, planNN, &plancr); err != nil { logger.Error(err, "unable to read Plan CR", "plan", planNN) - return "GetPlanFailed", err + return updated, "GetPlanFailed", err } if plancr.Spec.Stages == nil { plancr.Spec.Stages = map[string]compositionv1alpha1.Stage{} + updated = true + } + oldValue := "" + if _, ok := plancr.Spec.Stages[expander.Name]; !ok { + updated = true + } else { + oldValue = plancr.Spec.Stages[expander.Name].Manifest } + if result.Type == pb.ResultType_MANIFESTS { s, err := strconv.Unquote(string(result.Manifests)) if err != nil { logger.Error(err, "unable to unquote grpc response") - return "UnquoteResponseFailed", err + return updated, "UnquoteResponseFailed", err } plancr.Spec.Stages[expander.Name] = compositionv1alpha1.Stage{ Manifest: s, @@ -461,18 +470,43 @@ func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger log s, err := strconv.Unquote(string(result.Values)) if err != nil { logger.Error(err, "unable to unquote grpc response") - return "UnquoteResponseFailed", err + return updated, "UnquoteResponseFailed", err } plancr.Spec.Stages[expander.Name] = compositionv1alpha1.Stage{ Manifest: s, } } + if plancr.Spec.Stages[expander.Name].Manifest != oldValue { + updated = true + } + err = r.Client.Update(ctx, &plancr) if err != nil { logger.Error(err, "error updating plan", "plan", planNN) - return "UpdatePlanFailed", err + return updated, "UpdatePlanFailed", err } - return "", nil + return updated, "", nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *ExpanderReconciler) SetupWithManager(mgr ctrl.Manager, cr *unstructured.Unstructured) error { + var err error + // TODO(barni@): Can we setup dynamic controller at main.go for CompositionReconciler instead of 1 per ExpanderReconciler + r.Dynamic, err = dynamic.NewForConfig(r.Config) + if err != nil { + return fmt.Errorf("error building dynamic client: %w", err) + } + + ratelimiter := workqueue.NewMaxOfRateLimiter( + workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 120*time.Second), + // 40 qps, 400 bucket size. This is only for retry speed and its only the overall factor (not per item) + &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(40), 400)}, + ) + + return ctrl.NewControllerManagedBy(mgr). + For(cr). + WithOptions(controller.Options{RateLimiter: ratelimiter}). + Complete(r) } diff --git a/experiments/compositions/composition/internal/controller/expanderversion_controller.go b/experiments/compositions/composition/internal/controller/expanderversion_controller.go index fd436818bf1..e10b640e3fd 100644 --- a/experiments/compositions/composition/internal/controller/expanderversion_controller.go +++ b/experiments/compositions/composition/internal/controller/expanderversion_controller.go @@ -116,6 +116,10 @@ func (r *ExpanderVersionReconciler) processExpanderVersion( } expander := strings.TrimPrefix(ev.Name, "composition-") + image := ev.Spec.Image + if image == "" { + image = fmt.Sprintf("expander-%s", expander) + } semVerVersions := []*semver.Version{} for _, r := range ev.Spec.ValidVersions { v, err := semver.NewVersion(r) @@ -129,7 +133,7 @@ func (r *ExpanderVersionReconciler) processExpanderVersion( value := "" if ev.Spec.Type == compositionv1alpha1.ExpanderTypeJob { - value = fmt.Sprintf("%s/expander-%s:%s", ev.Spec.ImageRegistry, expander, key) + value = fmt.Sprintf("%s/%s:%s", ev.Spec.ImageRegistry, image, key) } else { svcVersion := strings.Replace(key, ".", "-", -1) value = fmt.Sprintf("composition-%s-%s:8443", expander, svcVersion) diff --git a/experiments/compositions/composition/release/manifest.yaml b/experiments/compositions/composition/release/manifest.yaml index 24ea5365374..bc82cb00c6f 100644 --- a/experiments/compositions/composition/release/manifest.yaml +++ b/experiments/compositions/composition/release/manifest.yaml @@ -1234,7 +1234,7 @@ spec: apiVersion: composition.google.com/v1alpha1 kind: ExpanderVersion metadata: - name: composition-gjinja2 + name: composition-jinja2 namespace: composition-system spec: type: grpc diff --git a/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionGrpc/input.yaml b/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionGrpc/input.yaml index 42eeedd9e99..5d136526850 100644 --- a/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionGrpc/input.yaml +++ b/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionGrpc/input.yaml @@ -105,7 +105,7 @@ metadata: spec: inputAPIGroup: pconfigs.facade.foocorp.com expanders: - - type: gjinja2 + - type: jinja2 name: project template: | {% set hostProject = 'compositions-foobar' %} diff --git a/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionJob/input.yaml b/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionJob/input.yaml index 5d136526850..357c0147c99 100644 --- a/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionJob/input.yaml +++ b/experiments/compositions/composition/tests/data/TestSimpleCompositionExpansionJob/input.yaml @@ -105,7 +105,7 @@ metadata: spec: inputAPIGroup: pconfigs.facade.foocorp.com expanders: - - type: jinja2 + - type: pjinja2 name: project template: | {% set hostProject = 'compositions-foobar' %} diff --git a/experiments/compositions/composition/tests/scenario/scenario.go b/experiments/compositions/composition/tests/scenario/scenario.go index 59ebd922b00..a837452ec1a 100644 --- a/experiments/compositions/composition/tests/scenario/scenario.go +++ b/experiments/compositions/composition/tests/scenario/scenario.go @@ -76,6 +76,11 @@ func NewBasic(t *testing.T) *Scenario { // TODO (barney-s) parameterize or make it global logRoot := "../../" + t.Logf("------------------------------------------------------------------") + t.Logf("%s", name) + t.Logf("------------------------------------------------------------------") + time.Sleep(2 * time.Second) + ctx := context.Background() clusterUser := cluster.ReserveCluster(t) config := clusterUser.Config() diff --git a/experiments/compositions/composition/tests/testcases/simple_test.go b/experiments/compositions/composition/tests/testcases/simple_test.go index f770fe1b21e..6cf134e6d35 100644 --- a/experiments/compositions/composition/tests/testcases/simple_test.go +++ b/experiments/compositions/composition/tests/testcases/simple_test.go @@ -92,7 +92,7 @@ func TestSimpleCompositionAddFacadeField(t *testing.T) { // Check if additional ConfigMap is created cm := utils.GetConfigMapObj("team-a", "proj-b") - s.C.MustExist([]*unstructured.Unstructured{cm}, scenario.ExistTimeout) + s.C.MustExist([]*unstructured.Unstructured{cm}, scenario.CompositionReconcileTimeout) } // Test removing config that results in removal of some expanded resource @@ -127,7 +127,7 @@ func TestSimpleCompositionStatusValidation(t *testing.T) { // Verify there is a Validation failure status condition in compositions composition := utils.GetCompositionObj("default", "projectconfigmap") condition := utils.GetValidationFailedCondition("ExpanderValidationFailed", "") - s.C.MustHaveCondition(composition, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(composition, condition, scenario.CompositionReconcileTimeout) // Apply the fixed Composition s.ApplyManifests("composition without validation error", "fixed_composition.yaml") @@ -135,7 +135,7 @@ func TestSimpleCompositionStatusValidation(t *testing.T) { // Check if Validation failure condition is cleared composition = utils.GetCompositionObj("default", "projectconfigmap") condition = utils.GetValidationFailedCondition("ExpanderValidationFailed", "") - s.C.MustNotHaveCondition(composition, condition, scenario.ExistTimeout) + s.C.MustNotHaveCondition(composition, condition, scenario.CompositionReconcileTimeout) } func TestSimpleCompositionStatusFacadeCRDMissing(t *testing.T) { @@ -147,7 +147,7 @@ func TestSimpleCompositionStatusFacadeCRDMissing(t *testing.T) { // Verify there is a Error status condition in compositions composition := utils.GetCompositionObj("default", "projectconfigmap") condition := utils.GetErrorCondition("MissingFacadeCRD", "") - s.C.MustHaveCondition(composition, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(composition, condition, scenario.CompositionReconcileTimeout) // Apply the fixed Composition s.ApplyManifests("Facade CRD", "facade_crd.yaml") @@ -155,7 +155,7 @@ func TestSimpleCompositionStatusFacadeCRDMissing(t *testing.T) { // Check if Validation failure condition is cleared composition = utils.GetCompositionObj("default", "projectconfigmap") condition = utils.GetErrorCondition("MissingFacadeCRD", "") - s.C.MustNotHaveCondition(composition, condition, scenario.ExistTimeout) + s.C.MustNotHaveCondition(composition, condition, scenario.CompositionReconcileTimeout) } func TestSimplePlanStatusWaitingForValues(t *testing.T) { @@ -167,7 +167,7 @@ func TestSimplePlanStatusWaitingForValues(t *testing.T) { // Verify there is a Waiting failure status condition in plan plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") condition := utils.GetWaitingCondition("FetchValuesFromFailed", "") - s.C.MustHaveCondition(plan, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) // Apply Configmap with data present s.ApplyManifests("Fixed Configmap", "configmap_with_data.yaml") @@ -189,7 +189,7 @@ func TestSimplePlanStatusErrorExpansionFailed(t *testing.T) { // Verify there is a Waiting failure status condition in plan plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") - condition := utils.GetErrorCondition("ExpansionFailed", "") + condition := utils.GetErrorCondition("EvaluateStatusFailed", "") s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) // Apply Configmap with data present @@ -197,7 +197,7 @@ func TestSimplePlanStatusErrorExpansionFailed(t *testing.T) { // Check if Waiting failure condition is cleared plan = utils.GetPlanObj("team-a", "pconfigs-team-a-config") - condition = utils.GetErrorCondition("ExpansionFailed", "") + condition = utils.GetErrorCondition("EvaluateStatusFailed", "") s.C.MustNotHaveCondition(plan, condition, 2*scenario.CompositionReconcileTimeout) // Verify the composition progresses after being unblocked @@ -213,7 +213,7 @@ func TestSimplePlanStatusErrorFailedLoadingManifestsFromPlan(t *testing.T) { // Verify there is a Waiting failure status condition in plan plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") condition := utils.GetErrorCondition("FailedLoadingManifestsFromPlan", "") - s.C.MustHaveCondition(plan, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) // Apply Configmap with data present s.ApplyManifests("Composition without yaml error", "composition_fixed.yaml") @@ -262,7 +262,7 @@ func TestSimpleNamespaceInherit(t *testing.T) { // Verify presence of an error because one of the manifests is cluster scoped plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") condition := utils.GetErrorCondition("FailedApplyingManifests", "") - s.C.MustHaveCondition(plan, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) } func TestSimpleNamespaceExplicit(t *testing.T) { @@ -317,7 +317,7 @@ func TestSimpleExpanderInvalid(t *testing.T) { plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") condition := utils.GetErrorCondition("MissingExpanderCR", "") - s.C.MustHaveCondition(plan, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) } func TestSimpleExpanderVersionInvalid(t *testing.T) { @@ -327,5 +327,5 @@ func TestSimpleExpanderVersionInvalid(t *testing.T) { plan := utils.GetPlanObj("team-a", "pconfigs-team-a-config") condition := utils.GetErrorCondition("VersionNotFound", "") - s.C.MustHaveCondition(plan, condition, scenario.ExistTimeout) + s.C.MustHaveCondition(plan, condition, scenario.CompositionReconcileTimeout) }