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

AppSource ConfigMap Project Spec "Profiles" #3

Closed
aceamarco opened this issue Jul 15, 2021 · 2 comments · Fixed by #22
Closed

AppSource ConfigMap Project Spec "Profiles" #3

aceamarco opened this issue Jul 15, 2021 · 2 comments · Fixed by #22
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@aceamarco
Copy link
Collaborator

aceamarco commented Jul 15, 2021

Summary

Currently, whenever the AppSource controller has to create a project it uses the single project spec template provided by the AppSource configmap. Instead of having a single template project, we could add several project "profiles" with a default fallback profile and then have developers annotate their AppSource instances with what profile they would like to use.

Motivation

Having a single project spec template forces admins to provide developers more ability than they might want to give. Having different spec profiles would allow admins and developers to get only what they need.

Proposal

Expand the AppSource configmap.data.project.template to be an array of "spec profiles" instead of a single template. Profiles are defined by the naming convention associated with that project (inspired by the already implemented namePattern logic).

Current (Single-Spec) AppSource configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-appsource-cm
  namespace: argocd
data:
  argocd.address: localhost:8080
  argocd.clientOpts: "--insecure"
  project.template: |
    namePattern: (?P<project>.*)-us-(west|east)-(\d.*)
    spec:
      # Project description
      description: Example Project

      # Allow manifests to deploy from any Git repos
      sourceRepos:
      - 'https://github.com/argoproj/*'

Proposed (Multi-Spec) AppSource configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-appsource-cm
  namespace: argocd
data:
  argocd.address: localhost:8080
  argocd.clientOpts: "--insecure"
  project.profiles: |
    - name: my-project
       namePattern: (?P<project>.*)-us-(west|east)-(\d.*) :
       spec:
         description: US West/East projects
         sourceRepos:
        - 'https://github.com/argoproj/*'
    - name: default
       namePattern : .*
       spec:
         description: Defualt project spec
         sourceRepos:
         - '*'
@aceamarco aceamarco added enhancement New feature or request good first issue Good for newcomers labels Jul 15, 2021
@aceamarco aceamarco added this to the Version 1 Alpha 1 Release milestone Jul 19, 2021
@aceamarco
Copy link
Collaborator Author

Question: How will users interact with these profiles? Currently a project is identified by the whether the AppSource.namespace matches the namePattern described in the AppSource ConfigMap.

@aceamarco
Copy link
Collaborator Author

Following up on my question with what I'll be assuming for now.

  • The order of the project specs matter, the controller will iterate through the project spec name patterns and use the first match found, that is why the default project spec should be always left last.

@aceamarco aceamarco mentioned this issue Jul 26, 2021
aceamarco added a commit that referenced this issue Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant