Skip to content

Commit

Permalink
chore: removes proxy_cluster_role.yaml (#922)
Browse files Browse the repository at this point in the history
* chore: remove proxy_cluster_role.yaml

Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Jul 14, 2021
1 parent 5648767 commit 9bb621b
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 94 deletions.
3 changes: 1 addition & 2 deletions .github/bin/check-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,11 @@ checkRoles() {
# files to check
local RoleYaml="deploy/role.yaml"
local ClusterRoleYaml="deploy/cluster_role.yaml"
local ProxyClusterRoleYaml="deploy/proxy_cluster_role.yaml"

changedFiles=(
$(git diff --name-only)
)
if [[ " ${changedFiles[*]} " =~ $RoleYaml ]] || [[ " ${changedFiles[*]} " =~ $ClusterRoleYaml ]] || [[ " ${changedFiles[*]} " =~ $ProxyClusterRoleYaml ]]; then
if [[ " ${changedFiles[*]} " =~ $RoleYaml ]] || [[ " ${changedFiles[*]} " =~ $ClusterRoleYaml ]]; then
echo "[ERROR] Roles are not up to date: ${BASH_REMATCH}"
echo "[ERROR] Run 'olm/update-resources.sh' to update them."
exit 1
Expand Down
2 changes: 0 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ oc apply -f ${BASE_DIR}/deploy/role.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/role_binding.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/cluster_role.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/cluster_role_binding.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/proxy_cluster_role.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/proxy_cluster_role_binding.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/crds/org_v1_che_crd.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/crds/org.eclipse.che_chebackupserverconfigurations_crd.yaml -n $NAMESPACE
oc apply -f ${BASE_DIR}/deploy/crds/org.eclipse.che_checlusterbackups_crd.yaml -n $NAMESPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mkdir -p "${BASE_DIR}/generated/roles"

cp "${BASE_DIR}/../../../role.yaml" "${BASE_DIR}/generated/roles/role.yaml"
cp "${BASE_DIR}/../../../cluster_role.yaml" "${BASE_DIR}/generated/roles/cluster_role.yaml"
cp "${BASE_DIR}/../../../proxy_cluster_role.yaml" "${BASE_DIR}/generated/roles/proxy_cluster_role.yaml"

for role in ${BASE_DIR}/generated/roles/*.yaml; do
index=0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
role-paths: [ "deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/generated/roles/role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/generated/roles/cluster_role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/generated/roles/proxy_cluster_role.yaml"]
role-paths: [ "deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/generated/roles/role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/generated/roles/cluster_role.yaml"]
operator-path: deploy/operator.yaml
crd-cr-paths: ["deploy/crds/org_v1_che_crd.yaml", "deploy/crds/org.eclipse.che_chebackupserverconfigurations_crd.yaml", deploy/crds/org.eclipse.che_checlusterbackups_crd.yaml", "deploy/crds/org.eclipse.che_checlusterrestores_crd.yaml"]
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:next
createdAt: "2021-07-14T06:55:06Z"
createdAt: "2021-07-14T07:19:58Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-kubernetes.v7.33.0-254.nightly
name: eclipse-che-preview-kubernetes.v7.33.0-256.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -887,20 +887,6 @@ spec:
verbs:
- get
serviceAccountName: che-operator
- rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
serviceAccountName: default
deployments:
- name: che-operator
spec:
Expand Down Expand Up @@ -1241,4 +1227,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.33.0-254.nightly
version: 7.33.0-256.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ rm -Rf "${BASE_DIR}/generated/roles"
mkdir -p "${BASE_DIR}/generated/roles"
cp "${BASE_DIR}/../../../role.yaml" "${BASE_DIR}/generated/roles/role.yaml"
cp "${BASE_DIR}/../../../cluster_role.yaml" "${BASE_DIR}/generated/roles/cluster_role.yaml"
cp "${BASE_DIR}/../../../proxy_cluster_role.yaml" "${BASE_DIR}/generated/roles/proxy_cluster_role.yaml"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
operator-path: deploy/operator.yaml
role-paths: [ "deploy/olm-catalog/nightly/eclipse-che-preview-openshift/generated/roles/role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-openshift/generated/roles/cluster_role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-openshift/generated/roles/proxy_cluster_role.yaml"]
role-paths: [ "deploy/olm-catalog/nightly/eclipse-che-preview-openshift/generated/roles/role.yaml", "deploy/olm-catalog/nightly/eclipse-che-preview-openshift/generated/roles/cluster_role.yaml"]
crd-cr-paths: ["deploy/crds/org_v1_che_crd.yaml", "deploy/crds/org.eclipse.che_chebackupserverconfigurations_crd.yaml", "deploy/crds/org.eclipse.che_checlusterbackups_crd.yaml", "deploy/crds/org.eclipse.che_checlusterrestores_crd.yaml"]
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ metadata:
categories: Developer Tools, OpenShift Optional
certified: "false"
containerImage: quay.io/eclipse/che-operator:next
createdAt: "2021-07-14T06:55:12Z"
createdAt: "2021-07-14T07:20:04Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces in OpenShift.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.33.0-254.nightly
name: eclipse-che-preview-openshift.v7.33.0-256.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -956,20 +956,6 @@ spec:
verbs:
- get
serviceAccountName: che-operator
- rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
serviceAccountName: default
deployments:
- name: che-operator
spec:
Expand Down Expand Up @@ -1318,4 +1304,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.33.0-254.nightly
version: 7.33.0-256.nightly
21 changes: 0 additions & 21 deletions deploy/proxy_cluster_role.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions deploy/proxy_cluster_role_binding.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions olm/update-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,6 @@ updateRoles() {
echo "$line" >> $ROOT_PROJECT_DIR/deploy/role.yaml
done <<< "$CONTENT"
done

# Updates proxy_cluster_role.yaml based on DWCO
## Remove old roles
cat $ROOT_PROJECT_DIR/deploy/proxy_cluster_role.yaml | sed '/rules:/q0' > $ROOT_PROJECT_DIR/deploy/proxy_cluster_role.yaml.tmp
mv $ROOT_PROJECT_DIR/deploy/proxy_cluster_role.yaml.tmp $ROOT_PROJECT_DIR/deploy/proxy_cluster_role.yaml

## Copy new roles
CLUSTER_PROXY_ROLES=https://raw.githubusercontent.com/che-incubator/devworkspace-che-operator/main/deploy/deployment/openshift/objects/devworkspace-che-proxy-role.ClusterRole.yaml
CONTENT=$(curl -sL $CLUSTER_PROXY_ROLES | sed '1,/rules:/d')
while IFS= read -r line; do
echo "$line" >> $ROOT_PROJECT_DIR/deploy/proxy_cluster_role.yaml
done <<< "$CONTENT"
}

updateOperatorYaml() {
Expand Down Expand Up @@ -304,9 +292,6 @@ updateNighltyBundle() {
done
fi

# Fix account name
sed -i 's|serviceAccountName: che-operator-proxy|serviceAccountName: default|g' $NEW_CSV

# Fix sample
if [ "${platform}" == "openshift" ]; then
echo "[INFO] Fix openshift sample"
Expand Down

0 comments on commit 9bb621b

Please sign in to comment.