Skip to content

Conversation

@ajanikow
Copy link
Collaborator

No description provided.

@cla-bot cla-bot bot added the cla-signed label Oct 31, 2025
@ajanikow ajanikow requested a review from Copilot October 31, 2025 09:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the operator image discovery process by introducing a new util.Image struct that encapsulates both the base image and an optional status image. This replaces the previous string-based image handling and streamlines how the operator determines which image to use based on the deployment's image discovery mode.

  • Introduced a new util.Image struct to handle operator image discovery with both base image and optional status image
  • Refactored NewOperator signature to accept util.Image instead of a string throughout the codebase
  • Updated the image discovery mechanism in cmd/cmd.go to fetch both spec and status images
  • Deprecated the --image.discovery.status flag as the discovery method has changed

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/util/image.go New file defining the Image struct with Get() method for hash-based image selection
pkg/operatorV2/operator.go Updated to use util.Image type and call Get(true) for image retrieval
pkg/operator/operator.go Changed OperatorImage field to Image of type util.Image
cmd/cmd.go Refactored image discovery to populate both Image and StatusImage fields; deprecated related flag
pkg/deployment/context_impl.go Updated GetOperatorImage() to use Image.Get() with deployment-specific discovery mode
Multiple test files Updated test initialization to use util.Image{Image: "..."} syntax
Documentation files Removed deprecated --image.discovery.status flag from CLI documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajanikow ajanikow force-pushed the feature/simplify_operator_id branch from 2c683db to 3c6368b Compare October 31, 2025 10:03
@ajanikow ajanikow requested a review from Copilot October 31, 2025 13:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cmd/cmd.go Outdated
operatorImageDiscovery struct {
timeout time.Duration
timeout time.Duration
//deprecated: Do not use this flag, as discovery method changed
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'deprecated' to 'Deprecated' in comment. Deprecation notices should start with 'Deprecated:' (capitalized and followed by a colon) to follow Go documentation conventions.

Suggested change
//deprecated: Do not use this flag, as discovery method changed
// Deprecated: Do not use this flag, as discovery method changed

Copilot uses AI. Check for mistakes.
f.MarkDeprecated("operator.metrics-exporter-image", "Value is not used anymore"),
f.MarkDeprecated("operator.arango-image", "Value is not used anymore"),
f.MarkDeprecated("scope", "Value is not used anymore"),
f.MarkDeprecated("image.discovery.status", "Value fetched from the Operator Spec"),
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation message 'Value fetched from the Operator Spec' is unclear. It doesn't explain what users should do or why the flag is deprecated. Consider a more descriptive message like 'Image discovery method is now determined by the deployment's ImageDiscoveryMode specification' to help users understand the change.

Suggested change
f.MarkDeprecated("image.discovery.status", "Value fetched from the Operator Spec"),
f.MarkDeprecated("image.discovery.status", "Image discovery method is now determined by the deployment's ImageDiscoveryMode specification"),

Copilot uses AI. Check for mistakes.
@ajanikow ajanikow merged commit 299caee into master Oct 31, 2025
3 checks passed
@ajanikow ajanikow deleted the feature/simplify_operator_id branch October 31, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants