1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 00:48:45 +01:00

405 Commits

Author SHA1 Message Date
Pablo Fontanilla
5797d192d6 OCPEDGE-1517: add-tnf-agent-based-installer (#9946)
* agent/installconfig: Add two-node-with-fencing topology and refactor
two-node validation

* feat: add override for control plane fencing creds

Signed-off-by: ehila <ehila@redhat.com>

* Add TNF fencing credentials override test

* Update integration test with new validation result

* Update installer verification and tests to only allow URLs with redfish on them for Two Nodes with Fencing topology

* Update validation check for redfish

* Remove simultaneous dual replica feature set restriction

* Update fencing address validation to include port

* Update validation to disallow http

* Update and expand url validation tests

* Revert "Update validation to disallow http"

This reverts commit e9595a8d4f.

* Update variable name

* Update tests

* Add YAML tags to Credential struct for fencing

Add explicit yaml struct tags to the Credential type to ensure proper
YAML serialization with lowercase field names (e.g., 'hostname' instead
of 'hostName'). This is required for the assisted-service to correctly
parse the fencing credentials file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add fencing credentials file generation for TNF clusters

Generate /etc/assisted/hostconfig/fencing-credentials.yaml containing
all fencing credentials from controlPlane.fencing.credentials[]. This
file is embedded in the agent ISO and consumed by assisted-service
during TNF cluster installation.

Key changes:
- Add OptionalInstallConfig to Ignition Dependencies()
- Add addFencingCredentials() function to generate the YAML file
- Call addFencingCredentials() in Generate() after NTP sources
- Add comprehensive unit tests for the new function

The single-file approach avoids directory naming collisions between
MAC-based host directories and hostname-based fencing credentials.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Revert fencing credentials override

The fencing credentials are now passed to assisted-service via the
hostconfig/fencing-credentials.yaml file embedded in the ISO, making
the install-config annotation override unnecessary.

This reverts commits:
- 105b3c95c9 Add TNF fencing credentials override test
- a06d1a766b feat: add override for control plane fencing creds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Improve fencing credentials test coverage

Enhance TestIgnition_addFencingCredentials with:
- File owner verification (assert root ownership)
- Append behavior test with pre-existing files
- Fix misleading test name and add second credential to match
  valid TNF configuration (2 credentials required)
- Remove unused expectError field from test struct

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Support vendor-specific redfish schemes in fencing validation

Vendor-specific redfish schemes like idrac-redfish:// and ilo5-redfish://
use HTTPS (port 443) by default, so they should be valid without an
explicit port number.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* unit tests: Add missing OptionalInstallConfig dependency in ignition test

The TestIgnition_Generate test was panicking because the
OptionalInstallConfig asset was missing from the test dependencies.
This caused dependencies.Get() to return a nil value when the
addFencingCredentials function tried to access it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* agent: Refactor fencing credentials into standalone asset

Move fencing credentials generation from inline ignition.go code into a
proper FencingCredentials asset following the installer's asset pattern.

This refactor:
- Creates pkg/asset/agent/manifests/fencingcredentials.go as a
  WritableAsset with Dependencies, Generate, Files, and Load methods
- Adds comprehensive unit tests in fencingcredentials_test.go
- Integrates FencingCredentials into AgentManifests dependency graph
- Removes addFencingCredentials() from ignition.go
- Adds positive integration test for TNF with fencing credentials
- Changes output path from /etc/assisted/hostconfig/ to
  /etc/assisted/manifests/ (standard manifests location)

The asset automatically returns empty Files() for non-TNF clusters,
so no fencing-credentials.yaml is generated unless fencing is configured.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Improve fencing credentials code quality

- Add explicit YAML library aliasing for clarity (goyaml for marshal,
  k8syaml for unmarshal) with documentation explaining why different
  libraries are used for each operation
- Improve error message to include credential count for debugging
- Add test case for empty fencing credentials array

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Fix CI failures for gofmt and integration tests

- Add blank line between k8s.io and github.com/openshift import groups
  in ignition_test.go to satisfy gci formatting requirements
- Add featureSet: TechPreviewNoUpgrade to tnf_with_fencing_credentials
  integration test to enable the DualReplica feature gate required for
  TNF fencing configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Move fencing credentials to agentconfig package

FencingCredentials is a host-scoped configuration asset, not a
cluster-scoped manifest. Moving it from manifests/ to agentconfig/
aligns with the package's purpose and follows the pattern used by
other host configuration assets like AgentHosts.

This change also updates ignition.go to import from the new location
and removes the now-unused fencing credentials from agent.go manifests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Add FencingCredentials to ignition test dependencies

The TestIgnition_Generate test was failing with a panic because the
FencingCredentials asset was added as a dependency to Ignition.Generate()
but wasn't included in the test's buildIgnitionAssetDefaultDependencies()
helper function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Fix fencing credentials path in integration test

The integration test expected the fencing credentials file at
/etc/assisted/manifests/ but assisted-service reads it from
/etc/assisted/hostconfig/ (HOST_CONFIG_DIR default). The installer
correctly embeds the file at hostconfig/, so the test expectation
was wrong.

Changed test path from manifests to hostconfig to match both the
installer implementation and assisted-service expectations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Add nolint directive for gosec G101 false positive

The gosec linter flags fencingCredentialsFilename as "potential
hardcoded credentials" (G101) because the variable name contains
"credentials". This is a false positive - the variable contains
a filename string, not actual credentials.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* agent: Fix expected YAML field order in TNF integration test

The expected fencing-credentials.yaml had fields in a different order
than the actual YAML serialization output. Updated the expected file
to match the actual field order: hostname, username, password, address,
certificateVerification.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Signed-off-by: ehila <ehila@redhat.com>
Co-authored-by: ehila <ehila@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-02-05 12:30:34 +00:00
Vincenzo Mauro
ef751a9235 Add support for platform External in TNA clusters 2026-02-04 15:15:38 +01:00
Vincenzo Mauro
bb7d56e927 Added support for platform None in TNA clusters 2026-01-19 16:05:04 +01:00
Gaoyun Pei
15d1d85a87 OCPBUGS-66943: Validate cluster name against Azure reserved words (#10221)
* azure: validate cluster name against Azure reserved words

  Azure prohibits the use of certain reserved words and trademarks
  in resource names. This change adds validation to reject cluster
  names containing any of the 43 reserved words documented by Azure,
  preventing deployment failures with ReservedResourceName errors.

  Reserved words checked include:
  - Complete reserved words (40): AZURE, OFFICE, EXCHANGE, etc.
  - Substring forbidden (2): MICROSOFT, WINDOWS
  - Prefix forbidden (1): LOGIN

* update the checking logic on reserved words

* fix the gofmt issues
2026-01-15 04:17:16 +00:00
Honza Pokorny
5f377f6898 baremetal: allow multi-arch 2025-12-09 17:10:33 -04:00
openshift-merge-bot[bot]
3b6ba6b3d0 Merge pull request #9924 from cybertron/disable-internal-dns
OPNET-678: Allow disabling internal DNS
2025-12-03 01:02:56 +00:00
barbacbd
f256cf8e21 no-jira: Remove the GCP Custom Endpoints Feature Gate
** Remove the validation when the `endpoint` field is filled out in install-config.
The feature has been tested and the feature gate should no longer be required.

** Remove the test for the featuregate.
2025-11-20 09:16:10 -05:00
openshift-merge-bot[bot]
18c57a015f Merge pull request #9806 from hamzy/PowerVC-add-new-type
MULTIARCH-5358: PowerVC: Add new platform for PowerVC
2025-11-20 09:00:13 +00:00
Ben Nemec
8f91fb56a4 OPNET-678: Allow disabling internal DNS
Wire in the internalDNSRecords API field to install-config so we can
disable the internal DNS records for deployments using a
user-managed loadbalancer.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 11:10:51 -06:00
Mark Hamzy
0324f33df0 PowerVC: Add new platform for PowerVC
PowerVC is an OpenStack based cloud provider with some significant
differences.  Since we can use the OpenStack provider for most of the
work, we will create a thin provider which will only handle the
differences.
2025-11-19 08:57:03 -06:00
barbacbd
2b8f0c7b43 CORS-4282: Remove the installer gcp service endpoints.
Service endpoints are no longer needed in favor of the PSCEndpoint.
2025-11-13 06:40:30 -05:00
openshift-merge-bot[bot]
4180662515 Merge pull request #10060 from patrickdillon/capi-one-eleven
CORS-4262: update openshift/api & capi v1.11
2025-11-13 03:23:32 +00:00
John Hixson
f09aa9e069 pkg/types/valication: explain overlapping internal subnets better
Let users know what to do when they get an overlapping subnet error.

https://issues.redhat.com/browse/OCPBUGS-61167
2025-11-11 18:34:37 -08:00
Patrick Dillon
cc99514053 unit tests: fix breakage caused by client-go & apimachinery bump
Changes in the apimachinery and client-go packages broke our unit
tests after upgrade. client-go stopped serializing the empty
preferences: {} field for the kubeconfig. apimachinery, with
c58e197ee8
caused much more extensive breakage by changing the format with
which errors are returned, and our unit tests hard code the
expected error messages.

For the most part, I used claude to fix these issues, and here
is the summary it created:

Changes Made
Root Cause: The k8s apimachinery package (errors.go:93-96) now uses json.Marshal()
to format BadValue in error messages instead of Go's native format. Error Format Changes:

Arrays: []string{"a", "b"} → ["a","b"] (JSON format, no spaces)
Nil values: []string(nil) → null
Structs: aws.Subnet{ID:"x", Roles:...} → {"id":"x"} (JSON with lowercase keys)
Custom types: gcp.OSImage{Name:"x", Project:"y"} → {"name":"x","project":"y"}
2025-11-07 09:03:40 -05:00
Sandhya Dasu
fb1c669263 Add a way to configure a fallback policy for imageDigestSources
1. Add an install-config option to specify `sourcePolicy` that
captures user's intention regarding the fallback policy when there
is an error getting images from the mirror
2. Update the ImageDigestcwMirrorSet manifest with this policy. API
changes were not required because this value was already present in
the API.
3. Update logic to translate from deprecated `imageContentSources`
to `imageDigestSources` with the new `sourcePolicy` in place.
4. Updated install-config validation and tests for this new field.
2025-11-04 14:39:03 -05:00
openshift-merge-bot[bot]
c36c0d7600 Merge pull request #9734 from shiftstack/OCPBUGS-43783
OSASINFRA-3915: openstack: Start setting CredentialsMode
2025-10-14 03:27:57 +00:00
Sandhya Dasu
a7a0ea8ec1 Allow IPv6 Primary DualStack installs on platforms None & External 2025-10-01 10:43:46 -04:00
Sandhya Dasu
6aff3053d7 Remove GCPClusterHostedDNSInstall featuregate
Remove check for this featuregate since the feature has been
promoted to GA.
2025-09-16 10:08:08 -04:00
Sandhya Dasu
db2052c5ab CORS-4084: Azure custom-dns: Add userProvisionedDNS as install-config parameter
This feature is currently available when feature gate
AzureClusterHostedDNSInstall is enabled.
2025-08-01 12:32:10 -04:00
Sandhya Dasu
573b8dd346 Update to use the renamed featuregates 2025-07-30 09:40:43 -04:00
Joseph Callen
a5c9a11fe7 Setup disks via MachineConfigs
Added platform-agnostic multi-disk support using Ignition configuration embedded in MachineConfigs
Created new disk types: etcd, swap, and user-defined disks
Implemented disk setup validation and feature gates
Added machine config generation for disk provisioning

Review and unit tests were assisted-by: cursor
2025-07-28 08:05:09 -04:00
Stephen Finucane
6c83f9f3ef openstack: Start setting CredentialsMode
This is done for the other platforms. Do it now for OpenStack.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-16 16:46:03 +01:00
openshift-merge-bot[bot]
fe225d16ee Merge pull request #9438 from shiftstack/OSASINFRA-3238
OSASINFRA-3238: Improve API and Ingress VIPs validation
2025-07-03 07:16:31 +00:00
Joseph Callen
b1702662d4 Azure: add mpool datadisks
This PR adds to the machinepool a new field datadisks
to allow a user to add additional disks at installation
time
2025-07-01 13:23:53 -04:00
openshift-merge-bot[bot]
270b9baf77 Merge pull request #9770 from jhixson74/main-multi-ssh-key-validate
OCPBUGS-56616: pkg/types/validation: Validate all SSH public keys
2025-06-09 19:49:36 +00:00
John Hixson
1795f39ea2 pkg/types/validation: Validate all SSH public keys
If multiple SSH public keys are configured in the install-config,
validate them all.

https://issues.redhat.com/browse/OCPBUGS-56616
2025-06-04 20:24:29 -07:00
Richard Vanderpool
b4249e7054 dropping test FencingCredentials is allowed with TechPreviewNoUpgrade Feature Set to correlate with openshift/api#2283 2025-05-30 09:40:42 -04:00
barbacbd
88e984e574 CORS-4066: Remove the function to check if multiarch is enabled/allowed
** The function was a switch that returns true if the platform is gcp or aws. This
can be a simple check in the function that uses this value.
2025-05-28 10:40:38 -04:00
Jeremy Poulin
5cd91682b0 OCPEDGE-1673: [TNF] Render secret manifests from fencing credentials.
In Two Node OpenShift with Fencing (TNF), we need to render secrets to the
openshift-etcd namespace to later be consumed by the openshift-etcd-operator to
initialize pacemaker. This PR consumes the secrets from the install-config and
attempts to render a new secret file to the openshift-etcd namespace. I've also
included a few updates to the tests for the fencing.credentials block for
completeness.

Depends on https://github.com/openshift/installer/pull/9640
2025-05-08 14:17:24 -04:00
Michael Shitrit
c88d870ce9 Apply review feedback
- Modify SSL Certification to be enum instead of boolean

Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-04-29 17:00:30 +03:00
Michael Shitrit
2d7d333783 Add disable cert API
Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-04-29 16:59:46 +03:00
dkokkino
e5e6a677c5 Improve API and Ingress VIPs validation
• This commit enhances VIPs validation to ensure the primary IP
family of the VIPs matches the primary IP family of all the network fields.
• Code repurposed from prior closed PR (#7504)

Co-Authored-By: Maysa Macedo <mdemaced@redhat.com>
Co-Authored-By: Danny Kokkinos <dkokkino@redhat.com>
2025-04-17 12:46:13 +02:00
Jeremy Poulin
1a19befc65 OCPEDGE-1749: [TNF] Updated bare-metal init sequence to detach control-plane nodes in Two Node OpenShift.
Two Node OpenShift (TNF) is DevPreview in 4.19. In order to ensure that ironic doesn't try to manage
the power state of the nodes, we add a check for the DualReplica topology after the control-plane nodes
are provisioned during bootstrapping and detach them from ironic.

In a future release, when fencing is enabled, it will be important to enforce that this remains an invariant
for the DualReplica control-plane topology. There is currently nothing preventing the annotation that detaches
these nodes from being removed.
2025-04-15 08:57:16 -04:00
Michael Shitrit
18da135464 Allow platform External to use fencing credentials
Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-04-06 10:23:07 +03:00
Michael Shitrit
bb93afa1ca Merge branch 'main' into additional-platform-validations 2025-04-06 10:05:25 +03:00
Patrick Dillon
85d542c8cb CORS-3883: remove SystemAssigned ID (#9606)
* pkg/types/azure: remove SystemAssigned ID

SystemAssigned Identities are not supported in any capacity in MAPZ.
Due to that they were feature gated for future CAPZ->MAPZ transition.
The CAPZ Identity API creates further issues in that, the value to be
used for name/scope is unclear and when deleting clusters the
role assignment of the identity is leaked.

No users have asked for this functionality, so lets revert it to
reduce our complexity and load.

* fixup! pkg/types/azure: remove SystemAssigned ID
2025-04-05 03:56:57 +00:00
openshift-merge-bot[bot]
7f928a3627 Merge pull request #9615 from zaneb/path-case
OCPBUGS-54407: Use correct case in path error messages
2025-04-03 20:10:04 +00:00
Michael Shitrit
7ad853613b Addressing review feedback
Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-04-03 15:30:56 +03:00
ehila
882a0001ec fix: update tnf validation to account for tna install config
Signed-off-by: ehila <ehila@redhat.com>
2025-04-02 17:31:09 -04:00
Zane Bitter
82b500b9d5 OCPBUGS-54407: Use correct case in path error messages
Users care about the key names in YAML, not in the golang structs.
2025-04-02 23:58:08 +13:00
Michael Shitrit
e12c2b74da Add Platform based validations
- In BareMetal Hosts mutually exclusive with fencing
- Fencing only supported in none/bm

Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-04-01 13:01:44 +03:00
openshift-merge-bot[bot]
4dc3c0294f Merge pull request #9537 from yanhua121/OCPSTRAT-367
AGENT-587: Support Nutanix in Agent-based Installer
2025-04-01 01:35:54 +00:00
Yanhua Li
8208a189f7 AGENT-587: Support Nutanix in Agent-based Installer 2025-03-28 12:22:06 -04:00
Michael Shitrit
aa8f71827c Merge branch 'main' into fencing-config-platform-none 2025-03-23 09:42:53 +02:00
openshift-merge-bot[bot]
b6f02329ac Merge pull request #9538 from patrickdillon/azure-identity-cors-3878
CORS-3883, CORS-3861, CORS-3937: Azure Machine Identity API
2025-03-22 08:35:14 +00:00
Patrick Dillon
e5b6e0a750 pkg/types/azure: validate azure vm identitiy
Adds static (non-API driven) validations for VM identities.
2025-03-21 11:00:37 -04:00
Patrick Dillon
d5ea6b666b azure: feature gate VM identities
CAPZ supports system-assigned identities and multiple user-assigned
identities, but MAPI supports neither. MAPI manages control-plane
nodes day-2 via the control-plane machineset operator. So we cannot
currently support these features even for control-plane nodes as
the identities would be unrecoverable if the nodes are recreated
day 2.

As MAPI is in process of migrating to CAPI, this commit puts these
configurations behind a feature gate so that they may be unlocked
in the MAPI->CAPI migration.
2025-03-21 11:00:36 -04:00
Michael Shitrit
e2e3ccf8c2 Apply review feedback
- refactor some method location for clearer code
- use feature gate in a better structured way to align with standards
- Add compute validation
- tests for added changes
- use log in a old legacy method
- better API description

Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-03-21 08:08:20 +02:00
Michael Shitrit
b8edc890a6 Refactor Structure
- Fencing credentials refactored to a Fencing parent holding a list of credentials
- Fencing credentials moved under ControlPlane
- Validations and tests updated

Signed-off-by: Michael Shitrit <mshitrit@redhat.com>
2025-03-19 16:09:40 +02:00
vr4manta
b2320db6f4 Removed VSphereStaticIPs feature gate 2025-03-17 07:50:25 -04:00