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

"fly set-team" shows unclear message when there is a role having no user and group #4852

Closed
evanchaoli opened this issue Dec 5, 2019 · 1 comment · Fixed by #4858
Closed
Labels
bug fly release/documented Documentation and release notes have been updated.
Milestone

Comments

@evanchaoli
Copy link
Contributor

Bug Report

For example, we use this team file:

name: some-team
roles:
- name: owner
  local:
    users:
    - test
- name: member
  ldap:
    users:
    - user1
    - user2
- name: viewer
  ldap:
    users: []

Then fly set-team will raise an error:

$ fly -t prod set-team --team-name some-team -c some-team.yml                          
You have not provided a list of users and groups for one of the roles in your config yaml.

This error message is very confused. Then I checked the code https://github.com/concourse/concourse/blob/master/skymarshal/skycmd/flags.go#L136:

		if len(users) == 0 && len(groups) == 0 {
			return nil, ErrAuthNotConfiguredFromFile
		}

So if a role has no any user and group defined, then fly set-team will raise such an error.

Why don't just ignore the role if there is no user and group? Is there any special consideration?

We have a use case, where we maintain a team file, and dynamically assign on-duty folks as pipeline-operator, sometime there is no pipeline-operator. With this bug, when there is no pipeline-operator on-duty, we have to delete the operator role from the team file, which is inconvenient.

Steps to Reproduce

As described above.

Expected Results

Ignore roles without user and group.

Actual Results

fly returned an error, and the error message is not clear.

Additional Context

Version Info

  • Concourse version: 5.7.2
  • Deployment type (BOSH/Docker/binary):
  • Infrastructure/IaaS:
  • Browser (if applicable):
  • Did this used to work?
@xtremerui
Copy link
Contributor

If the team config file for set-team reflects the desired state of the team auth, it then doesn't need to worry about removing users or groups from a configured role by setting empty users/groups. In such case ignore the role should be Ok. @pivotal-jwinters what do you think?

evanchaoli added a commit to evanchaoli/concourse that referenced this issue Dec 6, 2019
…nfig file.

Fixes concourse#4852.

Signed-off-by: Chao Li <chaol@vmware.com>
@jamieklassen jamieklassen added this to the v5.8.0 milestone Dec 10, 2019
@jamieklassen jamieklassen added the release/documented Documentation and release notes have been updated. label Dec 11, 2019
xtreme-sameer-vohra pushed a commit that referenced this issue Dec 13, 2019
…nfig file.

Fixes #4852.

Signed-off-by: Chao Li <chaol@vmware.com>
xtreme-sameer-vohra pushed a commit that referenced this issue Dec 14, 2019
…nfig file.

Fixes #4852.

Signed-off-by: Chao Li <chaol@vmware.com>
aledegano pushed a commit to Pix4D/concourse that referenced this issue Dec 16, 2019
…nfig file.

Fixes concourse#4852.

Signed-off-by: Chao Li <chaol@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fly release/documented Documentation and release notes have been updated.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants