Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue in extraCommandArgs field #1541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rizwana777
Copy link
Contributor

@Rizwana777 Rizwana777 commented Sep 9, 2024

@Rizwana777 Rizwana777 force-pushed the issue-5200 branch 6 times, most recently from c2b7eb0 to e8ed105 Compare September 9, 2024 14:20
// If this flag already exists in cmd, skip it
if _, exists := existingArgs[arg]; exists {
if i+1 < len(extraArgs) && !strings.HasPrefix(extraArgs[i+1], "--") {
i++ // Skip the associated value
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if an existing flag is added with a new value, will that also be skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it is skipped

Copy link
Collaborator

@saumeya saumeya Sep 12, 2024

Choose a reason for hiding this comment

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

Is that the expected behavior? what if the user wants to change the current flag value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

based on the existing unit test https://github.com/argoproj-labs/argocd-operator/blob/master/controllers/argocd/deployment_test.go#L1304 which is updating existing cmd i.e --redis command, I think this is expected behaviour, I might be wrong and open for suggestions

},
deployment))

// Non-duplicate argument "--newarg" should be added, duplicate "--redis" is ignored
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is probably a typo of --redis, I don't see that in the test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, its a typo

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.

2 participants