Skip to content

Commit 3f2bb45

Browse files
committed
commands/.../scorecard/test_definitions: add some godoc
1 parent 11b1270 commit 3f2bb45

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

commands/operator-sdk/cmd/scorecard/test_definitions.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
// Struct definitions
2727

28+
// ScorecardVars contains all necessary variables for running scorecard tests
2829
type ScorecardVars struct {
2930
client *client.Client
3031
crObj *unstructured.Unstructured
@@ -34,13 +35,14 @@ type ScorecardVars struct {
3435
retryInterval int
3536
}
3637

38+
// Score contains the number of earned points and maximum number of points
3739
type Score struct {
3840
earnedPoints int
3941
maximumPoints int
4042
}
4143

44+
// Test defines a scorecard test
4245
type Test struct {
43-
testType string
4446
name string
4547
description string
4648
// by having an array of scores, we can more easily add support for multiple CR
@@ -50,6 +52,7 @@ type Test struct {
5052
run func(*Test, ScorecardVars) error
5153
}
5254

55+
// TestSuite defines a suite of scorecard tests
5356
type TestSuite struct {
5457
name string
5558
description string

test/test-framework/deploy/namespace-init.yaml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: memcached-operator
5+
56
---
67
apiVersion: rbac.authorization.k8s.io/v1
78
kind: Role
@@ -36,6 +37,7 @@ rules:
3637
- '*'
3738
verbs:
3839
- '*'
40+
3941
---
4042
kind: RoleBinding
4143
apiVersion: rbac.authorization.k8s.io/v1
@@ -48,36 +50,41 @@ roleRef:
4850
kind: Role
4951
name: memcached-operator
5052
apiGroup: rbac.authorization.k8s.io
53+
5154
---
5255
apiVersion: apps/v1
5356
kind: Deployment
5457
metadata:
58+
creationTimestamp: null
5559
name: memcached-operator
5660
spec:
5761
replicas: 1
5862
selector:
5963
matchLabels:
6064
name: memcached-operator
65+
strategy: {}
6166
template:
6267
metadata:
68+
creationTimestamp: null
6369
labels:
6470
name: memcached-operator
6571
spec:
66-
serviceAccountName: memcached-operator
6772
containers:
68-
- name: memcached-operator
69-
# Replace this with the built image name
70-
image: quay.io/coreos/operator-sdk-dev:test-framework-operator-runtime
71-
ports:
72-
- containerPort: 60000
73-
name: metrics
74-
command:
75-
- memcached-operator
76-
imagePullPolicy: Always
77-
env:
78-
- name: WATCH_NAMESPACE
79-
valueFrom:
80-
fieldRef:
81-
fieldPath: metadata.namespace
82-
- name: OPERATOR_NAME
83-
value: "memcached-operator"
73+
- command:
74+
- memcached-operator
75+
env:
76+
- name: WATCH_NAMESPACE
77+
valueFrom:
78+
fieldRef:
79+
fieldPath: metadata.namespace
80+
- name: OPERATOR_NAME
81+
value: memcached-operator
82+
image: quay.io/coreos/operator-sdk-dev:test-framework-operator-runtime
83+
imagePullPolicy: Always
84+
name: memcached-operator
85+
ports:
86+
- containerPort: 60000
87+
name: metrics
88+
resources: {}
89+
serviceAccountName: memcached-operator
90+
status: {}

0 commit comments

Comments
 (0)