Skip to content

feat: Add support for creating a configmap semaphore config using CLI. Fixes #14671 #14724

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

djanjic
Copy link
Member

@djanjic djanjic commented Aug 1, 2025

Fixes #14671

Motivation

This adds support for creating configmap sync configuration using CLI.

Modifications

  • added new endpoints to accomodate this change
  • added CLI support for creating configmap sync config.
  • added tests

Verification

  • manual testing
  • e2e tests
  • unit tests

Documentation

  • Documentation is automatically generated for new CLI commands

@djanjic djanjic marked this pull request as ready for review August 7, 2025 15:41
Copy link
Member

@eduardodbr eduardodbr left a comment

Choose a reason for hiding this comment

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

small questions but otherwise looks good

}

func (s *syncServer) DeleteSyncLimit(ctx context.Context, req *syncpkg.DeleteSyncLimitRequest) (*syncpkg.DeleteSyncLimitResponse, error) {
fmt.Printf("Deleting sync limit for ConfigMap %s in namespace %s with key %s\n", req.Name, req.Namespace, req.Key)
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this print or replace it proper logging

Use: "get",
Short: "Get a configmap sync limit",
Args: cobra.ExactArgs(1),
Example: `argo sync get configmap my-cm --key my-key`,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Example: `argo sync get configmap my-cm --key my-key`,
Example: `argo sync configmap get my-cm --key my-key`,

the command and the method are switched

Key: req.Key,
SizeLimit: req.SizeLimit,
}, false)
}
Copy link
Member

Choose a reason for hiding this comment

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

A Create doing an Update violates some API principles, is this common in the current codebase?

return nil, sutils.ToStatusError(err, codes.Internal)
}

delete(cm.Data, req.Key)
Copy link
Member

Choose a reason for hiding this comment

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

if the deleted key is the only key in the Configmap, should the CM also be deleted? otherwise the CM will be created with no data

### Examples

```
argo sync get configmap my-cm --key my-key
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
argo sync get configmap my-cm --key my-key
argo sync configmap get my-cm --key my-key

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.

Add support for creating a configmap semaphore config using CLI
2 participants