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

Implement devEnvironments.workspacesPodAnnotations to provide annotations to all workspace pods #1862

Merged
merged 2 commits into from
Jun 27, 2024
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
8 changes: 4 additions & 4 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,10 @@
| [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/[email protected]](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/net@0.19.0](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/net@0.23.0](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@0.15.0](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/term@0.15.0](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/sys@0.18.0](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/term@0.18.0](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/[email protected]](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/[email protected]](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [golang.org/x/[email protected]](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
Expand All @@ -574,7 +574,7 @@
| [golang.org/x/mobile@d3739f865fa66d07c1f506505c18aac71a8ead6e](https://cs.opensource.google/go) | BSD-3-Clause | N/A |
| [github.com/devfile/api/[email protected]](https://github.com/devfile/api.git) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/git/github/devfile/api/a6ec0a38307b63a29fad2eea945cc69bee97a683) |
| [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@v0.25.0](https://github.com/devfile/devworkspace-operator.git) | Apache-2.0 | [clearlydefined](https://https://clearlydefined.io/definitions/git/github/devfile/devworkspace-operator/3c083e4840f2f26c5c8abd95c745d8f09666b586) |
| [github.com/devfile/devworkspace-operator@v0.29.0](https://github.com/devfile/devworkspace-operator.git) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/git/github/devfile/devworkspace-operator/629bc2658ff0f6abb6687fc054c9e547ac3e3fc3) |
| [github.com/gophercloud/[email protected]](https://github.com/gophercloud/gophercloud) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/go/golang/github.com%2Fgophercloud/gophercloud/v0.1.0) |
| [gopkg.in/imdario/[email protected]](https://github.com/imdario/mergo/) | BSD-3-Clause | [clearlydefined](https://clearlydefined.io/definitions/go/golang/github.com%2Fimdario/mergo/v0.3.7) |
| [github.com/mikefarah/yq/[email protected]](https://github.com/mikefarah/yq) | MIT | [clearlydefined](https://clearlydefined.io/definitions/git/github/mikefarah/yq/b8b2c9de6189471c0cdbd459b5b0b49a57844bd4) |
Expand Down
3 changes: 3 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ type CheClusterDevEnvironments struct {
// +optional
// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// WorkspacesPodAnnotations defines additional annotations for workspace pods.
// +optional
WorkspacesPodAnnotations map[string]string `json:"workspacesPodAnnotations,omitempty"`
}

// Che components configuration.
Expand Down
7 changes: 7 additions & 0 deletions api/v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,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.v7.87.0-872.next
name: eclipse-che.v7.88.0-873.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1036,7 +1036,7 @@ spec:
minKubeVersion: 1.19.0
provider:
name: Eclipse Foundation
version: 7.87.0-872.next
version: 7.88.0-873.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7790,6 +7790,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7741,6 +7741,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
6 changes: 6 additions & 0 deletions deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7762,6 +7762,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7757,6 +7757,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
6 changes: 6 additions & 0 deletions deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7762,6 +7762,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7757,6 +7757,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/che-incubator/kubernetes-image-puller-operator v0.0.0-20210929175054-0128446f5af7
github.com/devfile/api/v2 v2.2.2
github.com/devfile/devworkspace-operator v0.25.0
github.com/devfile/devworkspace-operator v0.29.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update DEPENDENCIES.md file with a new DWO version and link to https://clearlydefined.io/

github.com/go-logr/logr v1.2.4
github.com/google/go-cmp v0.6.0
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
Expand All @@ -14,7 +14,7 @@ require (
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.24.0
golang.org/x/net v0.19.0
golang.org/x/net v0.23.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update DEPENDENCIES.md file to update the version of the following libs (no links to https://clearlydefined.io/ are requested)

  • golang.org/x/net v0.23.0
  • golang.org/x/sys v0.18.0
  • golang.org/x/term v0.18.0

k8s.io/api v0.26.1
k8s.io/apiextensions-apiserver v0.26.1
k8s.io/apimachinery v0.26.1
Expand Down Expand Up @@ -63,8 +63,8 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ github.com/deislabs/oras v0.8.1/go.mod h1:Mx0rMSbBNaNfY9hjpccEnxkOqJL6KGjtxNHPLC
github.com/denisenkom/go-mssqldb v0.0.0-20190204142019-df6d76eb9289/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc=
github.com/devfile/api/v2 v2.2.2 h1:DXRCPWFlZhTIE38Of2jzTRjQHadfbxBC8GS+m+EjoCU=
github.com/devfile/api/v2 v2.2.2/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM=
github.com/devfile/devworkspace-operator v0.25.0 h1:mvdaAIBljL9e105Jgbo7gfz4Il5jMQu/M8I5cX+3X7g=
github.com/devfile/devworkspace-operator v0.25.0/go.mod h1:SO7tFfXykoJ8ErSHqo7+2xxPBlkpHAyqM+Q3iJaDjUE=
github.com/devfile/devworkspace-operator v0.29.0 h1:SB46ueI7LEA6vYv8qH4nsyUiG67XDZkvvyLyL2yeWO8=
github.com/devfile/devworkspace-operator v0.29.0/go.mod h1:b2fBHTA6szY4uN46w0PlPKLJO/dzA8N2vvepBxSFmYk=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dhui/dktest v0.3.2/go.mod h1:l1/ib23a/CmxAe7yixtrYPc8Iy90Zy2udyaHINM5p58=
github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492 h1:FwssHbCDJD025h+BchanCwE1Q8fyMgqDr2mOQAWOLGw=
Expand Down Expand Up @@ -1144,8 +1144,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -1222,8 +1222,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -1233,8 +1233,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7757,6 +7757,12 @@ spec:
type: string
type: array
type: object
workspacesPodAnnotations:
additionalProperties:
type: string
description: WorkspacesPodAnnotations defines additional annotations
for workspace pods.
type: object
type: object
gitServices:
description: A configuration that allows users to work with remote
Expand Down
6 changes: 6 additions & 0 deletions pkg/deploy/dev-workspace-config/dev_workspace_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func updateWorkspaceConfig(ctx *chetypes.DeployContext, operatorConfig *controll

updateWorkspaceImagePullPolicy(devEnvironments.ImagePullPolicy, operatorConfig.Workspace)

updateAnnotations(devEnvironments.WorkspacesPodAnnotations, operatorConfig.Workspace)

// If the CheCluster has a configured proxy, or if the Che Operator has detected a proxy configuration,
// we need to disable automatic proxy handling in the DevWorkspace Operator as its implementation collides
// with ours -- they set environment variables the deployment spec explicitly, which overrides the proxy-settings
Expand Down Expand Up @@ -194,6 +196,10 @@ func updateWorkspaceImagePullPolicy(imagePullPolicy corev1.PullPolicy, workspace
workspaceConfig.ImagePullPolicy = string(imagePullPolicy)
}

func updateAnnotations(annotations map[string]string, workspaceConfig *controllerv1alpha1.WorkspaceConfig) {
workspaceConfig.PodAnnotations = annotations
}

func updateWorkspaceServiceAccountConfig(devEnvironments *chev2.CheClusterDevEnvironments, workspaceConfig *controllerv1alpha1.WorkspaceConfig) {
isNamespaceAutoProvisioned := pointer.BoolDeref(devEnvironments.DefaultNamespace.AutoProvision, constants.DefaultAutoProvision)

Expand Down
Loading
Loading