Skip to content

Commit 714a3d2

Browse files
authored
Merge pull request #2211 from consideRatio/pr/hard-deprecation
Remove deprecated logic and emit clear messages
2 parents 050c431 + 448ea7e commit 714a3d2

File tree

8 files changed

+57
-58
lines changed

8 files changed

+57
-58
lines changed

doc/source/administrator/advanced.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,7 @@ In your `hub.extraConfig`,
175175
specified as the second parameter (default)
176176

177177
You need to have a `import z2jh` at the top of your `extraConfig` for
178-
`z2jh.get_config()` to work.
179-
180-
```{versionchanged} 0.8
181-
`hub.extraConfigMap` used to be required for specifying additional values
182-
to pass, which was more restrictive.
183-
`hub.extraConfigMap` is deprecated in favor of the new
184-
top-level `custom` field, which allows fully arbitrary yaml.
185-
```
178+
`z2jh.get_config(...)` to work.
186179

187180
### `hub.extraEnv`
188181

jupyterhub/files/hub/jupyterhub_config.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,7 @@ def camelCaseify(s):
377377

378378
cloud_metadata = get_config("singleuser.cloudMetadata", {})
379379

380-
if (
381-
cloud_metadata.get("blockWithIptables") == True
382-
or cloud_metadata.get("enabled") == False
383-
):
380+
if cloud_metadata.get("blockWithIptables") == True:
384381
# Use iptables to block access to cloud metadata by default
385382
network_tools_image_name = get_config("singleuser.networkTools.image.name")
386383
network_tools_image_tag = get_config("singleuser.networkTools.image.tag")

jupyterhub/templates/NOTES.txt

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,27 @@ If you have questions, please:
5858
Warnings for likely misconfiguration
5959
*/}}
6060

61-
{{- if and (not .Values.scheduling.podPriority.enabled) (and .Values.scheduling.userPlaceholder.enabled .Values.scheduling.userPlaceholder.replicas) }}
62-
63-
WARNING: You are using user placeholders without pod priority enabled, either
64-
enable pod priority or stop using the user placeholders to avoid wasting cloud
65-
resources.
61+
{{- if and (not .Values.scheduling.podPriority.enabled) (and .Values.scheduling.userPlaceholder.enabled .Values.scheduling.userPlaceholder.replicas) }}{{ println }}
62+
#################################################################################
63+
###### WARNING: You are using user placeholders without pod priority #####
64+
###### enabled*, either enable pod priority or stop using the #####
65+
###### user placeholders** to avoid having placeholders that #####
66+
###### refuse to make room for a real user. #####
67+
###### #####
68+
###### *scheduling.podPriority.enabled #####
69+
###### **scheduling.userPlaceholder.enabled #####
70+
###### **scheduling.userPlaceholder.replicas #####
71+
#################################################################################
6672
{{- end }}
6773

6874

6975
{{- if eq .Values.proxy.https.enabled false }}
7076
{{- if or (not (eq .Values.proxy.https.type "letsencrypt")) (not (eq (.Values.proxy.https.letsencrypt.contactEmail | default "") "")) }}{{ println }}
71-
WARNING: Configuring proxy.https without setting proxy.https.enabled to true is no longer allowed.
77+
#################################################################################
78+
###### WARNING: proxy.https.enabled is set to false by default since #####
79+
###### version 0.10.0. It is now set to false but proxy.https #####
80+
###### has been modified indicating you may want it enabled. #####
81+
#################################################################################
7282
{{- end }}
7383
{{- end }}
7484

@@ -77,61 +87,69 @@ WARNING: Configuring proxy.https without setting proxy.https.enabled to true is
7787

7888

7989
{{- /*
80-
Deprecation messages that can be removed in 2.0.0
90+
Breaking changes.
8191
*/}}
8292

