| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,8 @@ Changes should still be described appropriately in JIRA/doc input pages, for inc | |||
| 30 | 30 | ||
| 31 | 31 | ### Technical Changes | |
| 32 | 32 | ||
| 33 | + - OpenShift 3 support removed from all installation methods. | ||
| 34 | + | ||
| 33 | 35 | ## [4.10.0] | |
| 34 | 36 | ||
| 35 | 37 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -135,7 +135,7 @@ func TestRenderWithNoCollection(t *testing.T) { | |||
| 135 | 135 | cluster := &storage.Cluster{ | |
| 136 | 136 | Name: "cluster", | |
| 137 | 137 | MainImage: "stackrox/main:abc", | |
| 138 | - Type: storage.ClusterType_OPENSHIFT_CLUSTER, | ||
| 138 | + Type: storage.ClusterType_OPENSHIFT4_CLUSTER, | ||
| 139 | 139 | CollectionMethod: storage.CollectionMethod_NO_COLLECTION, | |
| 140 | 140 | } | |
| 141 | 141 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -271,7 +271,7 @@ func (i *Image) GetSensorChart(values *charts.MetaValues, certs *sensor.Certs) ( | |||
| 271 | 271 | func (i *Image) addScripts(values *charts.MetaValues) ([]*loader.BufferedFile, error) { | |
| 272 | 272 | if values.ClusterType == storage.ClusterType_KUBERNETES_CLUSTER.String() { | |
| 273 | 273 | return i.scripts(values, k8sScriptsFileMap) | |
| 274 | - } else if values.ClusterType == storage.ClusterType_OPENSHIFT_CLUSTER.String() || values.ClusterType == storage.ClusterType_OPENSHIFT4_CLUSTER.String() { | ||
| 274 | + } else if values.ClusterType == storage.ClusterType_OPENSHIFT4_CLUSTER.String() { | ||
| 275 | 275 | return i.scripts(values, osScriptsFileMap) | |
| 276 | 276 | } | |
| 277 | 277 | return nil, errors.Errorf("unable to create sensor bundle, invalid cluster type for cluster %s", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,12 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | 3 | {{- if or ._rox.scannerV4._indexerEnabled ._rox.scannerV4._matcherEnabled }} | |
| 4 | 4 | {{- if ._rox.env.openshift }} | |
| 5 | - {{- if eq ._rox.env.openshift 3 }} | ||
| 6 | - {{ include "srox.warn" (list . "On OpenShift 3.x no SecurityContextConstraint will be configured for Scanner V4.") }} | ||
| 7 | - {{- else }} | ||
| 8 | - {{/* Use a default SCC that ships with OpenShift 4.x. | ||
| 9 | - We only need to create a Role and a RoleBinding for | ||
| 10 | - associating the SCC with the Scanner V4 deployment. */}} | ||
| 5 | + {{/* Use a default SCC that ships with OpenShift 4.x. | ||
| 6 | + We only need to create a Role and a RoleBinding for | ||
| 7 | + associating the SCC with the Scanner V4 deployment. */}} | ||
| 11 | 8 | apiVersion: rbac.authorization.k8s.io/v1 | |
| 12 | 9 | kind: Role | |
| 13 | 10 | metadata: | |
@@ -47,6 +44,5 @@ subjects: | |||
| 47 | 44 | - kind: ServiceAccount | |
| 48 | 45 | name: scanner-v4 | |
| 49 | 46 | namespace: {{ .Release.Namespace }} | |
| 50 | - {{- end }} | ||
| 51 | 47 | {{- end }} | |
| 52 | 48 | {{- end }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,13 +4,11 @@ | |||
| 4 | 4 | This function detects the OpenShift version automatically based on the cluster the Helm chart is installed onto. | |
| 5 | 5 | It writes the result to ._rox.env.openshift as an integer. | |
| 6 | 6 | Possible results are: | |
| 7 | - - 3 (OpenShift 3) | ||
| 8 | 7 | - 4 (OpenShift 4) | |
| 9 | 8 | - 0 (Non-Openshift cluster) | |
| 10 | 9 | ||
| 11 | - If "true" is passed for $._rox.env.openshift the OpenShift version is detected based on the Kubernetes cluster version. | ||
| 12 | - If the Kubernetes version is not available (i.e. when using Helm template) auto-sensing falls back on OpenShift 3 to be | ||
| 13 | - backward compatible. | ||
| 10 | + If "true" is passed for $._rox.env.openshift, this is unconditionally mapped to OpenShift version "4", because that is the only | ||
| 11 | + major version we currently support. | ||
| 14 | 12 | */}} | |
| 15 | 13 | ||
| 16 | 14 | {{ define "srox.autoSenseOpenshiftVersion" }} | |
@@ -20,31 +18,25 @@ | |||
| 20 | 18 | ||
| 21 | 19 | {{/* Infer OpenShift, if needed */}} | |
| 22 | 20 | {{ if kindIs "invalid" $env.openshift }} | |
| 23 | - {{/* The API GroupVersion project.openshift.io/v1 contains the core OpenShift API 'Project' of | ||
| 24 | - compatibility level 1, which comes with the strongest stability guarantees among the OpenShift APIs. | ||
| 25 | - This API is available in OpenShift 3.x and 4.x. */}} | ||
| 26 | - {{ $_ := set $env "openshift" (has "project.openshift.io/v1" $._rox._apiServer.apiResources) }} | ||
| 21 | + {{/* This CRD API reliably indicates OpenShift 4. */}} | ||
| 22 | + {{ $_ := set $env "openshift" (has "config.openshift.io/v1" $._rox._apiServer.apiResources) }} | ||
| 23 | + {{- if $env.openshift -}} | ||
| 24 | + {{- include "srox.note" (list $ (printf "Based on API server properties, we have inferred that you are deploying into an OpenShift 4.x cluster.")) -}} | ||
| 25 | + {{- end -}} | ||
| 27 | 26 | {{ end }} | |
| 28 | - | ||
| 29 | - {{/* Infer openshift version */}} | ||
| 30 | 27 | {{ if and $env.openshift (kindIs "bool" $env.openshift) }} | |
| 31 | - {{/* Parse and add KubeVersion as semver from built-in resources. This is necessary to compare valid integer numbers. */}} | ||
| 32 | - {{ $kubeVersion := semver $.Capabilities.KubeVersion.Version }} | ||
| 33 | - | ||
| 34 | - {{/* Default to OpenShift 3 if no openshift resources are available, i.e. in helm template commands */}} | ||
| 35 | - {{ if not (has "project.openshift.io/v1" $._rox._apiServer.apiResources) }} | ||
| 36 | - {{ $_ := set $._rox.env "openshift" 3 }} | ||
| 37 | - {{ else if gt $kubeVersion.Minor 11 }} | ||
| 38 | - {{ $_ := set $env "openshift" 4 }} | ||
| 39 | - {{ else }} | ||
| 40 | - {{ $_ := set $env "openshift" 3 }} | ||
| 41 | - {{ end }} | ||
| 42 | - {{ include "srox.note" (list $ (printf "Based on API server properties, we have inferred that you are deploying into an OpenShift %d.x cluster. Set the `env.openshift` property explicitly to 3 or 4 to override the auto-sensed value." $env.openshift)) }} | ||
| 28 | + {{/* We only support OpenShift 4. */}} | ||
| 29 | + {{ $_ := set $env "openshift" 4 }} | ||
| 43 | 30 | {{ end }} | |
| 31 | + | ||
| 44 | 32 | {{ if not (kindIs "bool" $env.openshift) }} | |
| 45 | 33 | {{ $_ := set $env "openshift" (int $env.openshift) }} | |
| 46 | 34 | {{ else if not $env.openshift }} | |
| 47 | 35 | {{ $_ := set $env "openshift" 0 }} | |
| 48 | 36 | {{ end }} | |
| 49 | 37 | ||
| 38 | + {{- if and (ne $env.openshift 0) (ne $env.openshift 4) -}} | ||
| 39 | + {{- include "srox.fail" (printf "You have specified OpenShift version %d.x, but only version 4.x is currently supported." $env.openshift) -}} | ||
| 40 | + {{- end -}} | ||
| 41 | + | ||
| 50 | 42 | {{ end }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ clusterConfig: | |||
| 7 | 7 | {{- if not ._rox.env.openshift }} | |
| 8 | 8 | type: KUBERNETES_CLUSTER | |
| 9 | 9 | {{- else }} | |
| 10 | - type: {{ if eq (int ._rox.env.openshift) 4 -}} OPENSHIFT4_CLUSTER {{- else -}} OPENSHIFT_CLUSTER {{ end }} | ||
| 10 | + type: OPENSHIFT4_CLUSTER | ||
| 11 | 11 | {{- end }} | |
| 12 | 12 | mainImage: {{ coalesce ._rox.image.main._abbrevImageRef ._rox.image.main.fullRef }} | |
| 13 | 13 | collectorImage: {{ coalesce ._rox.image.collector._abbrevImageRef ._rox.image.collector.fullRef }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,13 +60,7 @@ admissionControl: | |||
| 60 | 60 | [<- if .FeatureFlags.ROX_ADMISSION_CONTROLLER_CONFIG >] | |
| 61 | 61 | listenOnCreates: true | |
| 62 | 62 | listenOnUpdates: true | |
| 63 | - {{/* At this point, when defaults are applied, we can expect env.openshift to be false or a major version number (3, 4). */}} | ||
| 64 | - {{- if or (not ._rox.env.openshift) (gt ._rox.env.openshift 3) }} | ||
| 65 | 63 | listenOnEvents: true | |
| 66 | - {{- else }} | ||
| 67 | - {{/* OpenShift 3.x does not support this. */}} | ||
| 68 | - listenOnEvents: false | ||
| 69 | - {{- end }} | ||
| 70 | 64 | [<- else >] | |
| 71 | 65 | listenOnCreates: false | |
| 72 | 66 | listenOnUpdates: false | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,7 +106,7 @@ Here is the list of old and new configuration options: | |||
| 106 | 106 | |Old configuration option |New configuration option | | |
| 107 | 107 | |-------------------------|-------------------------| | |
| 108 | 108 | | `cluster.name` | `clusterName` | | |
| 109 | - | `cluster.type` | Set `env.openshift` to `true` for `cluster.type=OPENSHIFT_CLUSTER` and `false` for `cluster.type=KUBERNETES_CLUSTER`. Leave unset to automatically detect (recommended). | | ||
| 109 | + | `cluster.type` | Set `env.openshift` to `true` for `cluster.type=OPENSHIFT4_CLUSTER` and `false` for `cluster.type=KUBERNETES_CLUSTER`. Leave unset to automatically detect (recommended). | | ||
| 110 | 110 | | `endpoint.central` | `centralEndpoint` | | |
| 111 | 111 | | `endpoint.advertised` | `sensor.endpoint` | | |
| 112 | 112 | | `image.repository.main` | `image.main.name` | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -210,12 +210,6 @@ | |||
| 210 | 210 | {{ include "srox.warn" (list $ "Incompatible settings: 'admissionControl.dynamic.enforceOnUpdates' is set to true, while `admissionControl.listenOnUpdates` is set to false. For the feature to be active, enable both settings by setting them to true.") }} | |
| 211 | 211 | {{ end }} | |
| 212 | 212 | ||
| 213 | - [<- if not .FeatureFlags.ROX_ADMISSION_CONTROLLER_CONFIG >] | ||
| 214 | - {{ if and (eq $._rox.env.openshift 3) $._rox.admissionControl.listenOnEvents }} | ||
| 215 | - {{ include "srox.fail" "'admissionControl.listenOnEvents' is set to true, but the chart is being deployed in OpenShift 3.x compatibility mode, which does not work with this feature. Set 'env.openshift' to '4' in order to enable OpenShift 4.x features." }} | ||
| 216 | - {{ end }} | ||
| 217 | - [<- end >] | ||
| 218 | - | ||
| 219 | 213 | {{ if $._rox.collector.slimMode }} | |
| 220 | 214 | {{ include "srox.warn" (list $ "collector.slimMode is set to true, but it has been removed in 4.7 after being deprecated since 4.5. This setting will be ignored.") }} | |
| 221 | 215 | {{ end }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ spec: | |||
| 25 | 25 | {{- include "srox.podLabels" (list . "deployment" "admission-control") | nindent 8 }} | |
| 26 | 26 | annotations: | |
| 27 | 27 | {{- $annotations := dict "traffic.sidecar.istio.io/excludeInboundPorts" "8443" -}} | |
| 28 | - {{- if eq ._rox.env.openshift 4 }} | ||
| 28 | + {{- if ._rox.env.openshift }} | ||
| 29 | 29 | {{- $_ := set $annotations "openshift.io/required-scc" "restricted-v2" -}} | |
| 30 | 30 | {{- end }} | |
| 31 | 31 | {{- include "srox.podAnnotations" (list . "deployment" "admission-control" $annotations) | nindent 8 }} | |
@@ -215,11 +215,7 @@ spec: | |||
| 215 | 215 | type: ClusterIP | |
| 216 | 216 | sessionAffinity: None | |
| 217 | 217 | --- | |
| 218 | - {{- if ne ._rox.env.openshift 3 }} | ||
| 219 | 218 | apiVersion: admissionregistration.k8s.io/v1 | |
| 220 | - {{- else }} | ||
| 221 | - apiVersion: admissionregistration.k8s.io/v1beta1 | ||
| 222 | - {{- end }} | ||
| 223 | 219 | kind: ValidatingWebhookConfiguration | |
| 224 | 220 | metadata: | |
| 225 | 221 | name: stackrox | |
@@ -231,11 +227,9 @@ metadata: | |||
| 231 | 227 | webhooks: | |
| 232 | 228 | {{- if or ._rox.admissionControl.dynamic.enforceOnCreates ._rox.admissionControl.dynamic.enforceOnUpdates }} | |
| 233 | 229 | - name: policyeval.stackrox.io | |
| 234 | - {{- if ne ._rox.env.openshift 3 }} | ||
| 235 | 230 | sideEffects: NoneOnDryRun | |
| 236 | 231 | admissionReviewVersions: [ "v1", "v1beta1" ] | |
| 237 | 232 | timeoutSeconds: {{ add 2 ._rox.admissionControl.dynamic.timeout }} | |
| 238 | - {{- end }} | ||
| 239 | 233 | rules: | |
| 240 | 234 | - apiGroups: | |
| 241 | 235 | - '*' | |
@@ -280,11 +274,9 @@ webhooks: | |||
| 280 | 274 | {{- end}} | |
| 281 | 275 | {{- if ._rox.admissionControl.listenOnEvents }} | |
| 282 | 276 | - name: k8sevents.stackrox.io | |
| 283 | - {{- if ne ._rox.env.openshift 3 }} | ||
| 284 | 277 | sideEffects: NoneOnDryRun | |
| 285 | 278 | admissionReviewVersions: [ "v1", "v1beta1" ] | |
| 286 | 279 | timeoutSeconds: {{ add 2 ._rox.admissionControl.dynamic.timeout }} | |
| 287 | - {{- end }} | ||
| 288 | 280 | rules: | |
| 289 | 281 | - apiGroups: | |
| 290 | 282 | - '*' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments