Skip to content

werft/deploy/post-process: Remove openvsx statefulsetstatus #8532

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

Merged
merged 2 commits into from
Mar 2, 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
9 changes: 9 additions & 0 deletions .werft/jobs/build/installer/post-process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ while [ "$i" -le "$DOCS" ]; do
yq m -x -i k8s.yaml -d "$i" /tmp/"$NAME"overrides.yaml
fi

if [[ "openvsx-proxy" == "$NAME" ]] && [[ "$KIND" == "StatefulSet" ]]; then
# Our installer is rendering StatefulSet Status field although it is not a necessary field.
# In fact, the fields under StatefulSet status has changed over the last Kubernetes versions,
# We're being hit by this while trying to install Gitpod on GKE and k3s running different versions
# where 'availableReplicas' is unkown in GKE while being required on k3s.
# This workaround should be deleted when https://github.com/gitpod-io/gitpod/issues/8529 gets fixed.
yq d -i k8s.yaml -d "$i" 'status'
fi

if [[ ! -v WITH_VM ]] && [[ "ws-proxy" == "$NAME" ]] && [[ "$KIND" == "Service" ]]; then
WORK="overrides for $NAME $KIND"
echo "$WORK"
Expand Down
18 changes: 18 additions & 0 deletions install/installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ yq eval-all --inplace \
gitpod.yaml
```

## Error validating `StatefulSet.status`

```shell
error: error validating "gitpod.yaml": error validating data: ValidationError(StatefulSet.status): missing required field "availableReplicas" in io.k8s.api.apps.v1.StatefulSetStatus; if you choose to ignore these errors, turn validation off with --validate=false
```

Depending upon your Kubernetes implementation, you may receive this error. This is
due to a bug in the underlying StatefulSet dependency, which is used to generate the
OpenVSX proxy (see [#8529](https://github.com/gitpod-io/gitpod/issues/8529)).

To fix this, you will need to post-process the rendered YAML to remove the `status` field.

```shell
yq eval-all --inplace \
'del(select(.kind == "StatefulSet" and .metadata.name == "openvsx-proxy").status)' \
gitpod.yaml
```

---

# What is installed
Expand Down