Skip to content

feat(snc): add --profile flag with virtualization addon support for OCP SNC#738

Merged
adrianriobo merged 1 commit intoredhat-developer:mainfrom
jangel97:feature/ocp-snc-virt
Mar 5, 2026
Merged

feat(snc): add --profile flag with virtualization addon support for OCP SNC#738
adrianriobo merged 1 commit intoredhat-developer:mainfrom
jangel97:feature/ocp-snc-virt

Conversation

@jangel97
Copy link
Contributor

@jangel97 jangel97 commented Mar 2, 2026

Add a profile system to the OpenShift SNC command that allows installing addons on the cluster after deployment. The first supported profile is 'virtualization' which installs the OCP Virtualization (CNV) operator and enables nested virtualization on the compute instance.

kcFlag := fmt.Sprintf("--kubeconfig %s", ClientKubeconfigPath)

applyOperators := fmt.Sprintf(
"sudo bash -c 'cat <<\"EOFMANIFEST\" | oc apply %s -f -\n%s\nEOFMANIFEST'",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you do it programatically? use the golang client to connect to the cluster instead

pulumi.ToSecret(kubeconfig))
// Deploy profiles using Kubernetes provider
if len(r.profiles) > 0 {
k8sProvider, err := kubernetes.NewProvider(ctx, "k8s-provider", &kubernetes.ProviderArgs{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should not this be part of the common (target/service/snc) side for snc, you can create client.go there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I just moved it to service layer so it can be reused in other providers.

kcFlag := fmt.Sprintf("--kubeconfig %s", ClientKubeconfigPath)
waitCSV, err := args.RunCommand(ctx,
fmt.Sprintf(
`sudo bash -c 'until oc get csv %s -n %s -o jsonpath="{.items[0].status.phase}" 2>/dev/null | grep -q Succeeded; do echo "Waiting for CNV CSV..."; sleep 15; done'`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this sill sing oc instead of k8s client as the deploy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed it, should be gone, no more "oc" commands.

@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch 6 times, most recently from d2f13f1 to 677ecb0 Compare March 5, 2026 16:42
@jangel97 jangel97 marked this pull request as ready for review March 5, 2026 16:42
@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch from 677ecb0 to 09b8212 Compare March 5, 2026 16:43
@jangel97
Copy link
Contributor Author

jangel97 commented Mar 5, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch from 09b8212 to f153f72 Compare March 5, 2026 17:24
adrianriobo
adrianriobo previously approved these changes Mar 5, 2026
Copy link
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

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

@adrianriobo adrianriobo dismissed their stale review March 5, 2026 17:30

missing something

@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch 2 times, most recently from c8d8f81 to 273a78e Compare March 5, 2026 17:42
Add a profile system to the OpenShift SNC command that allows
installing addons on the cluster after deployment. The first
supported profile is 'virtualization' which installs the OCP
Virtualization (CNV) operator and enables nested virtualization
on the compute instance.

Signed-off-by: Jose Angel Morena <jmorenas@redhat.com>
@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch from 273a78e to 7ec787a Compare March 5, 2026 17:44
Copy link
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

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

LGTM

@adrianriobo adrianriobo merged commit c283c05 into redhat-developer:main Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants