// Code generated for package assets by go-bindata DO NOT EDIT. (@generated)
// sources:
// bindata/oauth-apiserver/apiserver-clusterrolebinding.yaml
// bindata/oauth-apiserver/deploy.yaml
// bindata/oauth-apiserver/ns.yaml
// bindata/oauth-apiserver/sa.yaml
// bindata/oauth-apiserver/svc.yaml
// bindata/oauth-openshift/authentication-clusterrolebinding.yaml
// bindata/oauth-openshift/branding-secret.yaml
// bindata/oauth-openshift/cabundle.yaml
// bindata/oauth-openshift/deployment.yaml
// bindata/oauth-openshift/ns.yaml
// bindata/oauth-openshift/oauth-service.yaml
// bindata/oauth-openshift/serviceaccount.yaml
package assets

import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"time"
)

type asset struct {
	bytes []byte
	info  os.FileInfo
}

type bindataFileInfo struct {
	name    string
	size    int64
	mode    os.FileMode
	modTime time.Time
}

// Name return file name
func (fi bindataFileInfo) Name() string {
	return fi.name
}

// Size return file size
func (fi bindataFileInfo) Size() int64 {
	return fi.size
}

// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode {
	return fi.mode
}

// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time {
	return fi.modTime
}

// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool {
	return fi.mode&os.ModeDir != 0
}

// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} {
	return nil
}

var _oauthApiserverApiserverClusterrolebindingYaml = []byte(`apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:openshift:oauth-apiserver
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  namespace: openshift-oauth-apiserver
  name: oauth-apiserver-sa`)

func oauthApiserverApiserverClusterrolebindingYamlBytes() ([]byte, error) {
	return _oauthApiserverApiserverClusterrolebindingYaml, nil
}

