-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from mittwald/refact/repository-and-user
user- and repository-types refactoring
- Loading branch information
Showing
12 changed files
with
65 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,13 +110,12 @@ metadata: | |
namespace: harbor-operator | ||
spec: | ||
memberRequests: | ||
- roleID: 1 | ||
memberUser: | ||
username: "harbor-user" | ||
- role: ProjectAdmin # one of "ProjectAdmin", "Developer", "Guest" or "Master" | ||
user: | ||
name: "harbor-user" # reference to an user | ||
name: repository-1 | ||
parentInstance: | ||
name: test-harbor | ||
toggleable: false | ||
metadata: | ||
enableContentTrust: false | ||
autoScan: false | ||
|
@@ -248,12 +247,6 @@ spec: | |
email: [email protected] | ||
userSecretRef: | ||
name: harbor-user | ||
# available Role IDs: | ||
# projectAdmin | ||
# developer | ||
# guest | ||
# master | ||
roleID: projectAdmin | ||
adminRole: true | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,4 @@ spec: | |
email: [email protected] | ||
userSecretRef: | ||
name: harbor-user | ||
# available Role IDs: | ||
# projectAdmin | ||
# developer | ||
# guest | ||
# master | ||
roleID: projectAdmin | ||
adminRole: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package v1alpha1 | ||
|
||
|
||
// ID returns a role ID integer by enumerating the given role | ||
func (role MemberRole) ID() int { | ||
switch role { | ||
case MemberRoleProjectAdmin: | ||
return 1 | ||
|
||
case MemberRoleDeveloper: | ||
return 2 | ||
|
||
case MemberRoleGuest: | ||
return 3 | ||
|
||
case MemberRoleMaster: | ||
return 4 | ||
} | ||
|
||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.