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
10 changes: 10 additions & 0 deletions Dockerfile.machine-config-operator
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
WORKDIR /go/src/github.com/openshift/machine-config-operator
COPY . .
RUN WHAT=machine-config-operator ./hack/build-go.sh
RUN WHAT=machine-config-daemon ./hack/build-go.sh
RUN WHAT=machine-config-controller ./hack/build-go.sh
RUN WHAT=machine-config-server ./hack/build-go.sh
RUN WHAT=setup-etcd-environment ./hack/build-go.sh

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-operator /usr/bin/
COPY install /manifests
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-daemon /usr/bin/
RUN if ! rpm -q util-linux; then yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*; fi
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-controller /usr/bin/
COPY templates /etc/mcc/templates
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/machine-config-server /usr/bin/
COPY --from=builder /go/src/github.com/openshift/machine-config-operator/_output/linux/amd64/setup-etcd-environment /usr/bin/
ENTRYPOINT ["/usr/bin/machine-config-operator"]
LABEL io.openshift.release.operator true
18 changes: 18 additions & 0 deletions Dockerfile.machine-config-operator.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,27 @@ COPY . .
RUN WHAT=machine-config-operator ./hack/build-go.sh; \
mkdir -p /tmp/build; \
cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-operator /tmp/build/machine-config-operator
RUN WHAT=machine-config-daemon ./hack/build-go.sh; \
mkdir -p /tmp/build; \
cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-daemon /tmp/build/machine-config-daemon
RUN WHAT=machine-config-controller ./hack/build-go.sh; \
mkdir -p /tmp/build; \
cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-controller /tmp/build/machine-config-controller
RUN WHAT=machine-config-server ./hack/build-go.sh; \
mkdir -p /tmp/build; \
cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-server /tmp/build/machine-config-server
RUN WHAT=setup-etcd-environment ./hack/build-go.sh; \
mkdir -p /tmp/build; \
cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/setup-etcd-environment /tmp/build/setup-etcd-environment

