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 cmd/crossplane/function/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func renderTemplates(targetFS afero.Fs, tmpls *template.Template, data any) erro
}

func copyFiles(src, dst afero.Fs, dstDir string) error {
return afero.Walk(src, "", func(p string, info fs.FileInfo, err error) error {
return afero.Walk(src, ".", func(p string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
10 changes: 10 additions & 0 deletions cmd/crossplane/validate/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ func TestConvertToCRDs(t *testing.T) {
Type: "string",
JSONPath: ".status.conditions[?(@.type=='Ready')].status",
},
{
Name: "RESPONSIVE",
Type: "string",
JSONPath: ".status.conditions[?(@.type=='Responsive')].status",
},
{
Name: "COMPOSITION",
Type: "string",
Expand Down Expand Up @@ -545,6 +550,11 @@ func TestConvertToCRDs(t *testing.T) {
Type: "string",
JSONPath: ".status.conditions[?(@.type=='Ready')].status",
},
{
Name: "RESPONSIVE",
Type: "string",
JSONPath: ".status.conditions[?(@.type=='Responsive')].status",
},
{
Name: "COMPOSITION",
Type: "string",
Expand Down
136 changes: 67 additions & 69 deletions go.mod

Large diffs are not rendered by default.

560 changes: 145 additions & 415 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/schemas/generator/accessors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func TestGenerateFromCRDIncludesAccessors(t *testing.T) {
// materialize writes every file in the afero filesystem out to dir on disk.
func materialize(t *testing.T, fs afero.Fs, dir string) {
t.Helper()
err := afero.Walk(fs, "", func(path string, info os.FileInfo, err error) error {
err := afero.Walk(fs, ".", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions internal/schemas/generator/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const goImportsTemplate = `// Package {{.PackageName}} contains generated models
package {{.PackageName}}

import (
"bytes"
"encoding/json"
"fmt"
"time"
Expand All @@ -119,6 +120,7 @@ import (

// Use the following to avoid unused import errors.
var (
_ *bytes.Buffer = nil
_ *time.Time = nil
_ json.RawMessage = nil
_ = fmt.Errorf
Expand Down
2 changes: 1 addition & 1 deletion internal/schemas/generator/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func mutateJSONSchema(s *jsonschema.Schema) *jsonschema.Schema {
// GenerateFromOpenAPI generates jsonschemas from OpenAPI v3 specs.
func (jsonGenerator) GenerateFromOpenAPI(_ context.Context, fromFS afero.Fs, _ runner.SchemaRunner) (afero.Fs, error) {
var openAPISpecs []*spec3.OpenAPI
err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/schemas/generator/kcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (kclGenerator) GenerateFromCRD(ctx context.Context, fromFS afero.Fs, genera

var crdPaths []string

if err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
if err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down Expand Up @@ -253,7 +253,7 @@ func (kclGenerator) GenerateFromOpenAPI(_ context.Context, fromFS afero.Fs, _ ru

openAPISpecs := make(map[string]*spec3.OpenAPI)

if err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
if err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/schemas/generator/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func collectCRDOpenAPIs(fromFS afero.Fs) ([]crdOpenAPI, error) { //nolint:gocogn
}

var openAPIs []crdOpenAPI
return openAPIs, afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
return openAPIs, afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func collectCRDOpenAPIs(fromFS afero.Fs) ([]crdOpenAPI, error) { //nolint:gocogn
func collectOpenAPISpecs(fromFS afero.Fs) ([]*spec3.OpenAPI, error) {
var openAPISpecs []*spec3.OpenAPI

err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/schemas/generator/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (p pythonGenerator) GenerateFromCRD(ctx context.Context, fromFS afero.Fs, g

var openAPIPaths []string

if err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
if err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func (p pythonGenerator) GenerateFromOpenAPI(ctx context.Context, fromFS afero.F

var openapiPaths []string

if err := afero.Walk(fromFS, "", func(path string, info fs.FileInfo, err error) error {
if err := afero.Walk(fromFS, ".", func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
// roMaterialize writes every file in fs out to dir on disk.
func roMaterialize(t *testing.T, fs afero.Fs, dir string) {
t.Helper()
err := afero.Walk(fs, "", func(path string, info os.FileInfo, err error) error {
err := afero.Walk(fs, ".", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/schemas/generator/rust_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ func rustReadTree(t *testing.T, from afero.Fs) map[string]string {
t.Helper()

tree := make(map[string]string)
err := afero.Walk(from, "", func(p string, info fs.FileInfo, err error) error {
err := afero.Walk(from, ".", func(p string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion nix/vendor-hashes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# hand.)
{
# Root module: github.com/crossplane/cli/v2
root = "sha256-O7A98U9+Cfe7oEfB6IblwgexIpG+nI/eAOZv/k0Ty6I=";
root = "sha256-UA9vH1Y3kXcdpBAr4CygCr+l+7+5/aImlU5vf0y0KiE=";
}
Loading