forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(feature): uses server-side apply to reconile (opendatahub-io#1098)
Aligns reconcile strategy for Managed() features to rely on Server-side apply rather than Update. Former apprach is used by deploy package when reconciling kustomize resources. Later tries to overwrite the entire resource rather than using patch which can lead to errors when trying to overwrite immutable fields such as: ``` failed to update object test-namespace/knative-local-gateway: Service "knative-local-gateway" is invalid: [metadata.resourceVersion: Invalid value: "": must be specified for an update, spec.clusterIP: Invalid value: "": field is immutable] ``` Additional changes - if "managed" annotation is present in one of the resources being part of the feature it will be respected - reworked tests to be more self-descriptive. extracted funcs were adding more hops while reading the code before understanding what is actually happening (cherry picked from commit 9b68ea8)
- Loading branch information
1 parent
3f6fdbe
commit 7d29310
Showing
6 changed files
with
192 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/integration/features/fixtures/templates/local-gateway-svc.tmpl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/integration/features/fixtures/templates/unmanaged-svc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: unmanaged-svc | ||
namespace: "test-namespace" | ||
annotations: | ||
opendatahub.io/managed: "false" | ||
test-annotation: "original-value" | ||
spec: | ||
ports: | ||
- name: http2 | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 8081 | ||
selector: | ||
knative: ingressgateway | ||
type: ClusterIP |
Oops, something went wrong.