Commit 89b0b0b8 authored by Jordan Liggitt's avatar Jordan Liggitt

Clean up initializer-related comments, test data

parent f5f5d9a5
...@@ -58,7 +58,7 @@ spec: ...@@ -58,7 +58,7 @@ spec:
- --requestheader-username-headers=X-Remote-User - --requestheader-username-headers=X-Remote-User
- --requestheader-extra-headers-prefix=X-Remote-Extra- - --requestheader-extra-headers-prefix=X-Remote-Extra-
- --requestheader-allowed-names=front-proxy-client - --requestheader-allowed-names=front-proxy-client
- --admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota - --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota
- --allow-privileged=true - --allow-privileged=true
- --client-ca-file=/etc/kubernetes/pki/ca.crt - --client-ca-file=/etc/kubernetes/pki/ca.crt
- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key - --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
...@@ -139,7 +139,7 @@ spec: ...@@ -139,7 +139,7 @@ spec:
- --requestheader-username-headers=X-Remote-User - --requestheader-username-headers=X-Remote-User
- --requestheader-extra-headers-prefix=X-Remote-Extra- - --requestheader-extra-headers-prefix=X-Remote-Extra-
- --requestheader-allowed-names=front-proxy-client - --requestheader-allowed-names=front-proxy-client
- --admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota - --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota
- --allow-privileged=true - --allow-privileged=true
- --client-ca-file=/etc/kubernetes/pki/ca.crt - --client-ca-file=/etc/kubernetes/pki/ca.crt
- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key - --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
......
...@@ -200,7 +200,6 @@ ...@@ -200,7 +200,6 @@
./test/cmd/discovery.sh ./test/cmd/discovery.sh
./test/cmd/generic-resources.sh ./test/cmd/generic-resources.sh
./test/cmd/get.sh ./test/cmd/get.sh
./test/cmd/initializers.sh
./test/cmd/legacy-script.sh ./test/cmd/legacy-script.sh
./test/cmd/node-management.sh ./test/cmd/node-management.sh
./test/cmd/old-print.sh ./test/cmd/old-print.sh
......
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: super-admin
initializers:
pending:
- name: podimage.initializer.com
labels:
clusterrolebinding: super
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: super-admin
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
initializers:
pending:
- name: podimage.initializer.com
labels:
run: web
spec:
replicas: 5
selector:
matchLabels:
run: web
template:
metadata:
labels:
run: web
spec:
containers:
- image: nginx:1.10
name: web
ports:
- containerPort: 80
protocol: TCP
apiVersion: v1
kind: Service
metadata:
name: redis-master
labels:
app: redis
role: master
tier: backend
initializers:
pending:
- name: podimage.initializer.com
spec:
ports:
- port: 6379
targetPort: 6379
selector:
app: redis
role: master
tier: backend
...@@ -25,7 +25,7 @@ func TestValidate(t *testing.T) { ...@@ -25,7 +25,7 @@ func TestValidate(t *testing.T) {
// 1. Both `--admission-control` and `--enable-admission-plugins` are specified // 1. Both `--admission-control` and `--enable-admission-plugins` are specified
options := NewAdmissionOptions() options := NewAdmissionOptions()
options.PluginNames = []string{"ServiceAccount"} options.PluginNames = []string{"ServiceAccount"}
options.GenericAdmission.EnablePlugins = []string{"Initializers"} options.GenericAdmission.EnablePlugins = []string{"NodeRestriction"}
if len(options.Validate()) == 0 { if len(options.Validate()) == 0 {
t.Errorf("Expect error, but got none") t.Errorf("Expect error, but got none")
} }
...@@ -33,7 +33,7 @@ func TestValidate(t *testing.T) { ...@@ -33,7 +33,7 @@ func TestValidate(t *testing.T) {
// 2. Both `--admission-control` and `--disable-admission-plugins` are specified // 2. Both `--admission-control` and `--disable-admission-plugins` are specified
options = NewAdmissionOptions() options = NewAdmissionOptions()
options.PluginNames = []string{"ServiceAccount"} options.PluginNames = []string{"ServiceAccount"}
options.GenericAdmission.DisablePlugins = []string{"Initializers"} options.GenericAdmission.DisablePlugins = []string{"NodeRestriction"}
if len(options.Validate()) == 0 { if len(options.Validate()) == 0 {
t.Errorf("Expect error, but got none") t.Errorf("Expect error, but got none")
} }
......
...@@ -29,8 +29,6 @@ import ( ...@@ -29,8 +29,6 @@ import (
scaleclient "k8s.io/client-go/scale" scaleclient "k8s.io/client-go/scale"
) )
// TODO: Figure out if we should be waiting on initializers in the Scale() functions below.
// Scaler provides an interface for resources that can be scaled. // Scaler provides an interface for resources that can be scaled.
type Scaler interface { type Scaler interface {
// Scale scales the named resource after checking preconditions. It optionally // Scale scales the named resource after checking preconditions. It optionally
......
...@@ -36,8 +36,7 @@ func NewStrategy(typer runtime.ObjectTyper) fischerStrategy { ...@@ -36,8 +36,7 @@ func NewStrategy(typer runtime.ObjectTyper) fischerStrategy {
return fischerStrategy{typer, names.SimpleNameGenerator} return fischerStrategy{typer, names.SimpleNameGenerator}
} }
// GetAttrs returns labels.Set, fields.Set, the presence of Initializers if any // GetAttrs returns labels.Set, fields.Set, and error in case the given runtime.Object is not a Fischer
// and error in case the given runtime.Object is not a Fischer
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
apiserver, ok := obj.(*wardle.Fischer) apiserver, ok := obj.(*wardle.Fischer)
if !ok { if !ok {
......
...@@ -37,8 +37,7 @@ func NewStrategy(typer runtime.ObjectTyper) flunderStrategy { ...@@ -37,8 +37,7 @@ func NewStrategy(typer runtime.ObjectTyper) flunderStrategy {
return flunderStrategy{typer, names.SimpleNameGenerator} return flunderStrategy{typer, names.SimpleNameGenerator}
} }
// GetAttrs returns labels.Set, fields.Set, the presence of Initializers if any // GetAttrs returns labels.Set, fields.Set, and error in case the given runtime.Object is not a Flunder
// and error in case the given runtime.Object is not a Flunder
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
apiserver, ok := obj.(*wardle.Flunder) apiserver, ok := obj.(*wardle.Flunder)
if !ok { if !ok {
......
...@@ -39,7 +39,6 @@ source "${KUBE_ROOT}/test/cmd/diff.sh" ...@@ -39,7 +39,6 @@ source "${KUBE_ROOT}/test/cmd/diff.sh"
source "${KUBE_ROOT}/test/cmd/discovery.sh" source "${KUBE_ROOT}/test/cmd/discovery.sh"
source "${KUBE_ROOT}/test/cmd/generic-resources.sh" source "${KUBE_ROOT}/test/cmd/generic-resources.sh"
source "${KUBE_ROOT}/test/cmd/get.sh" source "${KUBE_ROOT}/test/cmd/get.sh"
source "${KUBE_ROOT}/test/cmd/initializers.sh"
source "${KUBE_ROOT}/test/cmd/kubeconfig.sh" source "${KUBE_ROOT}/test/cmd/kubeconfig.sh"
source "${KUBE_ROOT}/test/cmd/node-management.sh" source "${KUBE_ROOT}/test/cmd/node-management.sh"
source "${KUBE_ROOT}/test/cmd/old-print.sh" source "${KUBE_ROOT}/test/cmd/old-print.sh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment