Skip to content

Commit

Permalink
Merge pull request #19509 from smarterclayton/purge
Browse files Browse the repository at this point in the history
Split up the openshift image content to reduce total size.
  • Loading branch information
smarterclayton authored May 2, 2018
2 parents 46a7bff + 7b613e4 commit 10a5f34
Show file tree
Hide file tree
Showing 145 changed files with 1,409 additions and 2,131 deletions.
64 changes: 64 additions & 0 deletions cmd/openshift-node-config/openshift-node-config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package main

import (
"fmt"
"math/rand"
"os"
"time"

"github.com/MakeNowJust/heredoc"
"github.com/ghodss/yaml"
"github.com/golang/glog"
"github.com/spf13/cobra"

"k8s.io/apiserver/pkg/util/logs"

"github.com/openshift/origin/pkg/cmd/flagtypes"
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
configapilatest "github.com/openshift/origin/pkg/cmd/server/apis/config/latest"
configapiv1 "github.com/openshift/origin/pkg/cmd/server/apis/config/v1"
"github.com/openshift/origin/pkg/cmd/server/origin/node"
)

func main() {
logs.InitLogs()
defer logs.FlushLogs()

rand.Seed(time.Now().UTC().UnixNano())

var configFile string

cmd := &cobra.Command{
Use: "openshift-node-config",
Long: heredoc.Doc(`
Generate Kubelet configuration from node-config.yaml
This command converts an existing OpenShift node configuration into the appropriate
Kubelet command-line flags.
`),
RunE: func(cmd *cobra.Command, args []string) error {
configapi.AddToScheme(configapi.Scheme)
configapiv1.AddToScheme(configapi.Scheme)

if len(configFile) == 0 {
return fmt.Errorf("you must specify a --config file to read")
}
nodeConfig, err := configapilatest.ReadAndResolveNodeConfig(configFile)
if err != nil {
return fmt.Errorf("unable to read node config: %v", err)
}
if glog.V(2) {
out, _ := yaml.Marshal(nodeConfig)
glog.V(2).Infof("Node config:\n%s", out)
}
return node.WriteKubeletFlags(*nodeConfig)
},
SilenceUsage: true,
}
cmd.Flags().StringVar(&configFile, "config", "", "The config file to convert to Kubelet arguments.")
flagtypes.GLog(cmd.PersistentFlags())

if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}
177 changes: 2 additions & 175 deletions contrib/completions/bash/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 10a5f34

Please sign in to comment.