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

chore: Update DevWorkspace Operator dependency to v0.12.2 #1302

Merged
merged 7 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/openshift-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Dockerfile to bootstrap build and test in openshift-ci

FROM registry.ci.openshift.org/openshift/release:golang-1.15
FROM registry.ci.openshift.org/openshift/release:golang-1.16

SHELL ["/bin/bash", "-c"]

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run unit tests
run: make test
- name: Build Codecov report
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.1
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run unit tests
run: make test
image-build:
Expand Down Expand Up @@ -47,10 +51,10 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.1
- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Cache go modules
id: cache-mod
uses: actions/cache@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ jobs:
sudo chmod +x /usr/local/bin/base32
#remove base32 from current directory to avoid it being commited during release
rm $(pwd)/base32
- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Release operator
env:
IMAGE_REGISTRY_HOST: quay.io
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/resources-check-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
uses: actions/checkout@v2.3.1
- name: Install yq
run: sudo pip install yq
- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Validate operator resources
run: ${GITHUB_WORKSPACE}/.github/bin/check-resources.sh
bundle-version-validation:
Expand All @@ -36,9 +36,9 @@ jobs:
uses: actions/checkout@v2.3.1
- name: Install yq
run: sudo pip install yq
- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Validate OLM bundle version
run: ${GITHUB_WORKSPACE}/.github/bin/check-bundle-version.sh
8 changes: 4 additions & 4 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,16 +448,16 @@
| [golang.org/x/image@0694c2d4d067f97ebef574d63a763ee8ab559da7](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/lint@738671d3881b9731cc63024d5d88cf28db875626](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/mod@v0.4.2](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/net@a5a99cb37ef4b68617775ab669177656090ab396](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/net@89ef3d95e781148a0951956029c92a211477f7f9](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/sync@036812b2e83c0ddf193dd5a34e034151da389d09](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/sys@0f9fa26af87c481a6877a4ca1330699ba9a30673](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/sys@04245dca01dae530ad36275d662a90d6b8a5ee29](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/term@6a3ed077a48de71621ad530f9078fffa0bc0ce32](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/text@v0.3.4](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/text@v0.3.6](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/time@1f47c861a9ac5a6e7645609f91b895398ff31642](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/tools@v0.1.5](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/xerrors@5ec99f83aff198f5fbd629d6c8d8eb38a04218ca](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/oauth2@bf48bf16ab8d622ce64ec6ce98d2c98f916b6303](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/mobile@d3739f865fa66d07c1f506505c18aac71a8ead6e](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [github.com/devfile/api/v2@03e023e7078b64884216d8e6dce8f0cf8b7e74d2](https://github.com/devfile/api.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23680) |
| [github.com/che-incubator/kubernetes-image-puller-operator@0128446f5af78587c0427a35d693bbb8d24036bc](https://github.com/che-incubator/kubernetes-image-puller-operator.git) | EPL-2.0 | todo |
| [github.com/devfile/devworkspace-operator@728dff7e987c761723d4155fc5758f5673b4e955](https://github.com/devfile/devworkspace-operator.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23780) |
| [github.com/devfile/devworkspace-operator@23b39b88fa997d92185645c94249f16446d1adf4](https://github.com/devfile/devworkspace-operator.git) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/git/github/devfile/devworkspace-operator/23b39b88fa997d92185645c94249f16446d1adf4) |
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
FROM registry.access.redhat.com/ubi8/go-toolset:1.16.12-2 as builder
ENV GOPATH=/go/
ENV RESTIC_TAG=v0.12.0
ARG DEV_WORKSPACE_CONTROLLER_VERSION="v0.11.0"
ARG DEV_WORKSPACE_CONTROLLER_VERSION="v0.12.1"
ARG DEV_HEADER_REWRITE_TRAEFIK_PLUGIN="main"
ARG TESTS="true"
USER root
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ECLIPSE_CHE_BACKUP_SERVER_CONFIGURATION_CRD="$(CRD_FOLDER)/org.eclipse.che_cheba
ECLIPSE_CHE_BACKUP_CRD="$(CRD_FOLDER)/org.eclipse.che_checlusterbackups.yaml"
ECLIPSE_CHE_RESTORE_CRD="$(CRD_FOLDER)/org.eclipse.che_checlusterrestores.yaml"

DEV_WORKSPACE_CONTROLLER_VERSION="v0.11.0"
DEV_WORKSPACE_CONTROLLER_VERSION="v0.12.1"
DEV_HEADER_REWRITE_TRAEFIK_PLUGIN="main"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.43.0-412.next
name: eclipse-che-preview-openshift.v7.43.0-413.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -925,6 +925,13 @@ spec:
- get
- list
- watch
- apiGroups:
- authorization.k8s.io
resources:
- localsubjectaccessreviews
- subjectaccessreviews
verbs:
- create
- apiGroups:
- batch
resources:
Expand All @@ -937,6 +944,14 @@ spec:
- patch
- update
- watch
- apiGroups:
- config.openshift.io
resourceNames:
- cluster
resources:
- proxies
verbs:
- get
- apiGroups:
- controller.devfile.io
resources:
Expand Down Expand Up @@ -965,6 +980,14 @@ spec:
- create
- get
- update
- apiGroups:
- metrics.k8s.io
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down Expand Up @@ -1403,4 +1426,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.43.0-412.next
version: 7.43.0-413.next
23 changes: 23 additions & 0 deletions config/rbac/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,13 @@ rules:
- get
- list
- watch
- apiGroups:
- authorization.k8s.io
resources:
- localsubjectaccessreviews
- subjectaccessreviews
verbs:
- create
- apiGroups:
- batch
resources:
Expand All @@ -570,6 +577,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- config.openshift.io
resourceNames:
- cluster
resources:
- proxies
verbs:
- get
- apiGroups:
- controller.devfile.io
resources:
Expand Down Expand Up @@ -598,6 +613,14 @@ rules:
- create
- get
- update
- apiGroups:
- metrics.k8s.io
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
20 changes: 9 additions & 11 deletions controllers/devworkspace/solver/che_routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"strconv"
"strings"

"k8s.io/utils/pointer"

"github.com/eclipse-che/che-operator/pkg/util"

"github.com/eclipse-che/che-operator/pkg/deploy/gateway"
Expand Down Expand Up @@ -216,7 +214,7 @@ func (c *CheRoutingSolver) cheExposedEndpoints(cheCluster *v2alpha1.CheCluster,

for component, endpoints := range componentEndpoints {
for _, endpoint := range endpoints {
if endpoint.Exposure != dw.PublicEndpointExposure {
if dw.EndpointExposure(endpoint.Exposure) != dw.PublicEndpointExposure {
continue
}

Expand Down Expand Up @@ -361,7 +359,7 @@ func exposeAllEndpoints(cheCluster *v2alpha1.CheCluster, routing *dwo.DevWorkspa
order := 1
for componentName, endpoints := range routing.Spec.Endpoints {
for _, e := range endpoints {
if e.Exposure != dw.PublicEndpointExposure {
if dw.EndpointExposure(e.Exposure) != dw.PublicEndpointExposure {
continue
}

Expand Down Expand Up @@ -498,7 +496,7 @@ func routeForHealthzEndpoint(cfg *gateway.TraefikConfig, dwId string, endpoints
}
}

func addEndpointToTraefikConfig(componentName string, e dw.Endpoint, cfg *gateway.TraefikConfig, cheCluster *v2alpha1.CheCluster, routing *dwo.DevWorkspaceRouting) {
func addEndpointToTraefikConfig(componentName string, e dwo.Endpoint, cfg *gateway.TraefikConfig, cheCluster *v2alpha1.CheCluster, routing *dwo.DevWorkspaceRouting) {
routeName, prefix := createEndpointPath(&e, componentName)
rulePrefix := fmt.Sprintf("PathPrefix(`%s`)", prefix)

Expand Down Expand Up @@ -531,7 +529,7 @@ func addEndpointToTraefikConfig(componentName string, e dw.Endpoint, cfg *gatewa
}
}

func createEndpointPath(e *dw.Endpoint, componentName string) (routeName string, path string) {
func createEndpointPath(e *dwo.Endpoint, componentName string) (routeName string, path string) {
if e.Attributes.GetString(uniqueEndpointAttributeName, nil) == "true" {
// if endpoint is unique, we're exposing on /componentName/<endpoint-name>
routeName = e.Name
Expand All @@ -557,7 +555,7 @@ func findServiceForPort(port int32, objs *solvers.RoutingObjects) *corev1.Servic
return nil
}

func findIngressForEndpoint(componentName string, endpoint dw.Endpoint, objs *solvers.RoutingObjects) *networkingv1.Ingress {
func findIngressForEndpoint(componentName string, endpoint dwo.Endpoint, objs *solvers.RoutingObjects) *networkingv1.Ingress {
for i := range objs.Ingresses {
ingress := &objs.Ingresses[i]

Expand All @@ -580,7 +578,7 @@ func findIngressForEndpoint(componentName string, endpoint dw.Endpoint, objs *so
return nil
}

func findRouteForEndpoint(componentName string, endpoint dw.Endpoint, objs *solvers.RoutingObjects, dwId string) *routeV1.Route {
func findRouteForEndpoint(componentName string, endpoint dwo.Endpoint, objs *solvers.RoutingObjects, dwId string) *routeV1.Route {
service := findServiceForPort(int32(endpoint.TargetPort), objs)
if service == nil {
service = getCommonService(objs, dwId)
Expand Down Expand Up @@ -650,7 +648,7 @@ func getServiceURL(port int32, workspaceID string, workspaceNamespace string) st
return fmt.Sprintf("http://%s.%s.svc:%d", common.ServiceName(workspaceID), workspaceNamespace, port)
}

func getPublicURLPrefixForEndpoint(workspaceID string, machineName string, endpoint dw.Endpoint) string {
func getPublicURLPrefixForEndpoint(workspaceID string, machineName string, endpoint dwo.Endpoint) string {
endpointName := ""
if endpoint.Attributes.GetString(uniqueEndpointAttributeName, nil) == "true" {
endpointName = endpoint.Name
Expand All @@ -666,15 +664,15 @@ func getPublicURLPrefix(workspaceID string, machineName string, port int32, uniq
return fmt.Sprintf(uniqueEndpointURLPrefixPattern, workspaceID, machineName, uniqueEndpointName)
}

func determineEndpointScheme(e dw.Endpoint) string {
func determineEndpointScheme(e dwo.Endpoint) string {
var scheme string
if e.Protocol == "" {
scheme = "http"
} else {
scheme = string(e.Protocol)
}

upgradeToSecure := pointer.BoolPtrDerefOr(e.Secure, false)
upgradeToSecure := e.Secure

// gateway is always on HTTPS, so if the endpoint is served through the gateway, we need to use the TLS'd variant.
if e.Attributes.GetString(urlRewriteSupportedEndpointAttributeName, nil) == "true" {
Expand Down
Loading