83-
{{- if .Values.hub.extraConfigMap }}{{ println }}
84-
DEPRECATION: hub.extraConfigMap is deprecated in jupyterhub chart 0.8.
85-
Use top-level `custom` instead:
93+
{{- $breaking := "" }}
94+
{{- $breaking_title := "\n" }}
95+
{{- $breaking_title = print $breaking_title "\n#################################################################################" }}
96+
{{- $breaking_title = print $breaking_title "\n###### BREAKING: The config values passed contained no longer accepted #####" }}
97+
{{- $breaking_title = print $breaking_title "\n###### options. See the messages below for more details. #####" }}
98+
{{- $breaking_title = print $breaking_title "\n###### #####" }}
99+
{{- $breaking_title = print $breaking_title "\n###### To verify your updated config is accepted, you can use #####" }}
100+
{{- $breaking_title = print $breaking_title "\n###### the `helm template` command. #####" }}
101+
{{- $breaking_title = print $breaking_title "\n#################################################################################" }}
102+
86103

87-
custom:
88-
{{- (merge dict .Values.custom .Values.hub.extraConfigMap) | toYaml | nindent 2 }}
104+
{{- if hasKey .Values.hub "extraConfigMap" }}
105+
{{- $breaking = print $breaking "\n\nRENAMED: hub.extraConfigMap has been renamed to custom" }}
89106
{{- end }}
90107

91108

109+
{{- if hasKey .Values "auth" }}
92110
{{- if .Values.auth }}
93-
{{ fail (include "jupyterhub.authDep.remapOldToNew" .) }}
111+
{{- $breaking = print $breaking (include "jupyterhub.authDep.remapOldToNew" .) }}
112+
{{- else }}
113+
{{- $breaking = print $breaking "\n\nREMOVED: Please remove the empty 'auth' config" }}
114+
{{- end }}
94115
{{- end }}
95116

96117

97-
{{- if .Values.proxy.containerSecurityContext }}
98-
{{- fail "\n\nHARD DEPRECATION: proxy.containerSecurityContext has been renamed to proxy.chp.containerSecurityContext" }}
118+
{{- if hasKey .Values.proxy "containerSecurityContext" }}
119+
{{- $breaking = print $breaking "\n\nRENAMED: proxy.containerSecurityContext has been renamed to proxy.chp.containerSecurityContext" }}
99120
{{- end }}
100121

101122

102123
{{- if hasKey .Values.proxy "pdb" }}
103-
{{ fail "\n\nHARD DEPRECATION: proxy.pdb has renamed to proxy.chp.pdb" }}
124+
{{- $breaking = print $breaking "\n\nRENAMED: proxy.pdb has renamed to proxy.chp.pdb" }}
104125
{{- end }}
105126

106127

107-
{{- if .Values.proxy.networkPolicy }}
108-
{{- fail "\n\nHARD DEPRECATION: proxy.networkPolicy has been renamed to proxy.chp.networkPolicy" }}
128+
{{- if hasKey .Values.proxy "networkPolicy" }}
129+
{{- $breaking = print $breaking "\n\nRENAMED: proxy.networkPolicy has been renamed to proxy.chp.networkPolicy" }}
109130
{{- end }}
110131

111132

112133
{{- if hasKey .Values.hub "uid" }}
113-
{{- print "\n\nDEPRECATION: hub.uid is deprecated in jupyterhub chart 0.9. Set the hub.containerSecurityContext.runAsUser value directly instead." }}
134+
{{- $breaking = print $breaking "\n\nRENAMED: hub.uid must as of 1.0.0 be configured using hub.containerSecurityContext.runAsUser" }}
114135
{{- end }}
115136

116137

117-
{{- if (.Values.hub | dig "imagePullSecret" "enabled" "") }}
118-
{{- fail "\n\nHARD DEPRECATION: hub.imagePullSecret has renamed to imagePullSecret" }}
138+
{{- if hasKey .Values.hub "imagePullSecret" }}
139+
{{- $breaking = print $breaking "\n\nREMOVED: hub.imagePullSecret has been removed, but there is now a chart wide wide configuration named imagePullSecret" }}
119140
{{- end }}
120141

121142

122-
{{- if (.Values.singleuser | dig "imagePullSecret" "enabled" "") }}
123-
{{- fail "\n\nHARD DEPRECATION: singleuser.imagePullSecret has renamed to imagePullSecret" }}
143+
{{- if hasKey .Values.singleuser "imagePullSecret" }}
144+
{{- $breaking = print $breaking "\n\nREMOVED: singleuser.imagePullSecret has been removed, but there is now a chart wide wide configuration named imagePullSecret" }}
124145
{{- end }}
125146

