Skip to content

feat: Support passing node selectors and tolerations to hypershift install cmd#7404

Open
ashishmax31 wants to merge 1 commit into
openshift:mainfrom
ashishmax31:ARO-23223
Open

feat: Support passing node selectors and tolerations to hypershift install cmd#7404
ashishmax31 wants to merge 1 commit into
openshift:mainfrom
ashishmax31:ARO-23223

Conversation

@ashishmax31
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Allow passing node selectors and tolerations to hypershift install cmd so that we can influence the placement of the HO pods.

Fixes

https://issues.redhat.com/browse/ARO-23223

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 17, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 17, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 17, 2025

Walkthrough

Added support for operator tolerations and node selectors: new fields on install Options and HyperShiftOperatorDeployment, parsing and validation of toleration strings and node selector keys/values, propagation into deployment Build(), and corresponding tests and utilities.

Changes

Cohort / File(s) Change Summary
Deployment configuration
cmd/install/assets/hypershift_operator.go
Added OperatorTolerations []string and OperatorNodeSelectors map[string]string to HyperShiftOperatorDeployment. Build() now parses toleration strings, collects node selectors, and applies them to deployment.Spec.Template.Spec.Tolerations and deployment.Spec.Template.Spec.NodeSelector.
Install command (options & validation)
cmd/install/install.go
Added OperatorTolerations []string and OperatorNodeSelectors map[string]string to Options. Added CLI flags and defaults, propagated fields through operator resource setup, and introduced validation helpers: validateTolerationString, validateTolerationKeyValuePart, validateTolerationEffectPart, validateTolerationSecondsPart, validateNodeSelectorKey, validateNodeSelectorValue. Added imports (slices, k8s.io/apimachinery/pkg/util/validation).
Utility parsing
cmd/util/util.go
Added ParseTolerationString(s string) *corev1.Toleration and internal helper setTolerationKeyValueAndEffect to parse strings of forms key[=value]:effect and key[=value]:effect:seconds and return a *corev1.Toleration. Added strings and strconv imports.
Tests – deployment
cmd/install/assets/hypershift_operator_test.go
Extended test cases and table with expectedTolerations and expectedNodeSelectors; added case for operator tolerations and node selectors, adjusted assertions to conditionally verify tolerations and node selectors; added ptr import.
Tests – install options
cmd/install/install_test.go
Added test cases to TestOptions_Validate covering valid and invalid operator tolerations and node selectors, including mixed scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added do-not-merge/needs-area area/cli Indicates the PR includes changes for CLI and removed do-not-merge/needs-area labels Dec 17, 2025
@muraee
Copy link
Copy Markdown
Contributor

muraee commented Dec 17, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 17, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
cmd/util/util.go (1)

46-86: Consider extracting duplicate key/value parsing logic.

The key=value parsing logic is duplicated in both the 2-part and 3-part branches (lines 53-61 and 68-76). While the current implementation works correctly, extracting this into a helper function would improve maintainability.

Example refactor:

+func parseTolerationKeyValue(part string) (key, value string, operator corev1.TolerationOperator) {
+	if strings.Contains(part, "=") {
+		kv := strings.SplitN(part, "=", 2)
+		return kv[0], kv[1], corev1.TolerationOpEqual
+	}
+	return part, "", corev1.TolerationOpExists
+}
+
 func ParseTolerationString(s string) corev1.Toleration {
 	toleration := corev1.Toleration{}
 	parts := strings.Split(s, ":")
 
 	// No toleration seconds
 	if len(parts) == 2 {
-		if strings.Contains(parts[0], "=") {
-			kv := strings.SplitN(parts[0], "=", 2)
-			toleration.Key = kv[0]
-			toleration.Value = kv[1]
-			toleration.Operator = corev1.TolerationOpEqual
-		} else {
-			toleration.Key = parts[0]
-			toleration.Operator = corev1.TolerationOpExists
-		}
+		toleration.Key, toleration.Value, toleration.Operator = parseTolerationKeyValue(parts[0])
 		toleration.Effect = corev1.TaintEffect(parts[1])
 	}
 
 	// With toleration seconds
 	if len(parts) == 3 {
-		if strings.Contains(parts[0], "=") {
-			kv := strings.SplitN(parts[0], "=", 2)
-			toleration.Key = kv[0]
-			toleration.Value = kv[1]
-			toleration.Operator = corev1.TolerationOpEqual
-		} else {
-			toleration.Key = parts[0]
-			toleration.Operator = corev1.TolerationOpExists
-		}
+		toleration.Key, toleration.Value, toleration.Operator = parseTolerationKeyValue(parts[0])
 		toleration.Effect = corev1.TaintEffect(parts[1])
 		tolerationSeconds, _ := strconv.ParseInt(parts[2], 10, 64)
 		if tolerationSeconds > 0 {
 			toleration.TolerationSeconds = &tolerationSeconds
 		}
 	}
 	return toleration
 }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 88e53d2 and d926516.

