Skip to content

Commit f10076b

Browse files
committed
comments
1 parent 1d2c1a7 commit f10076b

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

pkg/cmd/openshift-kube-apiserver/openshiftkubeapiserver/flags.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func ConfigToFlags(kubeAPIServerConfig *configapi.MasterConfig) ([]string, error
2828
return nil, err
2929
}
3030

31+
// TODO this list (and the content below) will be used to drive a config struct and a reflective test matching config to flags
3132
// these flags are overridden by a patch
3233
// admission-control
3334
// authentication-token-webhook-cache-ttl
@@ -200,8 +201,8 @@ func admissionFlags(kubeAPIServerConfig *configapi.MasterConfig) (map[string][]s
200201
if err != nil {
201202
return nil, err
202203
}
203-
// if the config isn't a DefaultAdmissionConfig, then assume we're enabled (we were called after all)
204-
// if the config *is* a DefaultAdmissionConfig and it explicitly said
204+
// if the config isn't a DefaultAdmissionConfig, then assume we're enabled (we were called out after all)
205+
// if the config *is* a DefaultAdmissionConfig and it explicitly said to disable us, we are disabled
205206
obj, err := configapilatest.ReadYAML(bytes.NewBuffer(content))
206207
// if we can't read it, let the plugin deal with it
207208
// if nothing was there, let the plugin deal with it
@@ -218,14 +219,12 @@ func admissionFlags(kubeAPIServerConfig *configapi.MasterConfig) (map[string][]s
218219
config.Location = ""
219220
config.Configuration = &runtime.Unknown{Raw: content}
220221
pluginConfig[pluginName] = *config
221-
continue
222222

223223
} else if defaultConfig.Disable {
224224
forceOff = append(forceOff, pluginName)
225-
continue
225+
226226
} else {
227227
forceOn = append(forceOn, pluginName)
228-
continue
229228
}
230229

231230
continue
@@ -234,14 +233,12 @@ func admissionFlags(kubeAPIServerConfig *configapi.MasterConfig) (map[string][]s
234233
if defaultConfig, ok := config.Configuration.(*configapi.DefaultAdmissionConfig); !ok {
235234
forceOn = append(forceOn, pluginName)
236235
pluginConfig[pluginName] = *config
237-
continue
238236

239237
} else if defaultConfig.Disable {
240238
forceOff = append(forceOff, pluginName)
241-
continue
239+
242240
} else {
243241
forceOn = append(forceOn, pluginName)
244-
continue
245242
}
246243

247244
}

pkg/cmd/openshift-kube-apiserver/openshiftkubeapiserver/patch.go

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
package openshiftkubeapiserver
22

33
import (
4-
"github.com/openshift/origin/pkg/admission/namespaceconditions"
5-
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
6-
usercache "github.com/openshift/origin/pkg/user/cache"
4+
"fmt"
5+
"time"
6+
77
"k8s.io/apiserver/pkg/admission"
88
admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
99
genericapiserver "k8s.io/apiserver/pkg/server"
10+
"k8s.io/apiserver/pkg/server/options"
1011
clientgoinformers "k8s.io/client-go/informers"
1112
kexternalinformers "k8s.io/client-go/informers"
13+
"k8s.io/client-go/kubernetes"
1214
"k8s.io/client-go/rest"
15+
"k8s.io/client-go/tools/cache"
1316
"k8s.io/kubernetes/cmd/kube-apiserver/app"
1417
internalinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
1518
kinternalinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
@@ -21,24 +24,20 @@ import (
2124
oauthinformer "github.com/openshift/client-go/oauth/informers/externalversions"
2225
userclient "github.com/openshift/client-go/user/clientset/versioned"
2326
userinformer "github.com/openshift/client-go/user/informers/externalversions"
27+
"github.com/openshift/origin/pkg/admission/namespaceconditions"
28+
"github.com/openshift/origin/pkg/cmd/openshift-apiserver/openshiftapiserver"
29+
"github.com/openshift/origin/pkg/cmd/openshift-apiserver/openshiftapiserver/configprocessing"
2430
oadmission "github.com/openshift/origin/pkg/cmd/server/admission"
31+
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
2532
originadmission "github.com/openshift/origin/pkg/cmd/server/origin/admission"
33+
"github.com/openshift/origin/pkg/image/apiserver/registryhostname"
2634
imageinformer "github.com/openshift/origin/pkg/image/generated/informers/internalversion"
2735
imageclient "github.com/openshift/origin/pkg/image/generated/internalclientset"
2836
quotainformer "github.com/openshift/origin/pkg/quota/generated/informers/internalversion"
2937
quotaclient "github.com/openshift/origin/pkg/quota/generated/internalclientset"
3038
securityinformer "github.com/openshift/origin/pkg/security/generated/informers/internalversion"
3139
securityclient "github.com/openshift/origin/pkg/security/generated/internalclientset"
32-
33-
"fmt"
34-
"time"
35-
36-
"github.com/openshift/origin/pkg/cmd/openshift-apiserver/openshiftapiserver"
37-
"github.com/openshift/origin/pkg/cmd/openshift-apiserver/openshiftapiserver/configprocessing"
38-
"github.com/openshift/origin/pkg/image/apiserver/registryhostname"
39-
"k8s.io/apiserver/pkg/server/options"
40-
"k8s.io/client-go/kubernetes"
41-
"k8s.io/client-go/tools/cache"
40+
usercache "github.com/openshift/origin/pkg/user/cache"
4241
)
4342

4443
type KubeAPIServerServerPatchContext struct {

pkg/cmd/openshift-kube-apiserver/openshiftkubeapiserver/patch_handlerchain.go

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ func BuildHandlerChain(genericConfig *genericapiserver.Config, kubeInformers inf
3939
return func(apiHandler http.Handler, genericConfig *genericapiserver.Config) http.Handler {
4040
// Machinery that let's use discover the Web Console Public URL
4141
accessor := newWebConsolePublicURLAccessor(genericConfig.LoopbackClientConfig)
42+
// the webconsole is proxied through the API server. This starts a small controller that keeps track of where to proxy.
43+
// TODO stop proxying the webconsole. Should happen in a future release.
4244
extraPostStartHooks["openshift.io-webconsolepublicurl"] = func(context genericapiserver.PostStartHookContext) error {
4345
go accessor.Run(context.StopCh)
4446
return nil

0 commit comments

Comments
 (0)