Skip to content

Commit b7025a7

Browse files
committed
Add converter utility to convert v2 to v3 yaml
1 parent 1b1e4d0 commit b7025a7

File tree

9 files changed

+4707
-0
lines changed

9 files changed

+4707
-0
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,21 @@ $(BUILD_OUTPUT)/bin/runner: $(GOS) $(DEPLOYS)
246246
BUILD_INFO="$(VERSION_FULL)|$(GITCOMMIT)|$$(date -u | tr ' ' '.')"; \
247247
go build -ldflags -X=main.BuildInfo=$${BUILD_INFO} -o $(BUILD_OUTPUT)/bin/runner ./cmd/runner
248248

249+
# ---------------------------------------------------------------------------
250+
# Internal make step that builds the Operator legacy converter
251+
# ---------------------------------------------------------------------------
252+
.PHONY: converter
253+
converter: export CGO_ENABLED = 0
254+
converter: export GOARCH = $(ARCH)
255+
converter: export GOOS = $(OS)
256+
converter: export GO111MODULE = on
257+
converter: $(GOS) $(DEPLOYS)
258+
converter:
259+
go build -o $(BUILD_OUTPUT)/bin/converter ./cmd/converter
260+
GOOS=linux GOARCH=amd64 go build -o $(BUILD_OUTPUT)/bin/converter-linux-amd64 ./cmd/converter
261+
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_OUTPUT)/bin/converter-darwin-amd64 ./cmd/converter
262+
GOOS=windows GOARCH=amd64 go build -o $(BUILD_OUTPUT)/bin/converter-windows-amd64 ./cmd/converter
263+
249264
# ---------------------------------------------------------------------------
250265
# Internal make step that builds the Operator test utility
251266
# ---------------------------------------------------------------------------

cmd/converter/main.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at
4+
* http://oss.oracle.com/licenses/upl.
5+
*/
6+
7+
package main
8+
9+
import (
10+
"fmt"
11+
"github.com/oracle/coherence-operator/pkg/apis/coherence/legacy"
12+
"os"
13+
)
14+
15+
func main() {
16+
if len(os.Args) > 1 {
17+
f := os.Args[1]
18+
err := legacy.Convert(f, os.Stdout)
19+
if err != nil {
20+
fmt.Println(err.Error())
21+
os.Exit(1)
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)