Skip to content

Conversation

@osmman
Copy link
Collaborator

@osmman osmman commented Jan 15, 2025

This pull request introduces a new feature that allows the Operator manager to utilize RELATED_IMAGES_* environment variables for image configurations. This change allows operator-sdk to generate bundle image with relatedImages meta data which are used for disconnected environment. Additionally, it includes several refactoring changes to improve deployment for different environments Kubernetes/Openshift.

Key Features

  • Environment Variables: Use RELATED_IMAGES_ environment variables for image configurations.
  • Makefile Updates: Added CONFIG_DEFAULT for dynamic configuration based on the OPENSHIFT variable.
  • Codebase Enhancements: Centralized image management by importing internal/images.

@openshift-ci openshift-ci bot requested review from JasonPowr and lance January 15, 2025 11:09
@osmman osmman force-pushed the tturek/related-images branch from 3057129 to dc7b201 Compare January 15, 2025 11:22
@osmman osmman marked this pull request as draft January 15, 2025 16:47
@osmman osmman changed the title feat: use RELATED_IMAGES_ environment variables for manager PoC 1: feat: use RELATED_IMAGES_ environment variables for manager Jan 15, 2025
@osmman osmman force-pushed the tturek/related-images branch from 99976e7 to 1c8328a Compare January 16, 2025 11:19
@osmman osmman force-pushed the tturek/related-images branch from 1c8328a to 1a0f6ff Compare January 16, 2025 11:26
@osmman osmman marked this pull request as ready for review January 16, 2025 12:47
@openshift-ci openshift-ci bot requested review from bouskaJ and tommyd450 January 16, 2025 12:47
@osmman osmman changed the title PoC 1: feat: use RELATED_IMAGES_ environment variables for manager feat: use RELATED_IMAGES_ environment variables for manager Jan 16, 2025
@osmman osmman changed the title feat: use RELATED_IMAGES_ environment variables for manager feat: use RELATED_IMAGES_ environment variables to configure operand's images Jan 16, 2025
@osmman osmman force-pushed the tturek/related-images branch 2 times, most recently from 7e26eee to 83f4538 Compare January 16, 2025 14:07
@osmman osmman force-pushed the tturek/related-images branch 3 times, most recently from 83f4538 to fe9cc6c Compare February 3, 2025 11:17
@osmman
Copy link
Collaborator Author

osmman commented Feb 4, 2025

/test tas-operator-e2e

@osmman
Copy link
Collaborator Author

osmman commented Feb 4, 2025

@osmman
Copy link
Collaborator Author

osmman commented Feb 4, 2025

/override ci/prow/tas-operator-e2e

@openshift-ci
Copy link

openshift-ci bot commented Feb 4, 2025

@osmman: Overrode contexts on behalf of osmman: ci/prow/tas-operator-e2e

In response to this:

/override ci/prow/tas-operator-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@osmman osmman force-pushed the tturek/related-images branch from fe9cc6c to 595a830 Compare February 10, 2025 13:48
}

type registry struct {
mutex sync.RWMutex
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need synchronization? do you expect images to be changed on runtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added synchronisation because the values are configured via callbacks (async).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunatly I forget the reason why I have to do that way. It has been a long time ago when I develop that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reworked that registry to remove async setter but I think that it is bettor to keep synchronisation because registry is singleton. The async setter is looking to be left over from prototyping and hacking flag package.

@@ -0,0 +1,20 @@
apiVersion: v1
data:
RELATED_IMAGE_BACKFILL_REDIS: registry.redhat.io/rhtas/rekor-backfill-redis-rhel9@sha256:6aa3ca40e0f9e32a0a211a930b21ff009b83e46609bfa5bb328979e4799d13c7
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know that this is needed by Kustomize but I don't think it is necessary to keep it as part of the bundle. Maybe we can add it to .gitignore WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that it will be better to keep it. It will be better to try keep kustomize output as close to bundle/. For example make build-installer will generate resources with that config.

@osmman osmman force-pushed the tturek/related-images branch from 5aaf2f9 to 978e195 Compare February 11, 2025 12:24
@osmman osmman requested a review from bouskaJ February 11, 2025 13:34
@osmman
Copy link
Collaborator Author

osmman commented Feb 12, 2025

/override ci/prow/tas-operator-e2e

@openshift-ci
Copy link

openshift-ci bot commented Feb 12, 2025

@osmman: Overrode contexts on behalf of osmman: ci/prow/tas-operator-e2e

In response to this:

/override ci/prow/tas-operator-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@osmman
Copy link
Collaborator Author

osmman commented Feb 12, 2025

/override Red Hat Konflux / rhtas-operator-e2e-test / rhtas-operator

@osmman
Copy link
Collaborator Author

osmman commented Feb 12, 2025

/override "Red Hat Konflux / rhtas-operator-e2e-test / rhtas-operator"

@openshift-ci
Copy link

openshift-ci bot commented Feb 12, 2025

@osmman: Overrode contexts on behalf of osmman: Red Hat Konflux / rhtas-operator-e2e-test / rhtas-operator

In response to this:

/override "Red Hat Konflux / rhtas-operator-e2e-test / rhtas-operator"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@securesign securesign deleted a comment from openshift-ci bot Feb 12, 2025
@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bouskaJ, osmman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@osmman
Copy link
Collaborator Author

osmman commented Feb 13, 2025

/override ci/prow/tas-operator-e2e

@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2025

@osmman: Overrode contexts on behalf of osmman: ci/prow/tas-operator-e2e

In response to this:

/override ci/prow/tas-operator-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 1cbd29a into main Feb 13, 2025
22 of 23 checks passed
@bouskaJ bouskaJ mentioned this pull request Mar 14, 2025
@osmman osmman deleted the tturek/related-images branch March 28, 2025 09:43
@osmman osmman added the enhancement New feature or request label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved enhancement New feature or request lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants