GoogleCloudPlatform / GoogleCloudPlatform/deploymentmanager-samples

GKE Sample won't support update semantics for Service objects

Open
#380 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jinja
Stars
951
Forks
700
PR merge metrics
No merged PRs in 30d

Description

In addition to the general problem of `resourceVersion` mentioned in #379, the [`Service` object](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#service-v1-core) has an additional requirement that the `clusterIP` is an immutable value. Thus, if it's not specified in the initial resource values and gets auto-assigned by Kubernetes, during an update, it appears to Kubernetes that DM is trying to set it back to blank, and it errors out: `Service \"service\" is invalid: [spec.clusterIP: Invalid value: \"\": field is immutable]`

This can be addressed by adding a method-specific input mapping for the `Service` object:

```
collectionOverrides:
- collection: '/api/v1/namespaces/{namespace}/services'
options:
inputMappings:
- fieldName: 'spec.clusterIP'
location: BODY
methodMatch: '^(PUT|PATCH)$'
value: '$.resource.self.spec.clusterIP'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.