Skip to content

Commit

Permalink
remove changes to deprecation statuses
Browse files Browse the repository at this point in the history
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
  • Loading branch information
ankitathomas committed Apr 12, 2024
1 parent ce3a005 commit 90fc6ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/controllers/extension_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,12 @@ func (r *ExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alpha1.Ext
ext.Status.ResolvedBundle = bundleMetadataFor(bundle)
setResolvedStatusConditionSuccess(&ext.Status.Conditions, fmt.Sprintf("resolved to %q", bundle.Image), ext.GetGeneration())

// Populate the deprecation status using the resolved bundle
SetDeprecationStatusInExtension(ext, bundle)

mediaType, err := bundle.MediaType()
if err != nil {
if c := apimeta.FindStatusCondition(ext.Status.Conditions, ocv1alpha1.TypeInstalled); c == nil {
ext.Status.InstalledBundle = nil
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("failed to read bundle mediaType: %v", err), ext.GetGeneration())
setDeprecationStatusesUnknown(&ext.Status.Conditions, "deprecation checks have not been attempted as installation has failed", ext.GetGeneration())
}
setProgressingStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("failed to read bundle mediaType: %v", err), ext.GetGeneration())
return ctrl.Result{}, err
Expand All @@ -185,6 +183,7 @@ func (r *ExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alpha1.Ext
// hasn't been attempted yet, due to the spec being invalid.
ext.Status.InstalledBundle = nil
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("bundle type %s not supported currently", mediaType), ext.GetGeneration())
setDeprecationStatusesUnknown(&ext.Status.Conditions, "deprecation checks have not been attempted as installation has failed", ext.GetGeneration())
}
setProgressingStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("bundle type %s not supported currently", mediaType), ext.GetGeneration())
return ctrl.Result{}, nil
Expand All @@ -195,6 +194,7 @@ func (r *ExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alpha1.Ext
if c := apimeta.FindStatusCondition(ext.Status.Conditions, ocv1alpha1.TypeInstalled); c == nil {
ext.Status.InstalledBundle = nil
setInstalledStatusConditionFailed(&ext.Status.Conditions, err.Error(), ext.GetGeneration())
setDeprecationStatusesUnknown(&ext.Status.Conditions, "deprecation checks have not been attempted as installation has failed", ext.GetGeneration()

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

missing ',' before newline in argument list

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

missing ',' before newline in argument list

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

missing ',' before newline in argument list

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / unit-test-basic

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected newline in argument list; possibly missing comma or ) (typecheck)

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' before newline in argument list (typecheck)

Check failure on line 197 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / goreleaser

syntax error: unexpected newline in argument list; possibly missing comma or )
}

Check failure on line 198 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

expected operand, found '}'

Check failure on line 198 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

expected operand, found '}'

Check failure on line 198 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

expected operand, found '}'

Check failure on line 198 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

expected operand, found '}' (typecheck)
setProgressingStatusConditionFailed(&ext.Status.Conditions, err.Error(), ext.GetGeneration())
return ctrl.Result{}, err

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

missing ',' in argument list

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

missing ',' in argument list

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

missing ',' before newline in argument list

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

missing ',' in argument list

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

missing ',' before newline in argument list

Check failure on line 200 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' in argument list (typecheck)
Expand All @@ -204,6 +204,7 @@ func (r *ExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alpha1.Ext
// originally Reason: ocv1alpha1.ReasonInstallationFailed
ext.Status.InstalledBundle = nil

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

expected '==', found '='

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

expected '==', found '='

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / e2e-kind

missing ',' before newline in composite literal

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

expected '==', found '='

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / operator-developer-e2e

missing ',' before newline in composite literal

Check failure on line 205 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

expected '==', found '=' (typecheck)
setInstalledStatusConditionFailed(&ext.Status.Conditions, err.Error(), ext.GetGeneration())

Check failure on line 206 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

missing ',' before newline in composite literal

Check failure on line 206 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' before newline in composite literal (typecheck)
setDeprecationStatusesUnknown(&ext.Status.Conditions, "deprecation checks have not been attempted as installation has failed", ext.GetGeneration())

Check failure on line 207 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

missing ',' before newline in composite literal

Check failure on line 207 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' before newline in composite literal (typecheck)
setProgressingStatusConditionProgressing(&ext.Status.Conditions, "installation failed", ext.GetGeneration())

Check failure on line 208 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

missing ',' before newline in composite literal
return ctrl.Result{}, err

Check failure on line 209 in internal/controllers/extension_controller.go

View workflow job for this annotation

GitHub Actions / verify

expected operand, found 'return'
}
Expand All @@ -214,12 +215,14 @@ func (r *ExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alpha1.Ext
// originally Reason: ocv1alpha1.ReasonInstallationStatusUnknown
ext.Status.InstalledBundle = nil
setInstalledStatusConditionFailed(&ext.Status.Conditions, err.Error(), ext.GetGeneration())
setDeprecationStatusesUnknown(&ext.Status.Conditions, "deprecation checks have not been attempted as installation has failed", ext.GetGeneration())
setProgressingStatusConditionProgressing(&ext.Status.Conditions, "installation failed", ext.GetGeneration())
return ctrl.Result{}, err
}

ext.Status.InstalledBundle = bundleMetadataFor(bundle)
setInstalledStatusConditionSuccess(&ext.Status.Conditions, fmt.Sprintf("successfully installed %v", ext.Status.InstalledBundle), ext.GetGeneration())
SetDeprecationStatusInExtension(ext, bundle)

// TODO: add conditions to determine extension health
mapAppStatusToCondition(existingTypedApp, ext)
Expand Down

0 comments on commit 90fc6ba

Please sign in to comment.