FROM registry.svc.ci.openshift.org/ocp/4.0:base
COPY --from=builder /tmp/build/machine-config-operator /usr/bin/
COPY install /manifests
COPY --from=builder /tmp/build/machine-config-daemon /usr/bin/
RUN yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*
COPY --from=builder /tmp/build/machine-config-controller /usr/bin/
COPY templates /etc/mcc/templates
COPY --from=builder /tmp/build/machine-config-server /usr/bin/
COPY --from=builder /tmp/build/setup-etcd-environment /usr/bin/
ENTRYPOINT ["/usr/bin/machine-config-operator"]
LABEL io.openshift.release.operator true
2 changes: 2 additions & 0 deletions cmd/machine-config-operator/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func init() {
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.mcdImage, "machine-config-daemon-image", "", "Image for Machine Config Daemon.")
bootstrapCmd.MarkFlagRequired("machine-config-daemon-image")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.mcoImage, "machine-config-operator-image", "", "Image for Machine Config Operator.")
bootstrapCmd.MarkFlagRequired("machine-config-operator-image")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.oscontentImage, "machine-config-oscontent-image", "", "Image for osImageURL")
bootstrapCmd.MarkFlagRequired("machine-config-oscontent-image")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.etcdImage, "etcd-image", "", "Image for Etcd.")
Expand All @@ -83,6 +84,7 @@ func runBootstrapCmd(cmd *cobra.Command, args []string) {
glog.Infof("Version: %+v (%s)", version.Version, version.Hash)

imgs := operator.Images{
MachineConfigOperator: bootstrapOpts.mcoImage,
MachineConfigController: bootstrapOpts.mccImage,
MachineConfigDaemon: bootstrapOpts.mcdImage,
MachineConfigServer: bootstrapOpts.mcsImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
data:
images.json: >
{
"machineConfigOperator": "registry.svc.ci.openshift.org/openshift:machine-config-operator",
"machineConfigController": "registry.svc.ci.openshift.org/openshift:machine-config-controller",
"machineConfigDaemon": "registry.svc.ci.openshift.org/openshift:machine-config-daemon",
"machineConfigServer": "registry.svc.ci.openshift.org/openshift:machine-config-server",
Expand Down
4 changes: 3 additions & 1 deletion install/image-references
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ kind: ImageStream
apiVersion: image.openshift.io/v1
spec:
tags:
# These are the 4 components of the MCO
# machine-config-operator is the new master mco image that contains all of the
# component images:mco, mcc, mcs, mcd & setup etcd
# TO-DO: in future PR other component images will be deleted
- name: machine-config-operator
from:
kind: DockerImage
Expand Down
6 changes: 4 additions & 2 deletions manifests/bootstrap-pod-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
spec:
initContainers:
- name: machine-config-controller
image: {{.Images.MachineConfigController}}
image: {{.Images.MachineConfigOperator}}
command: ["/usr/bin/machine-config-controller"]
args:
- "bootstrap"
- "--manifest-dir=/etc/mcc/bootstrap"
Expand All @@ -27,7 +28,8 @@ spec:
mountPath: /etc/mcs/bootstrap
containers:
- name: machine-config-server
image: {{.Images.MachineConfigServer}}
image: {{.Images.MachineConfigOperator}}
command: ["/usr/bin/machine-config-server"]
args:
- "bootstrap"
volumeMounts:
Expand Down
3 changes: 2 additions & 1 deletion manifests/machineconfigcontroller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ spec:
spec:
containers:
- name: machine-config-controller
image: {{.Images.MachineConfigController}}
image: {{.Images.MachineConfigOperator}}
command: ["/usr/bin/machine-config-controller"]
args:
- "start"
- "--resourcelock-namespace={{.TargetNamespace}}"
Expand Down
3 changes: 2 additions & 1 deletion manifests/machineconfigdaemon/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ spec:
spec:
containers:
- name: machine-config-daemon
image: {{.Images.MachineConfigDaemon}}
image: {{.Images.MachineConfigOperator}}
command: ["/usr/bin/machine-config-daemon"]
args:
- "start"
resources:
Expand Down
3 changes: 2 additions & 1 deletion manifests/machineconfigserver/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ spec:
spec:
containers:
- name: machine-config-server
image: {{.Images.MachineConfigServer}}
image: {{.Images.MachineConfigOperator}}
command: ["/usr/bin/machine-config-server"]
args:
- "start"
- "--apiserver-url={{.APIServerURL}}"
Expand Down
15 changes: 10 additions & 5 deletions pkg/operator/assets/bindata.go

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

1 change: 1 addition & 0 deletions pkg/operator/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package operator
// Change the installer to pass that arg with the image from the CVO
// (some time later) Change the option to required and drop the default
type Images struct {
MachineConfigOperator string `json:"machineConfigOperator"`
MachineConfigController string `json:"machineConfigController"`
MachineConfigDaemon string `json:"machineConfigDaemon"`
MachineConfigServer string `json:"machineConfigServer"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/operator/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func TestRenderAsset(t *testing.T) {
RenderConfig: &renderConfig{
TargetNamespace: "testing-namespace",
Images: &Images{
MachineConfigController: "{MCC: PLACEHOLDER}"},
MachineConfigOperator: "{MCO: PLACEHOLDER}"},
},
FindExpected: "image: {MCC: PLACEHOLDER}",
FindExpected: "image: {MCO: PLACEHOLDER}",
}, {
// Render same template as previous test
// But with a template field missing
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestRenderAsset(t *testing.T) {
// Verify that any FindExpected values are actually in the string
if test.FindExpected != "" {
if !strings.Contains(str, test.FindExpected) {
t.Fatalf("Rendered template does not contain expected values")
t.Fatalf("Rendered template does not contain expected values: %s, \nGot: %s", test.FindExpected, str)
}
}
})
Expand Down