Skip to content

clean up construction to make creating types more obvious#20777

Merged
openshift-merge-robot merged 4 commits intoopenshift:masterfrom
deads2k:server-22-scrub-start
Aug 29, 2018
Merged

clean up construction to make creating types more obvious#20777
openshift-merge-robot merged 4 commits intoopenshift:masterfrom
deads2k:server-22-scrub-start

Conversation

@deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 28, 2018

Builds on #20741

This collapses more start paths into a single chain.

/assign @sttts @mfojtik

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 28, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Aug 28, 2018

/retest

1 similar comment
@deads2k
Copy link
Contributor Author

deads2k commented Aug 28, 2018

/retest

@bparees bparees removed their request for review August 28, 2018 17:24

var cloudConfig []byte
if kubeOptions.CloudProvider.CloudConfigFile != "" {
if cloudConfigFile != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: len(cloudConfigFile) == 0

return admission.PluginInitializers{genericInitializer, webhookInitializer, kubePluginInitializer, openshiftPluginInitializer}, nil
}

type DefaultInformerAccess struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where has this moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where has this moved?

unused.

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
"github.com/openshift/origin/pkg/image/apiserver/registryhostname"
"k8s.io/apiserver/pkg/registry/generic"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also everywhere below.

server, etcdStorage := etcdtesting.NewUnsecuredEtcd3TestClientServer(t)
etcdStorage.Codec = legacyscheme.Codecs.LegacyCodec(schema.GroupVersion{Group: "image.openshift.io", Version: "v1"})
etcdClient := etcd.NewKV(server.V3Client)
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "images"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid confusion, rename to imageRestOptions.

server, etcdStorage := etcdtesting.NewUnsecuredEtcd3TestClientServer(t)
etcdStorage.Codec = legacyscheme.Codecs.LegacyCodec(schema.GroupVersion{Group: "image.openshift.io", Version: "v1"})
etcdClient := etcd.NewKV(server.V3Client)
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "imagestreams"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageStreamRestOptions

preparedOpenshiftAPIServer := openshiftAPIServer.GenericAPIServer.PrepareRun()

glog.Infof("Starting master on %s (%s)", masterConfig.ServingInfo.BindAddress, version.Get().String())
glog.Infof("Public master address is %s", masterConfig.MasterPublicURL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentional removal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentional removal?

yeah, logically the openshift apiserver has no public address

cloudConfig, err = ioutil.ReadFile(cloudConfigFile)
if err != nil {
return nil, fmt.Errorf("Error reading from cloud configuration file %s: %v", kubeOptions.CloudProvider.CloudConfigFile, err)
return nil, fmt.Errorf("Error reading from cloud configuration file %s: %v", cloudConfigFile, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower-case error

)

func (c *MasterConfig) newOpenshiftAPIConfig(kubeAPIServerConfig apiserver.Config) (*openshiftapiserver.OpenshiftAPIConfig, error) {
var err error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move down where it is used

@sttts
Copy link
Contributor

sttts commented Aug 29, 2018

Some nits.

@deads2k deads2k force-pushed the server-22-scrub-start branch from f865066 to 3563995 Compare August 29, 2018 16:06
@deads2k
Copy link
Contributor Author

deads2k commented Aug 29, 2018

comments addressed

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
@openshift-merge-robot openshift-merge-robot merged commit 9c9f668 into openshift:master Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants