Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 6fd3ed5

Browse files
committed
Fix lint
1 parent 91a56b1 commit 6fd3ed5

File tree

6 files changed

+54
-8
lines changed

6 files changed

+54
-8
lines changed

deploy/clusterrole.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,17 @@ rules:
110110
- serviceaccounts
111111
verbs:
112112
- '*'
113+
- apiGroups:
114+
- batch
115+
resources:
116+
- jobs
117+
verbs:
118+
- '*'
119+
- apiGroups:
120+
- certmanager.k8s.io
121+
resources:
122+
- certificate
123+
- issuer
124+
verbs:
125+
- '*'
113126
---

deploy/crds/istio_v1alpha2_istiocontrolplane_cr.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,29 @@ metadata:
55
name: example-istiocontrolplane
66
spec:
77
profile: demo
8+
trafficManagem:
9+
components:
10+
pilot:
11+
k8s:
12+
env:
13+
- name: POD_NAME
14+
valueFrom:
15+
fieldRef:
16+
apiVersion: v1
17+
fieldPath: metadata.name
18+
- name: POD_NAMESPACE
19+
valueFrom:
20+
fieldRef:
21+
apiVersion: v1
22+
fieldPath: metadata.namespace
23+
- name: GODEBUG
24+
value: gctrace=1
25+
- name: PILOT_TRACE_SAMPLING
26+
value: "100"
27+
- name: CONFIG_NAMESPACE
28+
value: istio-config
29+
resources:
30+
requests:
31+
cpu: 10m
32+
memory: 100Mi
833
---

deploy/operator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ spec:
2424
command:
2525
- istio-operator
2626
- server
27+
securityContext:
28+
runAsUser: 0
29+
runAsNonRoot: false
30+
capabilities:
31+
add:
32+
- NET_ADMIN
2733
imagePullPolicy: Always
2834
env:
2935
- name: WATCH_NAMESPACE

pkg/webhook/istiocontrolplane/iscpwebhook.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ package istiocontrolplane
1616

1717
import (
1818
"context"
19-
"istio.io/operator/pkg/apis/istio/v1alpha2"
20-
"istio.io/operator/pkg/validate"
19+
2120
"sigs.k8s.io/controller-runtime/pkg/client"
2221
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
22+
23+
"istio.io/operator/pkg/apis/istio/v1alpha2"
24+
"istio.io/operator/pkg/validate"
2325
)
2426

25-
// +kubebuilder:webhook:path=/validate-v1alpha2-istiocontrolplane,mutating=true,failurePolicy=fail,groups="install.istio.io",resources=IstioControlPlane,verbs=create;update,versions=v1alpha2,name=mistiocontrolplane.kb.io
27+
// +kubebuilder:webhook:path=/validate-v1alpha2-istiocontrolplane,mutating=true,failurePolicy=fail,
28+
// groups="install.istio.io",resources=IstioControlPlane,verbs=create;update,versions=v1alpha2,name=mistiocontrolplane.kb.io
2629

2730
// podAnnotator annotates Pods
2831
type iscpValidator struct {
@@ -54,4 +57,4 @@ func (a *iscpValidator) InjectClient(c client.Client) error {
5457
func (a *iscpValidator) InjectDecoder(d *admission.Decoder) error {
5558
a.decoder = d
5659
return nil
57-
}
60+
}

pkg/webhook/istiocontrolplane/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func Add(mgr manager.Manager) error {
2828
func add(mgr manager.Manager) error {
2929
log.Info("setting up webhook server")
3030
webhookServer := mgr.GetWebhookServer()
31-
//webhookServer.CertDir = "/tmp/cert"
3231

3332
webhookServer.Register("/validate-v1alpha2-istiocontrolplane",
3433
&webhook.Admission{Handler: &iscpValidator{}})

pkg/webhook/webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
package webhook
1616

1717
import (
18-
"istio.io/operator/pkg/webhook/istiocontrolplane"
1918
"sigs.k8s.io/controller-runtime/pkg/manager"
20-
)
2119

20+
"istio.io/operator/pkg/webhook/istiocontrolplane"
21+
)
2222

2323
// AddToManager adds all webhooks to the Manager
2424
func AddToManager(m manager.Manager) error {
2525
return istiocontrolplane.Add(m)
26-
}
26+
}

0 commit comments

Comments
 (0)