Skip to content

Commit

Permalink
Merge pull request #192 from mlbiam/master
Browse files Browse the repository at this point in the history
make sure disabling byo git repo doesn't still check for a git repo
  • Loading branch information
mlbiam authored Jan 25, 2025
2 parents f7fc9f3 + 69ca4eb commit 9a94a3d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openunison-k8s-cluster-management/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 3.0.44
version: 3.0.45

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ spec:
requireTermsAndConditions: "false"
termsAndCondisionsText: ""
useCallWorkflowClass: "true"
{{ if .Values.openunison.naas.git.enable_byo }}
callWorkflowClassName: "com.tremolosecurity.scalejs.K8sProjectCheck"
{{ else }}
callWorkflowClassName: com.tremolosecurity.scalejs.register.registrators.JavaScriptRegister
{{ end }}
submitLoggedInUser: "true"
themePrimaryMain: "{{ .Values.openunison.html.theme.colors.primary.main }}"
themePrimaryDark: "{{ .Values.openunison.html.theme.colors.primary.dark }}"
Expand Down Expand Up @@ -478,6 +482,62 @@ spec:
- workflowName=new-k8s-namespace
- targetName=k8s
- projectAttributeName=nameSpace
- |-
javaScript=
function init(config) {
}
function createTremoloUser(newUser, errors, userData) {
System = Java.type("java.lang.System");
GlobalEntries = Java.type("com.tremolosecurity.server.GlobalEntries");
var targetName = newUser.getAttributes().get("cluster");
var nameSpace = newUser.getAttributes().get("nameSpace");
k8s = GlobalEntries.getGlobalEntries().getConfigManager().getProvisioningEngine().getTarget(targetName);
if (! k8s) {
errors.add("invalid cluster");
return "";
}
http = k8s.getProvider().createClient();
try {
if (k8s.getProvider().isObjectExistsByName(k8s.getProvider().getAuthToken(),http,'/api/v1/namespaces',nameSpace)) {
errors.add("Namespace name already exists");
}
} finally {
if (http != null) {
http.getHttp().close();
http.getBcm().close();
}
}
return "new-k8s-namespace";
}
function setWorkflowParameters(wfParameters, newUser, userData) {
nameSpace = newUser.getAttributes().get("nameSpace");
wfParameters.put("namespace", nameSpace);
targetName = newUser.getAttributes().get("cluster");
if (targetName == null) {
targetName = "k8s";
}
wfParameters.put("cluster", targetName);
wfParameters.put("fully-qualified-namespace", targetName + "." + nameSpace);
}
jsUris:
- js/register-functions.js
- js-ext/functions.js
Expand Down

0 comments on commit 9a94a3d

Please sign in to comment.