-
Notifications
You must be signed in to change notification settings - Fork 75
OCPCLOUD-3318: Integrate CompatibilityRequirements into the CCAPIO Insaller (WIP) #604
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
afcc0e6
Adds Compatability Requirements probes
theobarberbany b653d3b
Producer plumbing for unmanagedCRDs
theobarberbany 79f9a43
Plumbing for consumer side of unmanagedCRDs
theobarberbany 2de3d3a
Plumbing tests
theobarberbany 46628de
Creates synthetic component with compatability requirements
theobarberbany 6619812
Synthetic component tests
theobarberbany c891272
Integration tests
theobarberbany File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,13 +89,7 @@ func (r *RevisionController) Reconcile(ctx context.Context, _ ctrl.Request) (ctr | |
| } | ||
|
|
||
| func (r *RevisionController) reconcile(ctx context.Context, log logr.Logger) operatorstatus.ReconcileResult { | ||
| // Generate a desired revision from the current state | ||
| desiredRevision, result := r.generateDesiredRevision(ctx) | ||
| if result != nil { | ||
| return *result | ||
| } | ||
|
|
||
| // Get ClusterAPI singleton | ||
| // Get ClusterAPI singleton first — generateDesiredRevision needs spec fields. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is such a clanker comment 😅
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup - welcome to the future .. |
||
| clusterAPI := &operatorv1alpha1.ClusterAPI{} | ||
| if err := r.Get(ctx, client.ObjectKey{Name: clusterAPIName}, clusterAPI); err != nil { | ||
| if apierrors.IsNotFound(err) { | ||
|
|
@@ -105,6 +99,16 @@ func (r *RevisionController) reconcile(ctx context.Context, log logr.Logger) ope | |
| return opresult.Error(fmt.Errorf("fetching ClusterAPI: %w", err)) | ||
| } | ||
|
|
||
| var unmanagedCRDs []string | ||
| if clusterAPI.Spec != nil { | ||
| unmanagedCRDs = clusterAPI.Spec.UnmanagedCustomResourceDefinitions | ||
| } | ||
|
|
||
| desiredRevision, result := r.generateDesiredRevision(ctx, unmanagedCRDs) | ||
| if result != nil { | ||
| return *result | ||
| } | ||
|
|
||
| // Create a reverse sorted, merged list of revisions. It will prepend the | ||
| // new revision if necessary. Note that the latest revision is always | ||
| // first, and there is guaranteed to be at least one revision. | ||
|
|
@@ -134,7 +138,7 @@ func (r *RevisionController) reconcile(ctx context.Context, log logr.Logger) ope | |
| return opresult.Success() | ||
| } | ||
|
|
||
| func (r *RevisionController) generateDesiredRevision(ctx context.Context) (revisiongenerator.RenderedRevision, *operatorstatus.ReconcileResult) { | ||
| func (r *RevisionController) generateDesiredRevision(ctx context.Context, unmanagedCRDs []string) (revisiongenerator.RenderedRevision, *operatorstatus.ReconcileResult) { | ||
| infra := &configv1.Infrastructure{} | ||
| if err := r.Get(ctx, client.ObjectKey{Name: infrastructureName}, infra); err != nil { | ||
| return nil, opresult.ErrorP(fmt.Errorf("fetching infrastructure: %w", err)) | ||
|
|
@@ -147,7 +151,10 @@ func (r *RevisionController) generateDesiredRevision(ctx context.Context) (revis | |
| // Build ordered component list from provider metadata | ||
| providerComponents := r.buildComponentList(infra.Status.PlatformStatus.Type) | ||
|
|
||
| revision, err := revisiongenerator.NewRenderedRevision(providerComponents, revisiongenerator.WithManifestSubstitutions(r.manifestSubstitutions)) | ||
| revision, err := revisiongenerator.NewRenderedRevision(providerComponents, | ||
| revisiongenerator.WithManifestSubstitutions(r.manifestSubstitutions), | ||
| revisiongenerator.WithUnmanagedCRDs(unmanagedCRDs), | ||
| ) | ||
| if err != nil { | ||
| return nil, opresult.ErrorP(fmt.Errorf("error creating rendered revision: %w", err)) | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.