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 VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.5.0-dev
v0.5.1
2 changes: 1 addition & 1 deletion internal/ocm-cli/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type Component struct {
// Version is the version of the component.
Version string `json:"version"`
// ComponentReferences is a list of references to other components that this component depends on.
ComponentReferences []ComponentReference `yaml:"componentReferences"`
ComponentReferences []ComponentReference `json:"componentReferences"`
// Resources is a list of resources associated with this component, including their names, versions, types, and access information.
Resources []Resource `json:"resources"`
}
Expand Down
14 changes: 14 additions & 0 deletions internal/ocm-cli/ocm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/utils/ptr"

ocmcli "github.com/openmcp-project/bootstrapper/internal/ocm-cli"
Expand Down Expand Up @@ -114,6 +115,19 @@ func TestGetComponentVersion(t *testing.T) {
MediaType: ptr.To("application/octet-stream"),
},
})

cvMarshaled, err := json.Marshal(cv)
assert.NoError(t, err)
assert.NotNil(t, cvMarshaled)

var cvAsMap map[string]interface{}
err = json.Unmarshal(cvMarshaled, &cvAsMap)
assert.NoError(t, err)
assert.NotNil(t, cvAsMap)
assert.Contains(t, cvAsMap, "component")
assert.Contains(t, cvAsMap["component"], "componentReferences")
comp := cvAsMap["component"].(map[string]interface{})
assert.Len(t, comp["componentReferences"], 2)
},
},
{
Expand Down