126147

127-
{{- if (.Values.singleuser | dig "cloudMetadata" "enabled" "") }}
128-
{{- print "\n\nDEPRECATION: singleuser.cloudMetadata.enabled is deprecated, instead use singleuser.cloudMetadata.blockWithIptables with the inverted value." }}
148+
{{- if hasKey .Values.singleuser.cloudMetadata "enabled" }}
149+
{{- $breaking = print $breaking "\n\nCHANGED: singleuser.cloudMetadata.enabled must as of 1.0.0 be configured using singleuser.cloudMetadata.blockWithIptables with the opposite value." }}
129150
{{- end }}
130151

131152

132-
133-
134-
135-
{{- /*
136-
Deprecation messages that can be removed in 3.0.0
137-
*/}}
153+
{{- if $breaking }}
154+
{{- fail (print $breaking_title $breaking) }}
155+
{{- end }}

jupyterhub/templates/_helpers-auth-rework.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ ldap.dn.user.useLookupName: LDAPAuthenticator.use_lookup_dn_username
203203
{{- end }}
204204
205205
{{- /* UPDATE c dict authenticator_class */}}
206-
{{- $_ := merge $c (dict "JupyterHub" (dict "authenticator_class" $class_new_entrypoint)) }}
206+
{{- if ne $class_new_entrypoint "<no value>" }}
207+
{{- $_ := merge $c (dict "JupyterHub" (dict "authenticator_class" $class_new_entrypoint)) }}
208+
{{- end }}
207209
208210
{{- /* Output a sensible error message */}}
209211

jupyterhub/templates/hub/deployment.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,9 @@ spec:
169169
{{- with .Values.hub.image.pullPolicy }}
170170
imagePullPolicy: {{ . }}
171171
{{- end }}
172-
{{- /* Below is deprecation logic of .Values.hub.uid */}}
173-
{{- if .Values.hub.containerSecurityContext }}
174-
{{- $securityContext := dict }}
175-
{{- if hasKey .Values.hub "uid" }}
176-
{{- $_ := merge $securityContext (dict "runAsUser" .Values.hub.uid) }}
177-
{{- end }}
178-
{{- $_ := merge $securityContext .Values.hub.containerSecurityContext }}
172+
{{- with .Values.hub.containerSecurityContext }}
179173
securityContext:
180-
{{- $securityContext | toYaml | trimSuffix "\n" | nindent 12 }}
174+
{{- . | toYaml | trimSuffix "\n" | nindent 12 }}
181175
{{- end }}
182176
{{- with .Values.hub.lifecycle }}
183177
lifecycle:

jupyterhub/templates/hub/secret.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ metadata:
77
type: Opaque
88
data:
99
{{- $values := merge dict .Values }}
10-
{{- /* preserve behavior of deprecated hub.extraConfigMap */}}
11-
{{- $_ := set $values "custom" (merge dict $values.custom .Values.hub.extraConfigMap) }}
12-
{{- /* passthrough subset of Chart / Release */}}
10+
{{- /* also passthrough subset of Chart / Release */}}
1311
{{- $_ := set $values "Chart" (dict "Name" .Chart.Name "Version" .Chart.Version) }}
1412
{{- $_ := set $values "Release" (pick .Release "Name" "Namespace" "Service") }}
1513
values.yaml: {{ $values | toYaml | b64enc | quote }}

jupyterhub/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ hub:
7272
command: []
7373
args: []
7474
extraConfig: {}
75-
extraConfigMap: {}
7675
extraFiles: {}
7776
extraEnv: {}
7877
extraContainers: []

tools/templates/lint-and-validate-values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ hub:
107107
extraConfig:
108108
test: |-
109109
c.Spawner.cmd = 'mock'
110-
extraConfigMap:
111-
mock.entry: mock-config-map-entry
112110
extraEnv: &extraEnv
113111
IGNORED_KEY_NAME:
114112
name: MOCK_ENV_VAR_NAME1

0 commit comments

Comments
 (0)