📒 Files selected for processing (5)
  • cmd/install/assets/hypershift_operator.go (4 hunks)
  • cmd/install/assets/hypershift_operator_test.go (3 hunks)
  • cmd/install/install.go (7 hunks)
  • cmd/install/install_test.go (1 hunks)
  • cmd/util/util.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • cmd/util/util.go
  • cmd/install/install.go
  • cmd/install/install_test.go
  • cmd/install/assets/hypershift_operator_test.go
  • cmd/install/assets/hypershift_operator.go
🧬 Code graph analysis (3)
cmd/install/install_test.go (2)
cmd/install/install.go (1)
  • Options (79-139)
api/hypershift/v1beta1/hostedcluster_types.go (1)
  • NonePlatform (1215-1215)
cmd/install/assets/hypershift_operator_test.go (2)
cmd/install/assets/hypershift_operator.go (1)
  • HyperShiftOperatorDeployment (386-427)
api/hypershift/v1beta1/hostedcluster_types.go (1)
  • NonePlatform (1215-1215)
cmd/install/assets/hypershift_operator.go (1)
cmd/util/util.go (1)
  • ParseTolerationString (47-86)
🪛 golangci-lint (2.5.0)
cmd/install/install.go

[error] 228-228: : # github.com/openshift/hypershift/sync-global-pullsecret [github.com/openshift/hypershift/sync-global-pullsecret.test]
sync-global-pullsecret/sync-global-pullsecret_test.go:228:23: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:234:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:247:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:257:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:270:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:283:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:296:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:309:26: undefined: MockdbusConn
sync-global-pullsecret/sync-global-pullsecret_test.go:327:12: undefined: NewMockdbusConn

(typecheck)

🔇 Additional comments (11)
cmd/install/install_test.go (1)

143-185: LGTM! Comprehensive test coverage for tolerations and node selectors.

The test cases effectively cover validation scenarios for both valid and invalid operator tolerations and node selectors, including edge cases like mixed valid/invalid tolerations and malformed keys.

cmd/install/assets/hypershift_operator_test.go (2)

437-483: LGTM! Well-structured test case for tolerations and node selectors.

The test case effectively validates both toleration formats (with and without values, with TolerationSeconds) and node selector application on the deployment.


493-498: LGTM! Proper conditional assertions.

The conditional checks ensure tolerations and node selectors are only validated when explicitly provided in test cases, preventing false positives.

cmd/install/assets/hypershift_operator.go (3)

406-407: LGTM! Appropriate field types for tolerations and node selectors.

The field types align well with the CLI input format and downstream usage.


617-628: LGTM! Proper parsing and filtering of tolerations and node selectors.

The implementation correctly:

  • Parses toleration strings using the utility function
  • Filters out empty tolerations
  • Preserves non-empty keys from node selectors (empty values are valid)

841-847: LGTM! Correct application of tolerations and node selectors to deployment.

The conditional application ensures these fields are only set when values are provided, maintaining clean deployment specs.

cmd/install/install.go (5)

254-287: LGTM! Comprehensive toleration string validation.

The validation correctly handles both toleration formats and provides clear error messages for each failure mode.


289-351: LGTM! Thorough validation helper functions.

The helper functions correctly validate each component of the toleration string using appropriate Kubernetes validators and provide clear error messages.


427-428: LGTM! Appropriate CLI flags for tolerations and node selectors.

The flags use correct types (StringSliceVar and StringToStringVar) and provide clear descriptions with format examples.


500-501: LGTM! Correct default initialization.

Initializing as empty slice and map ensures proper handling when flags are not provided.


974-975: LGTM! Fields correctly propagated to deployment.

The operator tolerations and node selectors are properly passed through to the HyperShiftOperatorDeployment builder.

Comment thread cmd/install/assets/hypershift_operator.go Outdated
Comment thread cmd/util/util.go Outdated
@ashishmax31
Copy link
Copy Markdown
Contributor Author

@muraee Ptal, i've addressed your review comments.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 26, 2025
@muraee
Copy link
Copy Markdown
Contributor

