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
2 changes: 1 addition & 1 deletion hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ if [ -z ${VERSION+a} ]; then
fi

set -x
podman build -t "cluster-version-operator:${VERSION}" -f Dockerfile
podman build -t "cluster-version-operator:${VERSION}" -f Dockerfile --no-cache
5 changes: 5 additions & 0 deletions hack/push-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -eu


function print_info {
echo "INFO: $1" >&2
}

REPO=${REPO:-"openshift"}

if [ -z ${VERSION+a} ]; then
Expand Down
10 changes: 3 additions & 7 deletions pkg/cvo/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"text/template"

"github.com/openshift/cluster-version-operator/lib/resourcebuilder"

"github.com/golang/glog"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
Expand Down Expand Up @@ -44,11 +43,8 @@ func Render(outputDir, releaseImage string) error {
continue
}

if !resourcebuilder.Mapper.Exists(manifest.GVK) {
return fmt.Errorf("error: Unknown GVK: %v; Operator will not be able to manage this Manifest %s", manifest.GVK, mname)
}

path := filepath.Join(outputDir, fmt.Sprintf("%03d-manifest.json", idx))
filename := strings.ToLower(fmt.Sprintf("%03d-%s-%s-%s-%s-%s", idx, manifest.GVK.Group, manifest.GVK.Version, manifest.GVK.Kind, manifest.Object().GetNamespace(), manifest.Object().GetName()))
path := filepath.Join(outputDir, filename)
if err := ioutil.WriteFile(path, manifest.Raw, 0644); err != nil {
errs = append(errs, err)
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/cvo/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ func (optr *Operator) syncUpdatePayload(config *cvv1.CVOConfig, payload *updateP
taskName := fmt.Sprintf("(%s) %s/%s", manifest.GVK.String(), manifest.Object().GetNamespace(), manifest.Object().GetName())
glog.V(4).Infof("Running sync for %s", taskName)
glog.V(4).Infof("Manifest: %s", string(manifest.Raw))

// FIXME: skip manifests that CVO doesn't know how to handle for now.
// such manifests should be handled by a generic resourcebuilder that
// can mimic behavior of `kubectl apply` in terms of replace.
if !resourcebuilder.Mapper.Exists(manifest.GVK) {
glog.Info("Cannot handle %s as it is currently unsupported, skipping for now", taskName)
continue
}

b, err := resourcebuilder.New(resourcebuilder.Mapper, optr.restConfig, manifest)
if err != nil {
return fmt.Errorf("error creating New resourcebuilder for %s: %v", taskName, err)
Expand Down