Skip to content

Commit

Permalink
Support devWorkspace.ignoredUnrecoverableEvents.
Browse files Browse the repository at this point in the history
  • Loading branch information
monaka committed Jun 27, 2024
1 parent 6cfe452 commit c62ac10
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 2 deletions.
7 changes: 7 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ type CheClusterDevEnvironments struct {
// +optional
// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
// be ignored when deciding to fail a DevWorkspace startup. This option should be used
// if a transient cluster issue is triggering false-positives (for example, if
// the cluster occasionally encounters FailedScheduling events). Events listed
// here will not trigger DevWorkspace failures.
// +optional
IgnoredUnrecoverableEvents []string `json:"ignoredUnrecoverableEvents,omitempty"`
}

// Che components configuration.
Expand Down
5 changes: 5 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
10 changes: 10 additions & 0 deletions bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7010,6 +7010,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6963,6 +6963,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
10 changes: 10 additions & 0 deletions deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6984,6 +6984,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6979,6 +6979,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
10 changes: 10 additions & 0 deletions deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6984,6 +6984,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6979,6 +6979,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6979,6 +6979,16 @@ spec:
type: object
type: object
type: object
ignoredUnrecoverableEvents:
description: |-
IgnoredUnrecoverableEvents defines a list of Kubernetes event names that should
be ignored when deciding to fail a DevWorkspace startup. This option should be used
if a transient cluster issue is triggering false-positives (for example, if
the cluster occasionally encounters FailedScheduling events). Events listed
here will not trigger DevWorkspace failures.
items:
type: string
type: array
imagePullPolicy:
description: ImagePullPolicy defines the imagePullPolicy used
for containers in a DevWorkspace.
Expand Down
10 changes: 10 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)

updateIgnoredUnrecoverableEvents(operatorConfig, devEnvironments.IgnoredUnrecoverableEvents)

// 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,14 @@ func updateWorkspaceImagePullPolicy(imagePullPolicy corev1.PullPolicy, workspace
workspaceConfig.ImagePullPolicy = string(imagePullPolicy)
}

func updateIgnoredUnrecoverableEvents(operatorConfig *controllerv1alpha1.OperatorConfiguration, ignoredUnrecoverableEvents []string) {
if ignoredUnrecoverableEvents == nil {
operatorConfig.Workspace.IgnoredUnrecoverableEvents = nil
} else {
operatorConfig.Workspace.IgnoredUnrecoverableEvents = ignoredUnrecoverableEvents
}
}

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

Expand Down

0 comments on commit c62ac10

Please sign in to comment.