muraee commented Jan 8, 2026

/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashishmax31, muraee

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Jan 8, 2026
@ashishmax31 ashishmax31 marked this pull request as ready for review January 9, 2026 10:12
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 9, 2026
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2026
@openshift-ci openshift-ci Bot requested review from enxebre and muraee January 9, 2026 10:13
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @cmd/install/install.go:
- Around line 239-256: The toleration validation is inconsistent with the
parser: validateTolerationSecondsPart currently allows 0 and
validateTolerationString permits a trailing :seconds for any effect, but the
parser only applies seconds when >0 and Kubernetes semantics only allow
tolerationSeconds for effect=NoExecute; update validateTolerationSecondsPart to
reject zero (require >0) and adjust validateTolerationString to only accept a
:seconds suffix when the parsed effect is "NoExecute" (and reject or error if
seconds are present for other effects), ensuring all error messages reference
the offending toleration string via the same fmt.Errorf wrapping used elsewhere.
- Around line 452-453: The help text for the --operator-tolerations flag is
incorrect; update the PersistentFlags().StringSliceVar call for
opts.OperatorTolerations so the description documents the actual expected format
"key[=value]:effect[:seconds]" and note that the operator (Exists vs Equal) is
inferred by presence/absence of '=' (no operator token). Keep the flag name
(--operator-tolerations) and opts.OperatorTolerations unchanged; only replace
the descriptive string to accurately describe key[=value]:effect[:seconds].
🧹 Nitpick comments (2)
cmd/install/assets/hypershift_operator_test.go (1)

493-498: Tests should assert absence of tolerations/nodeSelector in other cases (don’t skip checks)
The if len(...) > 0 gating reduces regression coverage; most cases can/should still assert Tolerations/NodeSelector are empty/nil.

Proposed diff
 			g.Expect(deployment.Spec.Template.Spec.Volumes).To(BeEquivalentTo(test.expectedVolumes))
 			g.Expect(deployment.Spec.Template.Spec.Containers[0].VolumeMounts).To(BeEquivalentTo(test.expectedVolumeMounts))
 			g.Expect(deployment.Spec.Template.Spec.Containers[0].Env).To(ContainElements(test.expectedEnvVars))
-			if len(test.expectedTolerations) > 0 {
-				g.Expect(deployment.Spec.Template.Spec.Tolerations).To(BeEquivalentTo(test.expectedTolerations))
-			}
-			if len(test.expectedNodeSelectors) > 0 {
-				g.Expect(deployment.Spec.Template.Spec.NodeSelector).To(BeEquivalentTo(test.expectedNodeSelectors))
-			}
+			g.Expect(deployment.Spec.Template.Spec.Tolerations).To(BeEquivalentTo(test.expectedTolerations))
+			g.Expect(deployment.Spec.Template.Spec.NodeSelector).To(BeEquivalentTo(test.expectedNodeSelectors))
 		})
 	}
 }
cmd/install/assets/hypershift_operator.go (1)

430-432: Defensive handling: trim/skip empty inputs; avoid silently ignoring unparsable tolerations
Given Build() can be called outside the CLI validation path, consider trimming and skipping empty strings/keys to reduce “it didn’t apply” surprises.