func oauthApiserverApiserverClusterrolebindingYaml() (*asset, error) {
	bytes, err := oauthApiserverApiserverClusterrolebindingYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-apiserver/apiserver-clusterrolebinding.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthApiserverDeployYaml = []byte(`apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-oauth-apiserver
  name: apiserver
  labels:
    app: openshift-oauth-apiserver
    apiserver: "true"
# The number of replicas will be set in code to the number of master nodes.
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      # To ensure that only one pod at a time writes to the node's
      # audit log, require the update strategy to proceed a node at a
      # time. Only when a master node has its existing
      # oauth-apiserver pod stopped will a new one be allowed to
      # start.
      maxUnavailable: 1
      maxSurge: 0
  selector:
    matchLabels:
      app: openshift-oauth-apiserver
      apiserver: "true"
  template:
    metadata:
      name: openshift-oauth-apiserver
      labels:
        app: openshift-oauth-apiserver
        apiserver: "true"
    spec:
      serviceAccountName: oauth-apiserver-sa
      priorityClassName: system-node-critical
      initContainers:
        - name: fix-audit-permissions
          terminationMessagePolicy: FallbackToLogsOnError
          image: ${IMAGE}
          imagePullPolicy: IfNotPresent
          command: ['sh', '-c', 'chmod 0700 /var/log/oauth-apiserver']
          securityContext:
            privileged: true
          volumeMounts:
            - mountPath: /var/log/oauth-apiserver
              name: audit-dir
      containers:
      - name: oauth-apiserver
        terminationMessagePolicy: FallbackToLogsOnError
        image: ${IMAGE}
        imagePullPolicy: IfNotPresent
        command: ["/bin/bash", "-ec"]
        args:
          - |
            if [ -s /var/run/configmaps/trusted-ca-bundle/tls-ca-bundle.pem ]; then
              echo "Copying system trust bundle"
              cp -f /var/run/configmaps/trusted-ca-bundle/tls-ca-bundle.pem /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
            fi
            exec oauth-apiserver start \
              --secure-port=8443 \
              --audit-log-path=/var/log/oauth-apiserver/audit.log \
              --audit-log-format=json \
              --audit-log-maxsize=100 \
              --audit-log-maxbackup=10 \
              --etcd-cafile=/var/run/configmaps/etcd-serving-ca/ca-bundle.crt \
              --etcd-keyfile=/var/run/secrets/etcd-client/tls.key \
              --etcd-certfile=/var/run/secrets/etcd-client/tls.crt \
              --shutdown-delay-duration=3s \
              --tls-private-key-file=/var/run/secrets/serving-cert/tls.key \
              --tls-cert-file=/var/run/secrets/serving-cert/tls.crt \
              ${FLAGS}
        resources:
          requests:
            memory: 200Mi
            cpu: 150m
        # we need to set this to privileged to be able to write audit to /var/log/oauth-apiserver
        securityContext:
          privileged: true
        ports:
        - containerPort: 8443
        volumeMounts:
        - mountPath: /var/run/configmaps/audit
          name: audit-policies
        - mountPath: /var/run/secrets/etcd-client
          name: etcd-client
        - mountPath: /var/run/configmaps/etcd-serving-ca
          name: etcd-serving-ca
        - mountPath: /var/run/configmaps/trusted-ca-bundle
          name: trusted-ca-bundle
        - mountPath: /var/run/secrets/serving-cert
          name: serving-cert
        - mountPath: /var/run/secrets/encryption-config
          name: encryption-config
        - mountPath: /var/log/oauth-apiserver
          name: audit-dir
        livenessProbe:
          initialDelaySeconds: 30
          httpGet:
            scheme: HTTPS
            port: 8443
            path: healthz
        readinessProbe:
          failureThreshold: 10
          httpGet:
            scheme: HTTPS
            port: 8443
            path: readyz
      terminationGracePeriodSeconds: 70 # a bit more than the 60 seconds timeout of non-long-running requests
      volumes:
      - name: audit-policies
        configMap:
          name: audit-${REVISION}
      - name: etcd-client
        secret:
          secretName: etcd-client
      - name: etcd-serving-ca
        configMap:
          name: etcd-serving-ca
      - name: serving-cert
        secret:
          secretName: serving-cert
      - name: trusted-ca-bundle
        configMap:
          name: trusted-ca-bundle
          optional: true
          items:
          - key: ca-bundle.crt
            path: tls-ca-bundle.pem
      - name: encryption-config
        secret:
          secretName: encryption-config-${REVISION}
          optional: true
      - hostPath:
          path: /var/log/oauth-apiserver
        name: audit-dir
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
        # Ensure pod can be scheduled on master nodes
        - key: "node-role.kubernetes.io/master"
          operator: "Exists"
          effect: "NoSchedule"
          # Ensure pod can be evicted if the node is unreachable
        - key: "node.kubernetes.io/unreachable"
          operator: "Exists"
          effect: "NoExecute"
          tolerationSeconds: 120
          # Ensure scheduling is delayed until node readiness
          # (i.e. network operator configures CNI on the node)
        - key: "node.kubernetes.io/not-ready"
          operator: "Exists"
          effect: "NoExecute"
          tolerationSeconds: 120
      # Anti-affinity is configured in code due to the need to scope
      # selection to the computed pod template.
`)

func oauthApiserverDeployYamlBytes() ([]byte, error) {
	return _oauthApiserverDeployYaml, nil
}

func oauthApiserverDeployYaml() (*asset, error) {
	bytes, err := oauthApiserverDeployYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-apiserver/deploy.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthApiserverNsYaml = []byte(`apiVersion: v1
kind: Namespace
metadata:
  annotations:
    openshift.io/node-selector: ""
  name: openshift-oauth-apiserver
  labels:
    openshift.io/cluster-monitoring: "true"
`)

func oauthApiserverNsYamlBytes() ([]byte, error) {
	return _oauthApiserverNsYaml, nil
}

func oauthApiserverNsYaml() (*asset, error) {
	bytes, err := oauthApiserverNsYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-apiserver/ns.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthApiserverSaYaml = []byte(`apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: openshift-oauth-apiserver
  name: oauth-apiserver-sa
`)

func oauthApiserverSaYamlBytes() ([]byte, error) {
	return _oauthApiserverSaYaml, nil
}

func oauthApiserverSaYaml() (*asset, error) {
	bytes, err := oauthApiserverSaYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-apiserver/sa.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthApiserverSvcYaml = []byte(`apiVersion: v1
kind: Service
metadata:
  namespace: openshift-oauth-apiserver
  name: api
  annotations:
    service.alpha.openshift.io/serving-cert-secret-name: serving-cert
    prometheus.io/scrape: "true"
    prometheus.io/scheme: https
spec:
  selector:
    apiserver: "true"
  ports:
  - name: https
    port: 443
    targetPort: 8443
`)

func oauthApiserverSvcYamlBytes() ([]byte, error) {
	return _oauthApiserverSvcYaml, nil
}

func oauthApiserverSvcYaml() (*asset, error) {
	bytes, err := oauthApiserverSvcYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-apiserver/svc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftAuthenticationClusterrolebindingYaml = []byte(`apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:openshift:openshift-authentication
roleRef:
  kind: ClusterRole
  name: cluster-admin  # oauth-server needs to read secrets in all namespaces so there is no point trying to tighten its permissions
subjects:
- kind: ServiceAccount
  namespace: openshift-authentication
  name: oauth-openshift
`)

func oauthOpenshiftAuthenticationClusterrolebindingYamlBytes() ([]byte, error) {
	return _oauthOpenshiftAuthenticationClusterrolebindingYaml, nil
}

func oauthOpenshiftAuthenticationClusterrolebindingYaml() (*asset, error) {
	bytes, err := oauthOpenshiftAuthenticationClusterrolebindingYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/authentication-clusterrolebinding.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftBrandingSecretYaml = []byte(`apiVersion: v1
kind: Secret
metadata:
  namespace: openshift-authentication
  name: v4-0-config-system-ocp-branding-template
data:
  login.html: [encoded data, 290360 characters]
  providers.html: [encoded data, 263424 characters]
  errors.html: [encoded data, 241064 characters]
`)

func oauthOpenshiftBrandingSecretYamlBytes() ([]byte, error) {
	return _oauthOpenshiftBrandingSecretYaml, nil
}

func oauthOpenshiftBrandingSecretYaml() (*asset, error) {
	bytes, err := oauthOpenshiftBrandingSecretYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/branding-secret.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftCabundleYaml = []byte(`apiVersion: v1
kind: ConfigMap
metadata:
  namespace: openshift-authentication
  name: v4-0-config-system-trusted-ca-bundle
  labels:
    config.openshift.io/inject-trusted-cabundle: "true"
`)

func oauthOpenshiftCabundleYamlBytes() ([]byte, error) {
	return _oauthOpenshiftCabundleYaml, nil
}

func oauthOpenshiftCabundleYaml() (*asset, error) {
	bytes, err := oauthOpenshiftCabundleYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/cabundle.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftDeploymentYaml = []byte(`kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: openshift-authentication
  name: oauth-openshift
  labels:
    app: oauth-openshift
spec:
  replicas: 2
  selector:
    matchLabels:
      app: oauth-openshift
  template:
    metadata:
      namespace: openshift-authentication
      name: oauth-openshift
      labels:
        app: oauth-openshift
    spec:
      terminationGracePeriodSeconds: 40
      serviceAccountName: oauth-openshift
      nodeSelector:
        node-role.kubernetes.io/master: ''
      priorityClassName: system-cluster-critical
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: oauth-openshift
                topologyKey: kubernetes.io/hostname
      tolerations:
        - key: node-role.kubernetes.io/master
          operator: Exists
          effect: NoSchedule
        - key: node.kubernetes.io/unreachable
          operator: Exists
          effect: NoExecute
          tolerationSeconds: 120
        - key: node.kubernetes.io/not-ready
          operator: Exists
          effect: NoExecute
          tolerationSeconds: 120
      containers:
        - name: oauth-openshift
          image: ${IMAGE}
          command:
            - /bin/bash
            - '-ec'
          args:
            - |
              if [ -s /var/config/system/configmaps/v4-0-config-system-trusted-ca-bundle/ca-bundle.crt ]; then
                  echo "Copying system trust bundle"
                  cp -f /var/config/system/configmaps/v4-0-config-system-trusted-ca-bundle/ca-bundle.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
              fi
              exec oauth-server osinserver \
              --config=/var/config/system/configmaps/v4-0-config-system-cliconfig/v4-0-config-system-cliconfig \
              --v=${LOG_LEVEL}
          ports:
            - name: https
              containerPort: 6443
              protocol: TCP
          securityContext:
            readOnlyRootFilesystem: false # because of the ` + "`" + `cp` + "`" + ` in args
          volumeMounts:
            - name: v4-0-config-system-session
              readOnly: true
              mountPath: /var/config/system/secrets/v4-0-config-system-session
            - name: v4-0-config-system-cliconfig
              readOnly: true
              mountPath: /var/config/system/configmaps/v4-0-config-system-cliconfig
            - name: v4-0-config-system-serving-cert
              readOnly: true
              mountPath: /var/config/system/secrets/v4-0-config-system-serving-cert
            - name: v4-0-config-system-service-ca
              readOnly: true
              mountPath: /var/config/system/configmaps/v4-0-config-system-service-ca
            - name: v4-0-config-system-router-certs
              readOnly: true
              mountPath: /var/config/system/secrets/v4-0-config-system-router-certs
            - name: v4-0-config-system-ocp-branding-template
              readOnly: true
              mountPath: /var/config/system/secrets/v4-0-config-system-ocp-branding-template
            - name: v4-0-config-user-template-login
              readOnly: true
              mountPath: /var/config/user/template/secret/v4-0-config-user-template-login
            - name: v4-0-config-user-template-provider-selection
              readOnly: true
              mountPath: /var/config/user/template/secret/v4-0-config-user-template-provider-selection
            - name: v4-0-config-user-template-error
              readOnly: true
              mountPath: /var/config/user/template/secret/v4-0-config-user-template-error
            - name: v4-0-config-system-trusted-ca-bundle
              readOnly: true
              mountPath: /var/config/system/configmaps/v4-0-config-system-trusted-ca-bundle
          readinessProbe:
            httpGet:
              path: /healthz
              port: 6443
              scheme: HTTPS
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          livenessProbe:
            httpGet:
              path: /healthz
              port: 6443
              scheme: HTTPS
            initialDelaySeconds: 30
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          lifecycle:
            # delay shutdown by 25s to ensure existing connections are drained
            # * 5s for endpoint propagation on delete
            # * 5s for route reload
            # * 15s for the longest running request to finish
            preStop:
              exec:
                command:
                - sleep
                - "25"
          terminationMessagePolicy: FallbackToLogsOnError
          resources:
            requests:
              cpu: 10m
              memory: 50Mi
      volumes:
        - name: v4-0-config-system-session
          secret:
            secretName: v4-0-config-system-session
        - name: v4-0-config-system-cliconfig
          configMap:
            name: v4-0-config-system-cliconfig
        - name: v4-0-config-system-serving-cert
          secret:
            secretName: v4-0-config-system-serving-cert
        - name: v4-0-config-system-service-ca
          configMap:
            name: v4-0-config-system-service-ca
        - name: v4-0-config-system-router-certs
          secret:
            secretName: v4-0-config-system-router-certs
        - name: v4-0-config-system-ocp-branding-template
          secret:
            secretName: v4-0-config-system-ocp-branding-template
        - name: v4-0-config-user-template-login
          secret:
            secretName: v4-0-config-user-template-login
            optional: true
        - name: v4-0-config-user-template-provider-selection
          secret:
            secretName: v4-0-config-user-template-provider-selection
            optional: true
        - name: v4-0-config-user-template-error
          secret:
            secretName: v4-0-config-user-template-error
            optional: true
        - name: v4-0-config-system-trusted-ca-bundle
          configMap:
            name: v4-0-config-system-trusted-ca-bundle
            optional: true
`)

func oauthOpenshiftDeploymentYamlBytes() ([]byte, error) {
	return _oauthOpenshiftDeploymentYaml, nil
}

func oauthOpenshiftDeploymentYaml() (*asset, error) {
	bytes, err := oauthOpenshiftDeploymentYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/deployment.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftNsYaml = []byte(`apiVersion: v1
kind: Namespace
metadata:
  name: openshift-authentication
  annotations:
    openshift.io/node-selector: ""
  labels:
    openshift.io/cluster-monitoring: "true"
`)

func oauthOpenshiftNsYamlBytes() ([]byte, error) {
	return _oauthOpenshiftNsYaml, nil
}

func oauthOpenshiftNsYaml() (*asset, error) {
	bytes, err := oauthOpenshiftNsYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/ns.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftOauthServiceYaml = []byte(`# Expose operator metrics
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.alpha.openshift.io/serving-cert-secret-name: v4-0-config-system-serving-cert
  labels:
    app: oauth-openshift
  name: oauth-openshift
  namespace: openshift-authentication
spec:
  ports:
    - name: https
      port: 443
      protocol: TCP
      targetPort: 6443
  selector:
    app: oauth-openshift
  sessionAffinity: None
  type: ClusterIP`)

func oauthOpenshiftOauthServiceYamlBytes() ([]byte, error) {
	return _oauthOpenshiftOauthServiceYaml, nil
}

func oauthOpenshiftOauthServiceYaml() (*asset, error) {
	bytes, err := oauthOpenshiftOauthServiceYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/oauth-service.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _oauthOpenshiftServiceaccountYaml = []byte(`apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: openshift-authentication
  name: oauth-openshift
  labels:
    app: oauth-openshift
`)

func oauthOpenshiftServiceaccountYamlBytes() ([]byte, error) {
	return _oauthOpenshiftServiceaccountYaml, nil
}

func oauthOpenshiftServiceaccountYaml() (*asset, error) {
	bytes, err := oauthOpenshiftServiceaccountYamlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "oauth-openshift/serviceaccount.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
		}
		return a.bytes, nil
	}
	return nil, fmt.Errorf("Asset %s not found", name)
}

// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
	a, err := Asset(name)
	if err != nil {
		panic("asset: Asset(" + name + "): " + err.Error())
	}

	return a
}

// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
		}
		return a.info, nil
	}
	return nil, fmt.Errorf("AssetInfo %s not found", name)
}

// AssetNames returns the names of the assets.
func AssetNames() []string {
	names := make([]string, 0, len(_bindata))
	for name := range _bindata {
		names = append(names, name)
	}
	return names
}

// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
	"oauth-apiserver/apiserver-clusterrolebinding.yaml":      oauthApiserverApiserverClusterrolebindingYaml,
	"oauth-apiserver/deploy.yaml":                            oauthApiserverDeployYaml,
	"oauth-apiserver/ns.yaml":                                oauthApiserverNsYaml,
	"oauth-apiserver/sa.yaml":                                oauthApiserverSaYaml,
	"oauth-apiserver/svc.yaml":                               oauthApiserverSvcYaml,
	"oauth-openshift/authentication-clusterrolebinding.yaml": oauthOpenshiftAuthenticationClusterrolebindingYaml,
	"oauth-openshift/branding-secret.yaml":                   oauthOpenshiftBrandingSecretYaml,
	"oauth-openshift/cabundle.yaml":                          oauthOpenshiftCabundleYaml,
	"oauth-openshift/deployment.yaml":                        oauthOpenshiftDeploymentYaml,
	"oauth-openshift/ns.yaml":                                oauthOpenshiftNsYaml,
	"oauth-openshift/oauth-service.yaml":                     oauthOpenshiftOauthServiceYaml,
	"oauth-openshift/serviceaccount.yaml":                    oauthOpenshiftServiceaccountYaml,
}

// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
//     data/
//       foo.txt
//       img/
//         a.png
//         b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
	node := _bintree
	if len(name) != 0 {
		cannonicalName := strings.Replace(name, "\\", "/", -1)
		pathList := strings.Split(cannonicalName, "/")
		for _, p := range pathList {
			node = node.Children[p]
			if node == nil {
				return nil, fmt.Errorf("Asset %s not found", name)
			}
		}
	}
	if node.Func != nil {
		return nil, fmt.Errorf("Asset %s not found", name)
	}
	rv := make([]string, 0, len(node.Children))
	for childName := range node.Children {
		rv = append(rv, childName)
	}
	return rv, nil
}

type bintree struct {
	Func     func() (*asset, error)
	Children map[string]*bintree
}

var _bintree = &bintree{nil, map[string]*bintree{
	"oauth-apiserver": {nil, map[string]*bintree{
		"apiserver-clusterrolebinding.yaml": {oauthApiserverApiserverClusterrolebindingYaml, map[string]*bintree{}},
		"deploy.yaml":                       {oauthApiserverDeployYaml, map[string]*bintree{}},
		"ns.yaml":                           {oauthApiserverNsYaml, map[string]*bintree{}},
		"sa.yaml":                           {oauthApiserverSaYaml, map[string]*bintree{}},
		"svc.yaml":                          {oauthApiserverSvcYaml, map[string]*bintree{}},
	}},
	"oauth-openshift": {nil, map[string]*bintree{
		"authentication-clusterrolebinding.yaml": {oauthOpenshiftAuthenticationClusterrolebindingYaml, map[string]*bintree{}},
		"branding-secret.yaml":                   {oauthOpenshiftBrandingSecretYaml, map[string]*bintree{}},
		"cabundle.yaml":                          {oauthOpenshiftCabundleYaml, map[string]*bintree{}},
		"deployment.yaml":                        {oauthOpenshiftDeploymentYaml, map[string]*bintree{}},
		"ns.yaml":                                {oauthOpenshiftNsYaml, map[string]*bintree{}},
		"oauth-service.yaml":                     {oauthOpenshiftOauthServiceYaml, map[string]*bintree{}},
		"serviceaccount.yaml":                    {oauthOpenshiftServiceaccountYaml, map[string]*bintree{}},
	}},
}}

// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
	data, err := Asset(name)
	if err != nil {
		return err
	}
	info, err := AssetInfo(name)
	if err != nil {
		return err
	}
	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
	if err != nil {
		return err
	}
	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
	if err != nil {
		return err
	}
	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
	if err != nil {
		return err
	}
	return nil
}

// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
	children, err := AssetDir(name)
	// File
	if err != nil {
		return RestoreAsset(dir, name)
	}
	// Dir
	for _, child := range children {
		err = RestoreAssets(dir, filepath.Join(name, child))
		if err != nil {
			return err
		}
	}
	return nil
}

func _filePath(dir, name string) string {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}
