Skip to content

Commit d2ee0d3

Browse files
committed
stop adding beta admission config to default master configs
1 parent e16fc4a commit d2ee0d3

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

hack/lib/start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ function os::start::internal::patch_master_config() {
162162
local sudo=${USE_SUDO:+sudo}
163163
cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig.yaml"
164164
oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig.yaml" --patch="{\"etcdConfig\": {\"address\": \"${API_HOST}:${ETCD_PORT}\"}}" | \
165+
oc ex config patch - --patch="{\"admissionConfig\": {\"pluginConfig\": {\"openshift.io/ImagePolicy\": {\"configuration\": {\"apiVersion\": \"v1\", \"executionRules\": [{\"matchImageAnnotations\": [{\"key\": \"images.openshift.io/deny-execution\", \"value\": \"true\"}], \"name\": \"execution-denied\", \"onResources\": [{\"resource\": \"pods\"}, {\"resource\": \"builds\"}], \"reject\": true, \"skipOnResolutionFailure\": true }], \"kind\": \"ImagePolicyConfig\" }, \"location\": \"\"}}}}" | \
165166
oc ex config patch - --patch="{\"etcdConfig\": {\"servingInfo\": {\"bindAddress\": \"${API_HOST}:${ETCD_PORT}\"}}}" | \
166167
oc ex config patch - --type json --patch="[{\"op\": \"replace\", \"path\": \"/etcdClientInfo/urls\", \"value\": [\"${API_SCHEME}://${API_HOST}:${ETCD_PORT}\"]}]" | \
167168
oc ex config patch - --patch="{\"etcdConfig\": {\"peerAddress\": \"${API_HOST}:${ETCD_PEER_PORT}\"}}" | \

pkg/cmd/server/start/master_args.go

-20
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"k8s.io/apimachinery/pkg/runtime"
1414
"k8s.io/apimachinery/pkg/runtime/schema"
1515
"k8s.io/apimachinery/pkg/util/sets"
16-
"k8s.io/apimachinery/pkg/util/yaml"
1716
"k8s.io/apiserver/pkg/util/flag"
1817
"k8s.io/kubernetes/pkg/master/ports"
1918
"k8s.io/kubernetes/pkg/registry/core/service/ipallocator"
@@ -24,8 +23,6 @@ import (
2423
configapiv1 "github.com/openshift/origin/pkg/cmd/server/api/v1"
2524
"github.com/openshift/origin/pkg/cmd/server/bootstrappolicy"
2625
cmdutil "github.com/openshift/origin/pkg/cmd/util"
27-
imagepolicyapi "github.com/openshift/origin/pkg/image/admission/imagepolicy/api"
28-
"github.com/openshift/origin/pkg/oc/bootstrap"
2926
"github.com/spf13/cobra"
3027
)
3128

@@ -362,23 +359,6 @@ func (args MasterArgs) BuildSerializeableMasterConfig() (*configapi.MasterConfig
362359
config.ServiceAccountConfig.PublicKeyFiles = []string{}
363360
}
364361

365-
// embed a default policy for generated config
366-
defaultImagePolicy, err := bootstrap.Asset("pkg/image/admission/imagepolicy/api/v1/default-policy.yaml")
367-
if err != nil {
368-
return nil, fmt.Errorf("unable to find default image admission policy: %v", err)
369-
}
370-
// TODO: this should not be necessary, runtime.Unknown#MarshalJSON should handle YAML content type correctly
371-
defaultImagePolicy, err = yaml.ToJSON(defaultImagePolicy)
372-
if err != nil {
373-
return nil, err
374-
}
375-
if config.AdmissionConfig.PluginConfig == nil {
376-
config.AdmissionConfig.PluginConfig = make(map[string]configapi.AdmissionPluginConfig)
377-
}
378-
config.AdmissionConfig.PluginConfig[imagepolicyapi.PluginName] = configapi.AdmissionPluginConfig{
379-
Configuration: &runtime.Unknown{Raw: defaultImagePolicy},
380-
}
381-
382362
internal, err := applyDefaults(config, configapiv1.SchemeGroupVersion)
383363
if err != nil {
384364
return nil, err

0 commit comments

Comments
 (0)