Proposed diff
 	var volumes []corev1.Volume
 	var tolerations []corev1.Toleration
 	var nodeSelectors = make(map[string]string)
 	envVars := []corev1.EnvVar{
@@
-	for _, tolerationStr := range o.OperatorTolerations {
-		toleration := cmdutil.ParseTolerationString(tolerationStr)
+	for _, tolerationStr := range o.OperatorTolerations {
+		tolerationStr = strings.TrimSpace(tolerationStr)
+		if tolerationStr == "" {
+			continue
+		}
+		toleration := cmdutil.ParseTolerationString(tolerationStr)
 		if toleration != nil {
 			tolerations = append(tolerations, *toleration)
 		}
 	}
 
 	for key, value := range o.OperatorNodeSelectors {
-		if key != "" {
-			nodeSelectors[key] = value
+		key = strings.TrimSpace(key)
+		value = strings.TrimSpace(value)
+		if key != "" {
+			nodeSelectors[key] = value
 		}
 	}

Also applies to: 473-475, 662-673, 886-892

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d926516 and 308b227.

📒 Files selected for processing (5)
  • cmd/install/assets/hypershift_operator.go
  • cmd/install/assets/hypershift_operator_test.go
  • cmd/install/install.go
  • cmd/install/install_test.go
  • cmd/util/util.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/install/install_test.go
  • cmd/util/util.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • cmd/install/assets/hypershift_operator_test.go
  • cmd/install/install.go
  • cmd/install/assets/hypershift_operator.go
🧬 Code graph analysis (2)
cmd/install/assets/hypershift_operator_test.go (2)
cmd/install/assets/hypershift_operator.go (1)
  • HyperShiftOperatorDeployment (410-453)
api/hypershift/v1beta1/hostedcluster_types.go (1)
  • NonePlatform (1220-1220)
cmd/install/assets/hypershift_operator.go (1)
cmd/util/util.go (1)
  • ParseTolerationString (47-64)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Red Hat Konflux / hypershift-operator-main-on-pull-request
  • GitHub Check: Red Hat Konflux / hypershift-release-mce-211-on-pull-request
  • GitHub Check: Red Hat Konflux / hypershift-cli-mce-211-on-pull-request
🔇 Additional comments (2)
cmd/install/assets/hypershift_operator_test.go (1)

19-27: Good coverage for tolerations/nodeSelector propagation
The new test case exercises both key=value:effect and keyOnly:NoExecute:seconds toleration forms and validates node selector propagation; this aligns well with the intended feature.

Also applies to: 437-483

cmd/install/install.go (1)

140-142: Wiring + defaults look correct
Defaults initialize the new fields, validation runs, and values are propagated into assets.HyperShiftOperatorDeployment.

Also applies to: 531-533, 1037-1038

Comment thread cmd/install/install.go
Comment on lines +239 to +256
if len(o.OperatorTolerations) > 0 {
for _, tolerationStr := range o.OperatorTolerations {
if err := validateTolerationString(tolerationStr); err != nil {
errs = append(errs, fmt.Errorf("invalid operator toleration '%s': %w", tolerationStr, err))
}
}
}

if len(o.OperatorNodeSelectors) > 0 {
for nodeSelectorKey, nodeSelectorValue := range o.OperatorNodeSelectors {
if err := validateNodeSelectorKey(nodeSelectorKey); err != nil {
errs = append(errs, fmt.Errorf("invalid operator node selector key '%s': %w", nodeSelectorKey, err))
}
if err := validateNodeSelectorValue(nodeSelectorValue); err != nil {
errs = append(errs, fmt.Errorf("invalid operator node selector value '%s': %w", nodeSelectorValue, err))
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Align tolerationSeconds validation with parsing/semantics (effect+zero handling)
Today validateTolerationSecondsPart allows 0, and validateTolerationString allows :seconds with any effect—while parsing (per cmd/util/util.go snippet) only applies seconds when >0, which can silently change meaning.

Proposed diff (fail fast, consistent with current parser)
 func validateTolerationString(s string) error {
@@
 	// Validate effect part
 	if err := validateTolerationEffectPart(parts[1]); err != nil {
 		return err
 	}
 
 	// Validate tolerationSeconds part (if present)
 	if len(parts) == 3 {
+		if parts[1] != string(corev1.TaintEffectNoExecute) {
+			return fmt.Errorf("tolerationSeconds is only valid with effect %s", corev1.TaintEffectNoExecute)
+		}
 		if err := validateTolerationSecondsPart(parts[2]); err != nil {
 			return err
 		}
 	}
@@
 func validateTolerationSecondsPart(tolerationSecondsStr string) error {
 	if tolerationSecondsStr == "" {
 		return fmt.Errorf("tolerationSeconds cannot be empty when specified")
 	}
@@
-	if seconds < 0 {
-		return fmt.Errorf("tolerationSeconds must be non-negative, got %d", seconds)
+	if seconds <= 0 {
+		return fmt.Errorf("tolerationSeconds must be positive, got %d", seconds)
 	}
 
 	return nil
 }

Also applies to: 276-309, 341-373

🤖 Prompt for AI Agents
In @cmd/install/install.go around lines 239 - 256, The toleration validation is
inconsistent with the parser: validateTolerationSecondsPart currently allows 0
and validateTolerationString permits a trailing :seconds for any effect, but the
parser only applies seconds when >0 and Kubernetes semantics only allow
tolerationSeconds for effect=NoExecute; update validateTolerationSecondsPart to
reject zero (require >0) and adjust validateTolerationString to only accept a
:seconds suffix when the parsed effect is "NoExecute" (and reject or error if
seconds are present for other effects), ensuring all error messages reference
the offending toleration string via the same fmt.Errorf wrapping used elsewhere.

Comment thread cmd/install/install.go
Comment on lines +452 to +453
cmd.PersistentFlags().StringSliceVar(&opts.OperatorTolerations, "operator-tolerations", opts.OperatorTolerations, "A list of tolerations to apply to the HyperShift Operator deployment in the format 'key1=value1:effect:operator,key2=value2:effect:operator'.")
cmd.PersistentFlags().StringToStringVar(&opts.OperatorNodeSelectors, "operator-node-selectors", opts.OperatorNodeSelectors, "Set of node selectors to apply to the HyperShift Operator deployment in the format 'key1=value1,key2=value2'.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix --operator-tolerations flag help text: it documents the wrong format
The current description mentions ...:effect:operator but the code expects key[=value]:effect[:seconds] (and operator is inferred from presence of =).

Proposed diff
-	cmd.PersistentFlags().StringSliceVar(&opts.OperatorTolerations, "operator-tolerations", opts.OperatorTolerations, "A list of tolerations to apply to the HyperShift Operator deployment in the format 'key1=value1:effect:operator,key2=value2:effect:operator'.")
+	cmd.PersistentFlags().StringSliceVar(&opts.OperatorTolerations, "operator-tolerations", opts.OperatorTolerations, "A list of tolerations to apply to the HyperShift Operator deployment in the format 'key[=value]:effect[:tolerationSeconds]' (e.g. 'infra=true:NoSchedule', 'keyOnly:NoExecute:3600').")
 	cmd.PersistentFlags().StringToStringVar(&opts.OperatorNodeSelectors, "operator-node-selectors", opts.OperatorNodeSelectors, "Set of node selectors to apply to the HyperShift Operator deployment in the format 'key1=value1,key2=value2'.")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cmd.PersistentFlags().StringSliceVar(&opts.OperatorTolerations, "operator-tolerations", opts.OperatorTolerations, "A list of tolerations to apply to the HyperShift Operator deployment in the format 'key1=value1:effect:operator,key2=value2:effect:operator'.")
cmd.PersistentFlags().StringToStringVar(&opts.OperatorNodeSelectors, "operator-node-selectors", opts.OperatorNodeSelectors, "Set of node selectors to apply to the HyperShift Operator deployment in the format 'key1=value1,key2=value2'.")
cmd.PersistentFlags().StringSliceVar(&opts.OperatorTolerations, "operator-tolerations", opts.OperatorTolerations, "A list of tolerations to apply to the HyperShift Operator deployment in the format 'key[=value]:effect[:tolerationSeconds]' (e.g. 'infra=true:NoSchedule', 'keyOnly:NoExecute:3600').")
cmd.PersistentFlags().StringToStringVar(&opts.OperatorNodeSelectors, "operator-node-selectors", opts.OperatorNodeSelectors, "Set of node selectors to apply to the HyperShift Operator deployment in the format 'key1=value1,key2=value2'.")
🤖 Prompt for AI Agents
In @cmd/install/install.go around lines 452 - 453, The help text for the
--operator-tolerations flag is incorrect; update the
PersistentFlags().StringSliceVar call for opts.OperatorTolerations so the
description documents the actual expected format "key[=value]:effect[:seconds]"
and note that the operator (Exists vs Equal) is inferred by presence/absence of
'=' (no operator token). Keep the flag name (--operator-tolerations) and
opts.OperatorTolerations unchanged; only replace the descriptive string to
accurately describe key[=value]:effect[:seconds].

@ashishmax31
Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2026
@openshift-merge-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

3 similar comments
@openshift-merge-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

…stall cmd

Signed-off-by: Ashish <asnaraya@redhat.com>
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

@ashishmax31: 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/verify 308b227 link true /test verify
ci/prow/e2e-aws-upgrade-hypershift-operator 308b227 link true /test e2e-aws-upgrade-hypershift-operator
ci/prow/e2e-aks 308b227 link true /test e2e-aks
ci/prow/e2e-aws 308b227 link true /test e2e-aws
ci/prow/unit 308b227 link true /test unit
ci/prow/e2e-azure-self-managed 308b227 link true /test e2e-azure-self-managed
ci/prow/images 917d112 link true /test images
ci/prow/security 917d112 link true /test security

Full PR test history. Your PR dashboard.

Details

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

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

PR needs rebase.

Details

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-sigs/prow repository.

@hypershift-jira-solve-ci
Copy link
Copy Markdown

Now I have the complete picture. Let me produce the final report.

Test Failure Analysis Complete

Job Information

  • Prow Job: pull-ci-openshift-hypershift-main-security
  • Build ID: 2053896784232583168
  • PR: #7404feat: Support passing node selectors and tolerations to hypershift install cmd
  • Branch: ARO-23223main
  • PR Head SHA: 917d1128f54c4ae89b870d1fa3f0defb2076ca90
  • Main SHA at test time: f16ca0d22941d58a170aaa4b1471b1456017c7c8

Test Failure Analysis

Error

$ git merge --no-ff 917d1128f54c4ae89b870d1fa3f0defb2076ca90
Auto-merging cmd/install/assets/hypershift_operator.go
Auto-merging cmd/install/install.go
CONFLICT (content): Merge conflict in cmd/install/install.go
Auto-merging cmd/install/install_test.go
Automatic merge failed; fix conflicts and then commit the result.
# Error: exit status 1

Summary

Both failing checks (ci/prow/security and tide) fail for the same root cause: a git merge conflict in cmd/install/install.go between PR #7404 and the current main branch. The CI clone step cannot merge the PR branch into main because PR #8436 ("Add render-sensitive flag") merged into main on 2026-05-07 and modified the exact same location in the Options struct where PR #7404 adds its new fields. No test code ever ran — the job failed at the git setup phase before any build or test execution began.

Root Cause

The merge conflict occurs in cmd/install/install.go in the Options struct definition (around line 155).

PR #7404 adds two new fields immediately after ScaleFromZeroCredentialsSecretKey:

ScaleFromZeroCredentialsSecretKey         string
OperatorTolerations                       []string    // added by PR #7404
OperatorNodeSelectors                     map[string]string  // added by PR #7404

PR #8436 (merged 2026-05-07) also added a field at the exact same location:

ScaleFromZeroCredentialsSecretKey         string
RenderSensitive                           bool        // added by PR #8436

Both PRs insert new struct fields at the same insertion point (after ScaleFromZeroCredentialsSecretKey, before the closing brace of the Options struct). Git cannot automatically resolve which order to place these additions, resulting in a content conflict.

The tide error is a direct consequence — tide is the automated merge bot and it reports state: error because it cannot merge a PR that has unresolvable conflicts with the base branch.

Note: The ci/prow/images job (build 2046872891240222720 from 2026-04-22) also shows as failed, but that is an unrelated infrastructure issue (DNS resolution failure for packages.microsoft.com during container image build).

Recommendations
  1. Rebase PR feat: Support passing node selectors and tolerations to hypershift install cmd #7404 onto current main — The PR author needs to rebase the ARO-23223 branch onto the latest main (which now includes PR OCPBUGS-84955: Add render-sensitive flag to hypershift install render  #8436's RenderSensitive field) and resolve the conflict in cmd/install/install.go by placing both sets of new fields in the Options struct:

    ScaleFromZeroCredentialsSecretKey         string
    RenderSensitive                           bool              // from PR #8436
    OperatorTolerations                       []string          // from PR #7404
    OperatorNodeSelectors                     map[string]string // from PR #7404
  2. Check for additional conflicts — While git auto-merged cmd/install/assets/hypershift_operator.go and cmd/install/install_test.go, verify after rebase that the NewInstallOptionsWithDefaults() function and setupOperatorResources() function in install.go also don't have semantic conflicts with PR OCPBUGS-84955: Add render-sensitive flag to hypershift install render  #8436's changes (e.g., if RenderSensitive was also wired into those functions).

  3. Re-trigger CI — After pushing the rebased branch, all Prow jobs (including security) and tide will automatically re-run against the updated merge result.

Evidence
Evidence Detail
Failing job pull-ci-openshift-hypershift-main-security (build 2053896784232583168)
Failure phase Git clone/merge — before any build or test execution
Conflicting file cmd/install/install.goOptions struct definition
PR #7404 changes Adds OperatorTolerations []string and OperatorNodeSelectors map[string]string after ScaleFromZeroCredentialsSecretKey
Conflicting PR #8436 — "OCPBUGS-84955: Add render-sensitive flag" (merged 2026-05-07)
Conflicting change Adds RenderSensitive bool at the same struct location
Main branch SHA f16ca0d22941d58a170aaa4b1471b1456017c7c8
Tide status state: error — cannot merge due to conflict (consequence, not independent failure)
ci/prow/images Separate failure (DNS for packages.microsoft.com) — unrelated infrastructure issue from 2026-04-22

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. area/cli Indicates the PR includes changes for CLI needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants