diff --git a/hack/build-image.sh b/hack/build-image.sh index ee8fa01d1..5fb942b54 100755 --- a/hack/build-image.sh +++ b/hack/build-image.sh @@ -22,4 +22,4 @@ if [ -z ${VERSION+a} ]; then fi set -x -podman build -t "cluster-version-operator:${VERSION}" -f Dockerfile \ No newline at end of file +podman build -t "cluster-version-operator:${VERSION}" -f Dockerfile --no-cache \ No newline at end of file diff --git a/hack/push-image.sh b/hack/push-image.sh index 8191ac27a..a2bc71152 100755 --- a/hack/push-image.sh +++ b/hack/push-image.sh @@ -2,6 +2,11 @@ set -eu + +function print_info { + echo "INFO: $1" >&2 +} + REPO=${REPO:-"openshift"} if [ -z ${VERSION+a} ]; then diff --git a/pkg/cvo/render.go b/pkg/cvo/render.go index aa79c6393..93ec76287 100644 --- a/pkg/cvo/render.go +++ b/pkg/cvo/render.go @@ -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" @@ -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) } diff --git a/pkg/cvo/sync.go b/pkg/cvo/sync.go index 0489b69da..da11baeaa 100644 --- a/pkg/cvo/sync.go +++ b/pkg/cvo/sync.go @@ -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)