Skip to content

fix: strip colon from parsed NewReplicaSet name#543

Open
ejaifeobuks wants to merge 3 commits into
Azure:mainfrom
ejaifeobuks:fix/newreplicaset-colon
Open

fix: strip colon from parsed NewReplicaSet name#543
ejaifeobuks wants to merge 3 commits into
Azure:mainfrom
ejaifeobuks:fix/newreplicaset-colon

Conversation

@ejaifeobuks

Copy link
Copy Markdown
Contributor

This pull request makes a minor adjustment to the way new replica sets are identified in both the Kubectl class and its associated test. The change ensures that the string 'newreplicaset:' (with a colon) is used as the identifier instead of 'newreplicaset' (without a colon), improving the accuracy of matching lines related to new replica sets.

  • Bug fix: Replica set identification
    • Updated the identifier from 'newreplicaset' to 'newreplicaset:' in both the Kubectl class and its test to ensure correct parsing of replica set lines. [1] [2]Include the trailing colon in the 'newreplicaset:' keyword so substring() removes "NewReplicaSet:" entirely. Previously the colon was left behind, causing getNewReplicaSet to return ":" instead of the actual ReplicaSet name.

Also update the getNewReplicaSet unit test to use realistic colon-delimited kubectl describe output, which the previous mock omitted.

Resolves #318

Include the trailing colon in the 'newreplicaset:' keyword so substring() removes "NewReplicaSet:" entirely. Previously the colon was left behind, causing getNewReplicaSet to return ":" instead of the actual ReplicaSet name.

Also update the getNewReplicaSet unit test to use realistic colon-delimited `kubectl describe` output, which the previous mock omitted.

Resolves Azure#318
@ejaifeobuks
ejaifeobuks requested a review from a team as a code owner June 30, 2026 18:15
Comment thread src/types/kubectl.test.ts Outdated
const describeReturn = {
exitCode: 0,
stdout: newReplicaSetName + name + ' ' + 'extra',
stdout: newReplicaSetName + ' ' + name + ' ' + 'extra',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you use something like "NewReplicaSet: my-app-6d4cf56db6 (1/1 replicas created)" which resembles real output for the test?

@ejaifeobuks
ejaifeobuks requested a review from bosesuneha July 15, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: pod is not restarted if docker tag name is not changed

3 participants