Skip to content

Commit 3a8ba58

Browse files
Merge pull request #317 from tremes/my-master
Bug 1918129: Update the sample archive and remove IP anonymization in clusteropera…
2 parents 2bbd615 + 63f5576 commit 3a8ba58

File tree

18 files changed

+128
-96
lines changed

18 files changed

+128
-96
lines changed

Diff for: docs/insights-archive-sample/config/clusteroperator/operator.openshift.io/authentication/cluster.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "Authentication",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Authentication",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"observedConfig": {
@@ -77,4 +77,4 @@
7777
"useUnsupportedUnsafeNonHANonProductionUnstableOAuthServer": true
7878
}
7979
}
80-
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "CloudCredential",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "CloudCredential",
4+
"name": "cluster",
5+
"spec": {
66
"credentialsMode": "",
77
"logLevel": "Normal"
88
}
9-
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "Config",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Config",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "Console",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Console",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "CSISnapshotController",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "CSISnapshotController",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "DNS",
4-
"Name": "default",
5-
"Spec": {}
6-
}
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "DNS",
4+
"name": "default",
5+
"spec": {}
6+
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "Etcd",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Etcd",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal",
99
"unsupportedConfigOverrides": {
1010
"useUnsupportedUnsafeNonHANonProductionUnstableEtcd": true
1111
}
1212
}
13-
}
13+
}

Diff for: docs/insights-archive-sample/config/clusteroperator/operator.openshift.io/kubeapiserver/cluster.json

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "KubeAPIServer",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "KubeAPIServer",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"observedConfig": {
@@ -20,8 +20,8 @@
2020
"apiVersion": "network.openshift.io/v1",
2121
"kind": "RestrictedEndpointsAdmissionConfig",
2222
"restrictedCIDRs": [
23-
"xxxxxxxxxx/14",
24-
"xxxxxxxxxx/16"
23+
"10.128.0.0/14",
24+
"172.30.0.0/16"
2525
]
2626
}
2727
}
@@ -31,6 +31,12 @@
3131
"audit-policy-file": [
3232
"/etc/kubernetes/static-pod-resources/configmaps/kube-apiserver-audit-policies/default.yaml"
3333
],
34+
"cloud-config": [
35+
"/etc/kubernetes/static-pod-resources/configmaps/cloud-config/config"
36+
],
37+
"cloud-provider": [
38+
"gce"
39+
],
3440
"etcd-servers": [
3541
"xxxxxxxxxxxxxxxxxxxxxxx",
3642
"xxxxxxxxxxxxxxxxxxxxxx"
@@ -55,9 +61,9 @@
5561
"imagePolicyConfig": {
5662
"internalRegistryHostname": "image-registry.openshift-image-registry.svc:5000"
5763
},
58-
"servicesSubnet": "xxxxxxxxxx/16",
64+
"servicesSubnet": "172.30.0.0/16",
5965
"servingInfo": {
60-
"bindAddress": "xxxxxxx:6443",
66+
"bindAddress": "0.0.0.0:6443",
6167
"bindNetwork": "tcp4",
6268
"cipherSuites": [
6369
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
@@ -95,4 +101,4 @@
95101
"operatorLogLevel": "Normal",
96102
"unsupportedConfigOverrides": null
97103
}
98-
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "KubeControllerManager",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "KubeControllerManager",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"observedConfig": {
99
"extendedArguments": {
10+
"cloud-config": [
11+
"/etc/kubernetes/static-pod-resources/configmaps/cloud-config/cloud.conf"
12+
],
13+
"cloud-provider": [
14+
"gce"
15+
],
1016
"cluster-cidr": [
11-
"xxxxxxxxxx/14"
17+
"10.128.0.0/14"
1218
],
1319
"cluster-name": [
1420
"tremes-5f2nt"
@@ -20,10 +26,11 @@
2026
"NodeDisruptionExclusion=true",
2127
"ServiceNodeExclusion=true",
2228
"SCTPSupport=true",
23-
"LegacyNodeRoleBehavior=false"
29+
"LegacyNodeRoleBehavior=false",
30+
"RemoveSelfLink=false"
2431
],
2532
"service-cluster-ip-range": [
26-
"xxxxxxxxxx/16"
33+
"172.30.0.0/16"
2734
]
2835
},
2936
"serviceServingCert": {
@@ -33,4 +40,4 @@
3340
"operatorLogLevel": "Normal",
3441
"unsupportedConfigOverrides": null
3542
}
36-
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "KubeScheduler",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "KubeScheduler",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "KubeStorageVersionMigrator",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "KubeStorageVersionMigrator",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Network",
4+
"name": "cluster",
5+
"spec": {
6+
"clusterNetwork": [
7+
{
8+
"cidr": "10.128.0.0/14",
9+
"hostPrefix": 23
10+
}
11+
],
12+
"defaultNetwork": {
13+
"type": "OpenShiftSDN"
14+
},
15+
"disableNetworkDiagnostics": false,
16+
"logLevel": "Normal",
17+
"managementState": "Managed",
18+
"observedConfig": null,
19+
"operatorLogLevel": "Normal",
20+
"serviceNetwork": [
21+
"172.30.0.0/16"
22+
],
23+
"unsupportedConfigOverrides": null
24+
}
25+
}

Diff for: docs/insights-archive-sample/config/clusteroperator/operator.openshift.io/openshiftapiserver/cluster.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "OpenShiftAPIServer",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "OpenShiftAPIServer",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"observedConfig": {
@@ -40,4 +40,4 @@
4040
"operatorLogLevel": "Normal",
4141
"unsupportedConfigOverrides": null
4242
}
43-
}
43+
}

