-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance CloudStorage API: Add conditions and validation logic #122
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
base: OADP-3307
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds Kubernetes-style Conditions to CloudStorage status, reconciliation condition constants, deepcopy and type-alias updates, CRD/CSV schema and statusDescriptor changes, and a provider-aware ValidateCloudStorage method with status-condition handling in the controller. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant K8s as API Server
participant Ctrl as CloudStorage Controller
participant Provider as Cloud Provider
participant Secret as K8s Secret
User->>K8s: Create/Update CloudStorage
K8s-->>Ctrl: Reconcile event
Ctrl->>Ctrl: ValidateCloudStorage(bucket)
Ctrl->>Secret: Check required credentials (provider-specific)
alt Validation fails
Ctrl->>K8s: Status update: Condition Reconciled=False, Reason=ValidationFailed
Ctrl-->>K8s: Requeue after 1m
else Validation succeeds
Ctrl->>Provider: Ensure bucket/container exists (create/verify)
alt Provider error
Ctrl->>K8s: Status update: Reconciled=False, Reason=Error
Ctrl-->>K8s: Requeue
else Provider success
Ctrl->>K8s: Update status: Name, LastSyncTimestamp
Ctrl->>K8s: Status update: Reconciled=True, Reason=Complete, Message="CloudStorage reconcile complete"
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🪛 YAMLlint (1.37.1)bundle/manifests/oadp.openshift.io_cloudstorages.yaml[error] 143-143: wrong indentation: expected 24 but found 22 (indentation) [error] 153-153: wrong indentation: expected 20 but found 18 (indentation) [error] 161-161: wrong indentation: expected 18 but found 16 (indentation) config/crd/bases/oadp.openshift.io_cloudstorages.yaml[error] 143-143: wrong indentation: expected 24 but found 22 (indentation) [error] 153-153: wrong indentation: expected 20 but found 18 (indentation) [error] 161-161: wrong indentation: expected 18 but found 16 (indentation) 🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @kaovilai, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the CloudStorage API by introducing a robust conditions framework and comprehensive validation logic. The primary goal is to provide clearer insights into the state of CloudStorage resources and to prevent misconfigurations before they lead to reconciliation failures. This involves adding a new 'Conditions' field to the CloudStorage status, refining the description of the 'LastSyncTimestamp', and implementing detailed validation checks for various cloud providers (AWS, Azure, GCP) directly within the controller's reconciliation loop.
Highlights
- Enhanced CloudStorageStatus with Conditions: The CloudStorageStatus struct now includes a 'Conditions' field, allowing for more detailed and standardized reporting of the resource's state, such as reconciliation status and validation outcomes.
- Improved LastSyncTimestamp Clarity: The description for the 'LastSyncTimestamp' field has been clarified to precisely explain when this timestamp is updated, specifically after successful reconciliation or bucket creation/verification.
- CRD and CSV Updates for CloudStorage: The Custom Resource Definition (CRD) and ClusterServiceVersion (CSV) for CloudStorage have been updated to reflect the new 'Conditions' field and the refined 'LastSyncTimestamp' description, ensuring consistency across API definitions and operator metadata.
- Introduced CloudStorage Configuration Validation: New validation logic has been implemented within the CloudStorage controller. This logic performs pre-reconciliation checks, ensuring that CloudStorage configurations are valid, including specific requirements for AWS (region, credentials), Azure (container name, credentials), and GCP (credentials).
- DeepCopy Logic and Import Alias Standardization: The auto-generated deepcopy file has been updated to correctly handle the new 'Conditions' field and to standardize the use of 'corev1' and 'v1' aliases for Kubernetes API types, maintaining code integrity and compatibility.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces important enhancements to the CloudStorage API, adding status conditions and validation logic. The changes are generally well-implemented. My review focuses on improving error handling, context propagation, and fixing a few issues in the new validation logic, including a redundancy and an inconsistency in the Azure provider validation.
| // Check for required fields based on authentication method | ||
| hasStorageAccount := false | ||
| if _, ok := secret.Data["AZURE_STORAGE_ACCOUNT_NAME"]; ok { | ||
| hasStorageAccount = true | ||
| } | ||
| if _, ok := secret.Data["storageAccount"]; ok { | ||
| hasStorageAccount = true | ||
| } | ||
| if !hasStorageAccount { | ||
| // Check if it's in the azurekey field (STS format) | ||
| if azureKey, ok := secret.Data["azurekey"]; ok { | ||
| keyStr := string(azureKey) | ||
| if !strings.Contains(keyStr, "AZURE_STORAGE_ACCOUNT") { | ||
| return fmt.Errorf("Azure credentials must specify storage account name") | ||
| } | ||
| } else { | ||
| return fmt.Errorf("Azure credentials must specify storage account name") | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation logic for Azure credentials seems inconsistent with the implementation logic used elsewhere for retrieving the storage account name.
Specifically:
- This validation checks for
AZURE_STORAGE_ACCOUNT_NAME(line 364) andstorageAccount(line 367) within the secret data. - However, the implementation in
pkg/bucket/azure.go(getStorageAccountNamefunction) looks forAZURE_STORAGE_ACCOUNTin the secret data, andstorageAccountin thebucket.Spec.Configmap, not the secret.
This discrepancy can lead to validation passing for configurations that will fail at runtime, or failing for valid configurations. The validation logic should be aligned with the implementation.
| } | ||
|
|
||
| // ValidateCloudStorage validates the CloudStorage configuration based on the provider | ||
| func (b *CloudStorageReconciler) ValidateCloudStorage(bucket *oadpv1alpha1.CloudStorage) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ValidateCloudStorage function should accept a context.Context from the Reconcile function instead of using context.Background(). This ensures that API calls within this function respect the parent context's lifecycle, including cancellation and deadlines.
You should update the function signature and then use the passed context in all b.Client.Get calls within this function (lines 326, 352, 387). The call at line 79 should also be updated to pass the context.
func (b *CloudStorageReconciler) ValidateCloudStorage(ctx context.Context, bucket *oadpv1alpha1.CloudStorage) error {| if bucket.Spec.Name == "" { | ||
| return fmt.Errorf("Azure provider requires container name to be specified") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Introduced Conditions field in CloudStorageStatus to track the state of the resource. - Updated LastSyncTimestamp description for clarity. - Enhanced CloudStorage CRD and CSV with new status descriptors. - Implemented validation logic for CloudStorage configuration in the controller. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
0128efa to
f25345d
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
♻️ Duplicate comments (4)
internal/controller/cloudstorage_controller.go (4)
368-386: Verify Azure credential field consistencyThe validation checks for
AZURE_STORAGE_ACCOUNT_NAMEandstorageAccountin the secret data, but the implementation inpkg/bucket/azure.gomay look for different field names. This could lead to validation passing for configurations that fail at runtime.Run the following script to verify the Azure credential field usage:
#!/bin/bash # Description: Verify the Azure credential field names used in the implementation # Search for Azure storage account field usage in the bucket package echo "=== Searching for Azure storage account field usage ===" rg -A 5 "AZURE_STORAGE_ACCOUNT" pkg/bucket/ # Look for getStorageAccountName function implementation echo -e "\n=== Searching for getStorageAccountName function ===" ast-grep --pattern 'func getStorageAccountName($$$) { $$$ }'
165-176: Consider handling status update errors more gracefullyThe status update failures are logged but the reconciliation continues. While this is generally acceptable, consider whether these failures should trigger a requeue to ensure status consistency.
Also applies to: 181-192, 200-211
311-311: ValidateCloudStorage should accept context.Context from ReconcileThe function currently uses
context.Background()which doesn't respect the parent context's lifecycle. This could lead to validation continuing even after the reconciliation has been cancelled.Apply this diff to fix the context usage:
-func (b *CloudStorageReconciler) ValidateCloudStorage(bucket *oadpv1alpha1.CloudStorage) error { +func (b *CloudStorageReconciler) ValidateCloudStorage(ctx context.Context, bucket *oadpv1alpha1.CloudStorage) error {And update all
context.Background()calls within this function to use the passedctxparameter (lines 332, 358, 393).Also update the call site at line 79:
- if err := b.ValidateCloudStorage(&bucket); err != nil { + if err := b.ValidateCloudStorage(ctx, &bucket); err != nil {
352-354: Remove redundant bucket name checkThis check for
bucket.Spec.Nameis redundant as it's already validated for all providers at line 318.Apply this diff to remove the redundant check:
- if bucket.Spec.Name == "" { - return fmt.Errorf("Azure provider requires container name to be specified") - }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
api/v1alpha1/cloudstorage_types.go(1 hunks)api/v1alpha1/zz_generated.deepcopy.go(9 hunks)bundle/manifests/oadp-operator.clusterserviceversion.yaml(1 hunks)bundle/manifests/oadp.openshift.io_cloudstorages.yaml(1 hunks)config/crd/bases/oadp.openshift.io_cloudstorages.yaml(1 hunks)config/manifests/bases/oadp-operator.clusterserviceversion.yaml(1 hunks)internal/controller/cloudstorage_controller.go(5 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
internal/controller/cloudstorage_controller.go (1)
api/v1alpha1/cloudstorage_types.go (9)
ConditionCloudStorageReconciled(76-76)CloudStorageReconciledReasonValidationFailed(82-82)CloudStorageReconciledReasonError(80-80)CloudStorageReconciledReasonComplete(78-78)CloudStorageReconcileCompleteMessage(84-84)CloudStorage(91-97)AWSBucketProvider(27-27)AzureBucketProvider(28-28)GCPBucketProvider(29-29)
api/v1alpha1/zz_generated.deepcopy.go (1)
api/v1alpha1/dataprotectionapplication_types.go (1)
StorageType(597-601)
🪛 golangci-lint (2.2.2)
internal/controller/cloudstorage_controller.go
[error] 217-217: File is not properly formatted
(gci)
🪛 YAMLlint (1.37.1)
bundle/manifests/oadp.openshift.io_cloudstorages.yaml
[error] 143-143: wrong indentation: expected 24 but found 22
(indentation)
[error] 153-153: wrong indentation: expected 20 but found 18
(indentation)
config/manifests/bases/oadp-operator.clusterserviceversion.yaml
[error] 406-406: wrong indentation: expected 8 but found 6
(indentation)
bundle/manifests/oadp-operator.clusterserviceversion.yaml
[error] 397-397: wrong indentation: expected 8 but found 6
(indentation)
config/crd/bases/oadp.openshift.io_cloudstorages.yaml
[error] 143-143: wrong indentation: expected 24 but found 22
(indentation)
[error] 153-153: wrong indentation: expected 20 but found 18
(indentation)
🔇 Additional comments (16)
bundle/manifests/oadp-operator.clusterserviceversion.yaml (1)
401-404: LGTM! Clear and comprehensive LastSyncTimestamp descriptionThe updated description clearly explains when the timestamp is updated and its applicability across all supported cloud providers (AWS, Azure, GCP). This provides better clarity for users compared to the previous generic description.
api/v1alpha1/cloudstorage_types.go (3)
63-65: LGTM! Well-documented LastSyncTimestamp fieldThe expanded documentation clearly explains the reconciliation-based timing semantics and provider applicability.
68-70: LGTM! Standard Kubernetes conditions patternThe addition of the Conditions field follows Kubernetes best practices for status reporting, providing a standardized way to track the CloudStorage resource state.
73-85: LGTM! Well-structured condition constantsThe condition constants follow Kubernetes naming conventions and provide clear semantic meaning for different reconciliation states.
internal/controller/cloudstorage_controller.go (1)
79-94: LGTM! Proper validation flow with status updatesThe validation logic is well-integrated with proper error handling, status condition updates, and event recording. The 1-minute requeue allows for recovery from transient issues.
bundle/manifests/oadp.openshift.io_cloudstorages.yaml (1)
102-159: LGTM! Well-structured Conditions field following Kubernetes API conventionsThe Conditions field is properly defined with all required fields and appropriate validation constraints, following the standard Kubernetes API pattern for status conditions.
config/crd/bases/oadp.openshift.io_cloudstorages.yaml (1)
161-165: LastSyncTimestamp is only set on successful reconciliation
I’ve reviewedinternal/controller/cloudstorage_controller.goand confirmed that:
- In all error paths (validation failure, bucket creation or existence errors), the controller updates status conditions to False without touching
Status.LastSynced.- The only
bucket.Status.LastSynced = …call occurs immediately before setting the success condition (ConditionCloudStorageReconciled = True) and updating status.No code path updates
LastSyncTimestampon failure, so the behavior matches the CRD description.api/v1alpha1/zz_generated.deepcopy.go (9)
27-29: Import aliasing looks correct and unambiguousUsing corev1 for k8s.io/api/core/v1 and v1 for k8s.io/apimachinery/pkg/apis/meta/v1 avoids collisions and keeps references clear in this generated file.
199-205: DeepCopy updates for CloudStorageLocation types are correctSwitching Credential to corev1.SecretKeySelector and BackupSyncPeriod to v1.Duration aligns with the aliasing change and preserves type correctness.
266-272: DeepCopy for CloudStorageStatus.Conditions is implemented correctlyAllocates a new slice and deep-copies each metav1.Condition element. This is the correct pattern to avoid aliasing of slice elements.
460-462: ImagePullPolicy alias update is consistentUsing corev1.PullPolicy maintains clarity with the new import aliasing and doesn’t change semantics.
485-489: DataProtectionApplicationStatus.Conditions deepcopy remains correct with new aliasConditions slice is deep-copied element-wise as expected.
630-644: EnforceBackupStorageLocationSpec alias/type adjustments are soundCredential and Duration pointers switched to corev1 and v1 types respectively; deepcopy semantics preserved.
851-858: NodeAgentConfig Duration fields use the correct metav1 aliasDataMoverPrepareTimeout and ResourceTimeout now use v1.Duration with proper deep copy. Looks good.
951-958: NonAdmin Duration fields aliasing is correctGarbageCollectionPeriod and BackupSyncPeriod now reference v1.Duration consistently.
1011-1021: PodConfig Env and Tolerations alias changes are correctSwitching to corev1.Toleration and corev1.EnvVar with deep copy per element matches Kubernetes API expectations.
| - description: Conditions represent the latest available observations of the | ||
| CloudStorage's state. | ||
| displayName: Conditions | ||
| path: conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Fix YAML indentation for consistency
The indentation for the new status descriptors is inconsistent with the rest of the file. Status descriptors should be indented with 8 spaces.
Apply this diff to fix the indentation:
- - description: Conditions represent the latest available observations of the
- CloudStorage's state.
- displayName: Conditions
- path: conditions
+ - description: Conditions represent the latest available observations of the
+ CloudStorage's state.
+ displayName: Conditions
+ path: conditions📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - description: Conditions represent the latest available observations of the | |
| CloudStorage's state. | |
| displayName: Conditions | |
| path: conditions | |
| - description: Conditions represent the latest available observations of the | |
| CloudStorage's state. | |
| displayName: Conditions | |
| path: conditions |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 397-397: wrong indentation: expected 8 but found 6
(indentation)
🤖 Prompt for AI Agents
In bundle/manifests/oadp-operator.clusterserviceversion.yaml around lines 397 to
400, the three status descriptor lines ("description: Conditions...",
"displayName: Conditions", "path: conditions") are indented inconsistently;
re-indent each of these lines to use 8 spaces (matching the other
statusDescriptors entries) so they align with the rest of the file's status
descriptor block and preserve YAML structure.
| status: | ||
| description: status of the condition, one of True, False, Unknown. | ||
| enum: | ||
| - "True" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Fix YAML indentation for enum values
The indentation for the enum values is inconsistent with Kubernetes CRD conventions.
Apply this diff to fix the indentation:
enum:
- - "True"
- - "False"
- - Unknown
+ - "True"
+ - "False"
+ - UnknownAnd for the required fields:
- required:
- - lastTransitionTime
- - message
- - reason
- - status
- - type
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - typeAlso applies to: 153-153
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 143-143: wrong indentation: expected 24 but found 22
(indentation)
🤖 Prompt for AI Agents
In bundle/manifests/oadp.openshift.io_cloudstorages.yaml around lines 143 and
153, the enum value lines are over-indented and not aligned with Kubernetes CRD
conventions; update the indentation so enum entries are nested under the "enum:"
key (two spaces deeper than the key) rather than aligned with it, and likewise
fix the "required:" list indentation so each required field is listed under the
"required:" key with proper list dash indentation; ensure YAML spacing matches
surrounding schema entries to restore valid CRD formatting.
| description: status of the condition, one of True, False, Unknown. | ||
| enum: | ||
| - "True" | ||
| - "False" | ||
| - Unknown | ||
| type: string | ||
| type: | ||
| description: type of condition in CamelCase or in foo.example.com/CamelCase. | ||
| maxLength: 316 | ||
| pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ | ||
| type: string | ||
| required: | ||
| - lastTransitionTime | ||
| - message | ||
| - reason | ||
| - status | ||
| - type | ||
| type: object | ||
| type: array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix YAML indentation (YAMLlint errors) and normalize enum quoting
YAMLlint flagged indentation issues at Line 143 and Line 153. Also, enum values for status should be consistently quoted. Correct both indentation and quoting to avoid schema validation issues.
Apply this diff to fix indentation and quoting:
- enum:
- - "True"
- - "False"
- - Unknown
+ enum:
+ - "True"
+ - "False"
+ - "Unknown"
...
- required:
- - lastTransitionTime
- - message
- - reason
- - status
- - type
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| description: status of the condition, one of True, False, Unknown. | |
| enum: | |
| - "True" | |
| - "False" | |
| - Unknown | |
| type: string | |
| type: | |
| description: type of condition in CamelCase or in foo.example.com/CamelCase. | |
| maxLength: 316 | |
| pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ | |
| type: string | |
| required: | |
| - lastTransitionTime | |
| - message | |
| - reason | |
| - status | |
| - type | |
| type: object | |
| type: array | |
| description: status of the condition, one of True, False, Unknown. | |
| enum: | |
| - "True" | |
| - "False" | |
| - "Unknown" | |
| type: string | |
| type: | |
| description: type of condition in CamelCase or in foo.example.com/CamelCase. | |
| maxLength: 316 | |
| pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ | |
| type: string | |
| required: | |
| - lastTransitionTime | |
| - message | |
| - reason | |
| - status | |
| - type | |
| type: object | |
| type: array |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 143-143: wrong indentation: expected 24 but found 22
(indentation)
[error] 153-153: wrong indentation: expected 20 but found 18
(indentation)
🤖 Prompt for AI Agents
In config/crd/bases/oadp.openshift.io_cloudstorages.yaml around lines 141-159,
the YAML has incorrect indentation for the enum block and inconsistent quoting
for the status enum values; fix by aligning the enum list items under the enum
key with two additional spaces (so they are nested under description->enum) and
ensure all enum scalar values are consistently quoted (e.g., "True", "False",
"Unknown"); keep the surrounding keys (type, description, pattern, maxLength)
indentation intact and validate with yamllint after change.
| - description: Conditions represent the latest available observations of the | ||
| CloudStorage's state. | ||
| displayName: Conditions | ||
| path: conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Fix YAML indentation inconsistency
The indentation is inconsistent with the rest of the file. Status descriptors should be indented with 8 spaces.
Apply this diff to fix the indentation:
- - description: Conditions represent the latest available observations of the
- CloudStorage's state.
- displayName: Conditions
- path: conditions
+ - description: Conditions represent the latest available observations of the
+ CloudStorage's state.
+ displayName: Conditions
+ path: conditions📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - description: Conditions represent the latest available observations of the | |
| CloudStorage's state. | |
| displayName: Conditions | |
| path: conditions | |
| - description: Conditions represent the latest available observations of the | |
| CloudStorage's state. | |
| displayName: Conditions | |
| path: conditions |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 406-406: wrong indentation: expected 8 but found 6
(indentation)
🤖 Prompt for AI Agents
In config/manifests/bases/oadp-operator.clusterserviceversion.yaml around lines
406 to 409, the "description"/"displayName"/"path" block is indented
incorrectly; align the status descriptor lines to 8 spaces (match the rest of
the file) by adjusting their indentation so each of those keys is preceded by
two additional spaces (total 8) to be consistent with other status descriptors.
| // Update status with updated value | ||
| bucket.Status.LastSynced = &metav1.Time{Time: time.Now()} | ||
| bucket.Status.Name = bucket.Spec.Name | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Remove trailing whitespace
There's trailing whitespace on this line that should be removed.
Apply this diff to remove the trailing whitespace:
-
+📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
🧰 Tools
🪛 golangci-lint (2.2.2)
[error] 217-217: File is not properly formatted
(gci)
🤖 Prompt for AI Agents
In internal/controller/cloudstorage_controller.go around line 217, there is a
trailing whitespace character at the end of the line; remove the trailing space
so the line ends cleanly (no extra spaces or tabs) and save the file, then run
gofmt or your editor's trim-trailing-whitespace action to ensure no other lines
have trailing whitespace.
…onditions Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: Tiger Kaovilai tkaovila@redhat.com
Summary by CodeRabbit
New Features
Documentation
Bug Fixes