Skip to content
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

Allow RSCT image to configure runtime via the RSCT spec #23

Merged

Conversation

varad-ahirwadkar
Copy link
Contributor

This PR fixes #13 and #12.

This PR allows the RSCT image runtime to be configured via the RSCT spec.

api/v1alpha1/rsct_types.go Outdated Show resolved Hide resolved
api/v1alpha1/rsct_types.go Outdated Show resolved Hide resolved
internal/controller/rsct_controller.go Outdated Show resolved Hide resolved
r.Config.Image = "quay.io/powercloud/rsct-ppc64le:latest"

// Using the default RSCT image if not specified in RSCTSpec
if *rsct.Spec.Image == "" {
Copy link
Member

Choose a reason for hiding this comment

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

check for nil check before checking for empty string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added check for nil instead of empty string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now, it is fetching default value. If the spec is empty, the default value will be used.

apiVersion: rsct.ibm.com/v1alpha1
kind: RSCT
metadata:
  name: rsct
  namespace: rsct-operator-system
spec: {}

r.Config.Namespace = rsct.Namespace
r.Config.Name = rsct.Name
r.Config.Image = "quay.io/powercloud/rsct-ppc64le:latest"
r.Config.Image = *rsct.Spec.Image
Copy link
Member

Choose a reason for hiding this comment

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

better have a nil check here for safer side, don't want to hit with NPE

Copy link
Contributor Author

@varad-ahirwadkar varad-ahirwadkar Jul 13, 2024

Choose a reason for hiding this comment

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

yes, added nil check

@varad-ahirwadkar varad-ahirwadkar force-pushed the rsct-image branch 2 times, most recently from 202f22c to 0b966e4 Compare July 13, 2024 15:44
Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@ppc64le-cloud-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mkumatag, varad-ahirwadkar

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

@ppc64le-cloud-bot ppc64le-cloud-bot merged commit 1b3e7af into ocp-power-automation:main Jul 18, 2024
1 of 2 checks passed
@varad-ahirwadkar varad-ahirwadkar deleted the rsct-image branch November 18, 2024 06:28
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.

Allow rsct image to configure runtime via RSCT spec
3 participants