-
Notifications
You must be signed in to change notification settings - Fork 70
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: Add a predefined secret to store credentials #68
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a4b62d2
fix: Add a predefined secret to store credentials
vinokurig c52ccd7
fixup! fix: Add a predefined secret to store credentials
vinokurig a239963
Merge branch 'main' of github.com:eclipse-che/che-server into che-19837
vinokurig 65e5e20
merge with main
vinokurig 605bfd1
fixup! fix: Add a predefined secret to store credentials
vinokurig fb0fe45
fixup! fix: Add a predefined secret to store credentials
vinokurig cd092ce
fixup! fix: Add a predefined secret to store credentials
vinokurig 79ba1e5
fixup! fix: Add a predefined secret to store credentials
vinokurig 10a2c55
fixup! fix: Add a predefined secret to store credentials
vinokurig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,6 +11,8 @@ | |
*/ | ||
package org.eclipse.che.workspace.infrastructure.openshift.project; | ||
|
||
import static java.util.Collections.emptyList; | ||
|
||
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder; | ||
import io.fabric8.openshift.api.model.PolicyRuleBuilder; | ||
import io.fabric8.openshift.api.model.Role; | ||
|
@@ -21,6 +23,7 @@ | |
import io.fabric8.openshift.client.OpenShiftClient; | ||
import java.util.List; | ||
import java.util.Set; | ||
import org.eclipse.che.commons.annotation.Nullable; | ||
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.AbstractWorkspaceServiceAccount; | ||
import org.eclipse.che.workspace.infrastructure.openshift.OpenShiftClientFactory; | ||
|
||
|
@@ -55,14 +58,19 @@ class OpenShiftWorkspaceServiceAccount | |
|
||
@Override | ||
protected Role buildRole( | ||
String name, List<String> resources, List<String> apiGroups, List<String> verbs) { | ||
String name, | ||
List<String> resources, | ||
@Nullable List<String> resourceNames, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pass empty list, instread of nullable |
||
List<String> apiGroups, | ||
List<String> verbs) { | ||
return new RoleBuilder() | ||
.withNewMetadata() | ||
.withName(name) | ||
.endMetadata() | ||
.withRules( | ||
new PolicyRuleBuilder() | ||
.withResources(resources) | ||
.withResourceNames(resourceNames != null ? resourceNames : emptyList()) | ||
.withApiGroups(apiGroups) | ||
.withVerbs(verbs) | ||
.build()) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we choose a Che-agnostic name -- e.g.
workspace-credentials-secret
? If we want to do a similar thing in DWO, it's a lot easier to justify if it's not labelled with a specific platform.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for
workspace-credentials-secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ please consider moving that secret name somewhere to constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done