Diff for: docs/insights-archive-sample/config/clusteroperator/operator.openshift.io/openshiftcontrollermanager/cluster.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "OpenShiftControllerManager",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "OpenShiftControllerManager",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"observedConfig": {
@@ -29,4 +29,4 @@
2929
"operatorLogLevel": "Normal",
3030
"unsupportedConfigOverrides": null
3131
}
32-
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "ServiceCA",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "ServiceCA",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"APIVersion": "operator.openshift.io/v1",
3-
"Kind": "Storage",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "operator.openshift.io/v1",
3+
"kind": "Storage",
4+
"name": "cluster",
5+
"spec": {
66
"logLevel": "Normal",
77
"managementState": "Managed",
88
"operatorLogLevel": "Normal"
99
}
10-
}
10+
}

Diff for: docs/insights-archive-sample/config/clusteroperator/samples.operator.openshift.io/config/cluster.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"APIVersion": "samples.operator.openshift.io/v1",
3-
"Kind": "Config",
4-
"Name": "cluster",
5-
"Spec": {
2+
"apiVersion": "samples.operator.openshift.io/v1",
3+
"kind": "Config",
4+
"name": "cluster",
5+
"spec": {
66
"architectures": [
77
"x86_64"
88
],

Diff for: pkg/gather/clusterconfig/operators.go

+4-10
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ const (
3939
)
4040

4141
type clusterOperatorResource struct {
42-
APIVersion string `json:"apiVersion"`
43-
Kind string `json:"kind"`
44-
Name string `json:"name"`
45-
Spec interface{}
42+
APIVersion string `json:"apiVersion"`
43+
Kind string `json:"kind"`
44+
Name string `json:"name"`
45+
Spec interface{} `json:"spec"`
4646
}
4747

4848
// GatherClusterOperators collects all ClusterOperators and their resources.
@@ -342,12 +342,6 @@ func (a ClusterOperatorResourceAnonymizer) Marshal(_ context.Context) ([]byte, e
342342
m = strings.ReplaceAll(m, "\"", "")
343343
resStr = strings.ReplaceAll(resStr, m, anonymizeString(m))
344344
}
345-
// anonymize IP addresses
346-
re = regexp.MustCompile(`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}`)
347-
ipMatches := re.FindAllString(resStr, -1)
348-
for _, m := range ipMatches {
349-
resStr = strings.ReplaceAll(resStr, m, anonymizeString(m))
350-
}
351345
return []byte(resStr), nil
352346
}
353347

0 commit comments

Comments
 (0)