Skip to content

Conversation

@JGAntunes
Copy link
Member

What this PR does / why we need it:

Adds NodeCount template function support:

Which issue(s) this PR fixes:

https://app.shortcut.com/replicated/story/131029/support-nodecount-template-function-in-v3-api

Does this PR require a test?

Yes added unit tests.

Does this PR require a release note?

NONE

Does this PR require documentation?

NONE

@JGAntunes JGAntunes self-assigned this Nov 13, 2025
// It returns 0 if the kubeClient is unavailable or if an error occurs.
func (e *Engine) nodeCount() int {
if e.kubeClient == nil {
return 0
Copy link
Member

Choose a reason for hiding this comment

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

can you log warn here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done via - 3ab44cb

ctx := context.TODO()
nodeList := &corev1.NodeList{}
if err := e.kubeClient.List(ctx, nodeList); err != nil {
return 0
Copy link
Member

Choose a reason for hiding this comment

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

can you log warn here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done via - 3ab44cb

@JGAntunes JGAntunes merged commit 8f3d267 into main Nov 14, 2025
26 checks passed
@JGAntunes JGAntunes deleted the jgantunes/sc-131029/support-nodecount-template-function-in-v3 branch November 14, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants