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

Pass CLUSTER_PROFILE env var to CVO render #4444

Merged

Conversation

ravidbro
Copy link

@ravidbro ravidbro commented Dec 2, 2020

This PR adds the ability to pass CLUSTER_PROFILE as env var to the installer which will be propagated as env var to the CVO rendering.

Following the enhancements:
openshift/enhancements#200
openshift/enhancements#543

Signed-off-by: Ravid Brown ravid@redhat.com

Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

The enhancement linked deals with how the CVO gets the cluster profile. Is there an enhancement discussing how the installer figures out the cluster profile to use? Historically, the use of environment variables to direct installer behavior has been discouraged.

pkg/asset/ignition/bootstrap/bootstrap.go Outdated Show resolved Hide resolved
@ravidbro
Copy link
Author

ravidbro commented Dec 2, 2020

The enhancement linked deals with how the CVO gets the cluster profile. Is there an enhancement discussing how the installer figures out the cluster profile to use? Historically, the use of environment variables to direct installer behavior has been discouraged.

It was discussed in the internal slack if it should be added to the installer API (install-config) and it was recommended to start with the environment variable to avoid changing API.

@ravidbro ravidbro force-pushed the add_cluster_profile branch 2 times, most recently from 11053b7 to c71d76b Compare December 2, 2020 20:30
@romfreiman
Copy link

@ravidbro
Copy link
Author

ravidbro commented Dec 2, 2020

@staebler I updated the enhancement in the PR description and fixed all code comments

@staebler
Copy link
Contributor

staebler commented Dec 2, 2020

openshift/enhancements#543 @staebler

Thanks. I commented on the enhancement.

By the way, if we do end up sticking with using an environment variable, it should have a more specific name, like OPENSHIFT_INSTALL_CLUSTER_PROFILE_OVERRIDE.

@ravidbro
Copy link
Author

ravidbro commented Dec 2, 2020

updated the environment variable name and added a warning

@romfreiman
Copy link

/retest

@@ -38,6 +38,7 @@ MDNS_PUBLISHER_IMAGE=$(image_for mdns-publisher)
HAPROXY_IMAGE=$(image_for haproxy-router)
BAREMETAL_RUNTIMECFG_IMAGE=$(image_for baremetal-runtimecfg)


Copy link
Contributor

Choose a reason for hiding this comment

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

Superfluous newline.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -55,6 +56,7 @@ then

bootkube_podman_run \
--volume "$PWD:/assets:z" \
--env CLUSTER_PROFILE="{{.ClusterProfile}}" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is still somewhat experimental, let's omit the environment variable in the CVO pod unless the user has set the cluster profile.

Copy link
Author

Choose a reason for hiding this comment

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

changed

// Set cluster profile
clusterProfile := ""
if cp := os.Getenv("OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE"); cp != "" {
logrus.Warn("Found override for Cluster Profile. Please be warned.")
Copy link
Member

Choose a reason for hiding this comment

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

Probably want to include %q for cp in this message with:

logrus.Warnf("Found override for Cluster Profile: %q", cp)

No need for Please be warned; it's already a warning-level log, and logrus will set level=warning or whatever.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@romfreiman
Copy link

/retest

Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

I like Trevor's suggestions for fixing up the warning log event. Other than that, it looks good.

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2020
Signed-off-by: Ravid Brown <ravid@redhat.com>
Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: staebler

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

@romfreiman
Copy link

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@romfreiman
Copy link

/retest

1 similar comment
@ravidbro
Copy link
Author

ravidbro commented Dec 4, 2020

/retest

@openshift-merge-robot
Copy link
Contributor

openshift-merge-robot commented Dec 4, 2020

@ravidbro: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-crc 102c615 link /test e2e-crc

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@ravidbro
Copy link
Author

ravidbro commented Dec 4, 2020

/skip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants