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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions api/v1alpha1/rsct_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ type RSCTSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of RSCT. Edit rsct_types.go to remove/update
Foo string `json:"foo,omitempty"`
// Image is an RSCT image
// +kubebuilder:default="quay.io/powercloud/rsct-ppc64le:latest"
// +optional
Image *string `json:"image,omitempty"`
}

// RSCTStatus defines the observed state of RSCT
Expand Down
7 changes: 6 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bundle/manifests/rsct.ibm.com_rscts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ spec:
spec:
description: RSCTSpec defines the desired state of RSCT
properties:
foo:
description: Foo is an example field of RSCT. Edit rsct_types.go to
remove/update
image:
default: quay.io/powercloud/rsct-ppc64le:latest
description: Image is an RSCT image
type: string
type: object
status:
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/rsct.ibm.com_rscts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ spec:
spec:
description: RSCTSpec defines the desired state of RSCT
properties:
foo:
description: Foo is an example field of RSCT. Edit rsct_types.go to
remove/update
image:
default: quay.io/powercloud/rsct-ppc64le:latest
description: Image is an RSCT image
type: string
type: object
status:
Expand Down
1 change: 0 additions & 1 deletion internal/controller/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const (
osID = "rhcos"
rmcPort = 657
rmcAppName = "powervm-rmc"
rsctImage = "quay.io/powercloud/rsct-ppc64le:latest"
)

type DaemonSetConfig struct {
Expand Down
6 changes: 4 additions & 2 deletions internal/controller/rsct_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ func (r *RSCTReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
return reconcile.Result{}, fmt.Errorf("failed to get RSCT %s: %w", req, err)
}

// TODO(mjturek): Allow image specification
r.Config.Namespace = rsct.Namespace
r.Config.Name = rsct.Name
r.Config.Image = "quay.io/powercloud/rsct-ppc64le:latest"
// Set default RSCT image if not specified
if rsct.Spec.Image != nil {
r.Config.Image = *rsct.Spec.Image
}

haveServiceAccount, sa, err := r.ensureRSCTServiceAccount(ctx, rsct)
if err != nil {
Expand Down