Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile.machine-config-controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.10.3 AS build-env

COPY . /go/src/github.com/openshift/machine-config-operator
WORKDIR /go/src/github.com/openshift/machine-config-operator
RUN WHAT=machine-config-controller ./hack/build-go.sh

FROM scratch
COPY --from=build-env /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-controller /bin/machine-config-controller
COPY templates /etc/templates

ENTRYPOINT ["/bin/machine-config-controller"]
11 changes: 11 additions & 0 deletions Dockerfile.machine-config-daemon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.10.3 AS build-env

COPY . /go/src/github.com/openshift/machine-config-operator
WORKDIR /go/src/github.com/openshift/machine-config-operator
RUN WHAT=machine-config-daemon ./hack/build-go.sh

FROM scratch
COPY --from=build-env /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-daemon /bin/machine-config-daemon
COPY templates /etc/templates

ENTRYPOINT ["/bin/machine-config-daemon"]
11 changes: 11 additions & 0 deletions Dockerfile.machine-config-operator
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.10.3 AS build-env

COPY . /go/src/github.com/openshift/machine-config-operator
WORKDIR /go/src/github.com/openshift/machine-config-operator
RUN WHAT=machine-config-operator ./hack/build-go.sh

FROM scratch
COPY --from=build-env /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-operator /bin/machine-config-operator
COPY templates /etc/templates

ENTRYPOINT ["/bin/machine-config-operator"]
64 changes: 63 additions & 1 deletion Gopkg.lock

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

13 changes: 12 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ required = ["k8s.io/gengo/types", "k8s.io/code-generator/cmd/client-gen"]
name = "github.com/coreos/container-linux-config-transpiler"
version = "v0.9.0"


[[constraint]]
name = "github.com/ghodss/yaml"
version = "v1.0.0"
Expand All @@ -48,6 +47,10 @@ revision = "44145f04b68cf362d9c4df2182967c2275eaefed"
name = "k8s.io/api"
version = "kubernetes-1.11.1"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.11.1"

[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.1"
Expand Down Expand Up @@ -91,3 +94,11 @@ revision = "44145f04b68cf362d9c4df2182967c2275eaefed"
[[constraint]]
name = "github.com/vincent-petithory/dataurl"
revision = "9a301d65acbb728fcc3ace14f45f511a4cfeea9c"

[[constraint]]
name = "github.com/openshift/api"
branch = "master"

[[constraint]]
name = "github.com/openshift/client-go"
branch = "master"
11 changes: 8 additions & 3 deletions cmd/machine-config-daemon/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"os"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/pkg/daemon"
Expand Down Expand Up @@ -33,8 +34,8 @@ func init() {
rootCmd.AddCommand(startCmd)
startCmd.PersistentFlags().StringVar(&startOpts.kubeconfig, "kubeconfig", "", "Kubeconfig file to access a remote cluster (testing only)")
startCmd.PersistentFlags().StringVar(&startOpts.nodeName, "node-name", "", "kubernetes node name daemon is managing.")
startCmd.PersistentFlags().StringVar(&startOpts.nodeName, "target-namespace", "openshift-machine-config", "namespace is where the daemon looks for machineconfigs.")
startCmd.PersistentFlags().StringVar(&startOpts.nodeName, "root-prefix", "/rootfs", "where the nodes root filesystem is mounted, for the file stage.")
startCmd.PersistentFlags().StringVar(&startOpts.targetNamespace, "target-namespace", "openshift-machine-config", "namespace is where the daemon looks for machineconfigs.")
startCmd.PersistentFlags().StringVar(&startOpts.rootPrefix, "root-prefix", "/rootfs", "where the nodes root filesystem is mounted, for the file stage.")
}

func runStartCmd(cmd *cobra.Command, args []string) {
Expand All @@ -45,7 +46,11 @@ func runStartCmd(cmd *cobra.Command, args []string) {
glog.Infof("Version: %+v", version.Version)

if startOpts.nodeName == "" {
glog.Fatalf("node-name is required")
name, ok := os.LookupEnv("NODE_NAME")
if !ok || name == "" {
glog.Fatalf("node-name is required")
}
startOpts.nodeName = name
}

cb, err := newClientBuilder(startOpts.kubeconfig)
Expand Down
30 changes: 30 additions & 0 deletions cmd/machine-config-operator/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package main

import (
"flag"

"github.com/golang/glog"
"github.com/spf13/cobra"
)

const (
componentName = "machine-config-operator"
)

var (
rootCmd = &cobra.Command{
Use: componentName,
Short: "Run Machine Config Controller",
Long: "",
}
)

func init() {
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
}

func main() {
if err := rootCmd.Execute(); err != nil {
glog.Exitf("Error executing mcc: %v", err)
}
}
Loading