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

AGENT-718: Add vSphere credentials to install-config overrides #7593

Merged
merged 7 commits into from Oct 24, 2023

Conversation

rwsu
Copy link
Contributor

@rwsu rwsu commented Oct 13, 2023

If vSphere credentials are present in install-config.yaml, they are passed through as a install-config override annotation in AgentClusterInstall.

If vSphere credentials are not present, then nothing is added to the install-config override.

Requires: #7572

Removed the warnings for vSphere credentials.

Added validations to check
* all required credential fields have been filled in if any are provided
* if failureDomains are defined there is a corresponding vcenter with the same server defined

Added new warnings for new fields LoadBalancer and Hosts.
Agent-based installation allows credentials to be optional.
Platform values are not validated if credentials are not provided.

Folder is now a mandatory field for agent-based installations. It
is optional for IPI and UPI. It is being made mandatory because
if credentials are entered and folder is left unspecified,
assisted-service will substitute in placeholder values for folder.
The placeholder value is "/datacenterplaceholder/vm/folderplaceholder".
When assisted-service generates the install-config, validation
will fail because "datacenterplaceholder" will not match the actual
datacenter that the user entered. Better to make it mandatory
and validate folder is entered when the agent ISO is being created.
Otherwise the user will not realize there is an issue until they
boot up the agent ISO. The issue will not be transparent and only
visible if the user examines the assisted-service container log.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 13, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 13, 2023

@rwsu: This pull request references AGENT-718 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to this:

If vSphere credentials are present in install-config.yaml, they are passed through as a install-config override annotation in AgentClusterInstall.

If vSphere credentials are not present, then nothing is added to the install-config override.

Requires: #7572

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.

}

for _, failureDomain := range vspherePlatform.FailureDomains {
// Although folder is optional in IPI/UPI, it is must be set for agent-based installs.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it must be set

// If it is not set, assisted-service will set a placeholder value for folder:
// "/datacenterplaceholder/vm/folderplaceholder"
//
// When assisted-service generates the install-config to for the cluster, it will fail
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: install-config for the cluster

Copy link
Contributor

@pawanpinjarkar pawanpinjarkar left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pawanpinjarkar

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 18, 2023
// agent-based installation allows the credentials to be optional
if len(p.VCenters) > 0 {
if p.VCenters[0].Username != "" && p.VCenters[0].Password != "" &&
p.VCenters[0].Server != "" && len(p.VCenters[0].Datacenters) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something, but shouldn't there be an OR between these instead of AND? Otherwise it won't catch if one of them is missing and there's no point calling validateVCenters() which checks each value. It actually seems like this whole check should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is a bit confusing here. Let me reword it and change the logic a bit to make it more clear. The goal was to allow credentials to be optional and to not validate if the credentials are not provided. I think this actually belongs in AGENT-717. There is overlapping logic happening here with asset/agent/installconfig.go.

If vSphere credentials are present in install-config.yaml, they
are passed through as a install-config override annotation in
AgentClusterInstall.

If vSphere credentials are not present, then nothing is added to
the install-config override.
@bfournie
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 23, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 04bfff5 and 2 for PR HEAD f308983 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 23, 2023

@rwsu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-e2e-aws-ovn-upgrade 85bfbcd link false /test okd-e2e-aws-ovn-upgrade
ci/prow/okd-e2e-agent-sno-ipv6 85bfbcd link false /test okd-e2e-agent-sno-ipv6
ci/prow/okd-scos-e2e-agent-compact-ipv4 85bfbcd link false /test okd-scos-e2e-agent-compact-ipv4
ci/prow/okd-e2e-agent-compact-ipv4 85bfbcd link false /test okd-e2e-agent-compact-ipv4
ci/prow/okd-scos-e2e-aws-ovn 85bfbcd link false /test okd-scos-e2e-aws-ovn
ci/prow/okd-e2e-aws-ovn 85bfbcd link false /test okd-e2e-aws-ovn
ci/prow/e2e-agent-sno-ipv4-pxe f308983 link false /test e2e-agent-sno-ipv4-pxe
ci/prow/e2e-agent-sno-ipv6 f308983 link false /test e2e-agent-sno-ipv6
ci/prow/e2e-agent-compact-ipv4-none-platform f308983 link false /test e2e-agent-compact-ipv4-none-platform
ci/prow/e2e-agent-ha-dualstack f308983 link false /test e2e-agent-ha-dualstack
ci/prow/e2e-agent-compact-ipv4-appliance f308983 link false /test e2e-agent-compact-ipv4-appliance

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.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD bae6c39 and 1 for PR HEAD f308983 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD ddc240a and 0 for PR HEAD f308983 in total

@openshift-ci openshift-ci bot merged commit cc928f6 into openshift:master Oct 24, 2023
25 of 38 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

4 participants