Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/e2e/nodepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ func executeNodePoolTests(t *testing.T, nodePoolTestCasesPerHostedCluster []Host
clusterOpts.NodePoolReplicas = 1
}

// On ARO HCP with Cilium, we need at least one worker node to install cilium-olm operator
// before individual tests run. The cilium-olm deployment requires worker nodes to schedule its pods.
if globalOpts.Platform == hyperv1.AzurePlatform && clusterOpts.ExternalCNIProvider == "cilium" {
clusterOpts.NodePoolReplicas = 1
}
Comment on lines +213 to +217

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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify ExternalCNIProvider field definition and usage patterns

echo "=== ExternalCNIProvider field definition and usage ==="
rg -n 'ExternalCNIProvider' --type=go -B2 -A2

echo ""
echo "=== Cilium provider references with context ==="
rg -n '"cilium"' --type=go -B2 -A2

Repository: openshift/hypershift

Length of output: 3461


🏁 Script executed:

#!/bin/bash
# Find ExternalCNIProvider definition and assignment patterns

echo "=== Search for ExternalCNIProvider struct/field definition ==="
rg -n 'ExternalCNIProvider' --type=go

echo ""
echo "=== Search for other CNI provider strings (openstack, none, etc.) ==="
rg -n '"openstack"|"none"|"aws"|"external"' --type=go | grep -i cni | head -20

echo ""
echo "=== Search for CNI provider enum or constant definitions ==="
rg -n 'const.*CNI|type.*CNI' --type=go | head -20

echo ""
echo "=== Check clusterOpts structure around line 213 ==="
sed -n '190,230p' test/e2e/nodepool_test.go

Repository: openshift/hypershift

Length of output: 3103


🏁 Script executed:

#!/bin/bash
# Find DefaultClusterOptions function and struct definition

echo "=== Search for DefaultClusterOptions function ==="
rg -n 'func.*DefaultClusterOptions' --type=go -A10

echo ""
echo "=== Search for struct containing ExternalCNIProvider ==="
rg -n 'type.*struct' --type=go | head -30

echo ""
echo "=== Search for ExternalCNIProvider assignment/initialization ==="
rg -n 'ExternalCNIProvider\s*=' --type=go

echo ""
echo "=== Broader search for ExternalCNIProvider in all files ==="
find . -name "*.go" -type f ! -path "*/vendor/*" -exec grep -l "ExternalCNIProvider" {} \;

Repository: openshift/hypershift

Length of output: 3940


🏁 Script executed:

#!/bin/bash
# Find PlatformAgnosticOptions struct definition

echo "=== Search for PlatformAgnosticOptions struct definition ==="
rg -n 'type PlatformAgnosticOptions' --type=go -A50

echo ""
echo "=== Check full DefaultClusterOptions function ==="
sed -n '181,250p' test/e2e/util/options.go

Repository: openshift/hypershift

Length of output: 6735


🏁 Script executed:

#!/bin/bash
# Search for ExternalCNIProvider in core package

echo "=== Search for core.RawCreateOptions struct definition ==="
rg -n 'type RawCreateOptions' --type=go -A50 | head -100

echo ""
echo "=== Direct search for ExternalCNIProvider in all non-vendor Go files ==="
find . -name "*.go" -type f ! -path "*/vendor/*" -exec grep -l "ExternalCNIProvider" {} \;

echo ""
echo "=== Check if code compiles by looking for test files ==="
ls -la test/e2e/nodepool_test.go

Repository: openshift/hypershift

Length of output: 7315


🏁 Script executed:

#!/bin/bash
# Find core package RawCreateOptions

echo "=== Search for core.RawCreateOptions in cmd/cluster/core ==="
find cmd/cluster/core -name "*.go" -exec grep -l "type RawCreateOptions" {} \;

echo ""
echo "=== Read the core RawCreateOptions struct ==="
find cmd/cluster/core -name "*.go" -exec grep -n "type RawCreateOptions" -A100 {} + | head -150

Repository: openshift/hypershift

Length of output: 7182


Code will not compile — ExternalCNIProvider field does not exist on clusterOpts.

The referenced field clusterOpts.ExternalCNIProvider does not exist in either the PlatformAgnosticOptions struct or its embedded core.RawCreateOptions struct. The field would need to be added to one of these structs before this code can compile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/nodepool_test.go` around lines 213 - 217, The code references
clusterOpts.ExternalCNIProvider which doesn't exist; add a new field
ExternalCNIProvider string to the PlatformAgnosticOptions struct (or to its
embedded core.RawCreateOptions if you prefer centralizing raw flags) and wire it
into any flag/option parsing so clusterOpts.ExternalCNIProvider is populated
before the check in nodepool_test.go; ensure the new field name matches the
check and update usages/tests accordingly.


ctx, cancel := context.WithCancel(testContext)
defer cancel()
e2eutil.NewHypershiftTest(t, ctx, func(t *testing.T, g Gomega, mgtClient crclient.Client, hostedCluster *hyperv1.HostedCluster) {
Expand Down