Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This completes the removal of the factory types that were deprecated in v0.4.0. dies.dev dies are now used as a replacement. Refs #160 Signed-off-by: Scott Andrews <andrewssc@vmware.com>
- Loading branch information
Showing
30 changed files
with
878 additions
and
1,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,41 @@ | ||
module github.com/vmware-labs/reconciler-runtime/hack | ||
|
||
go 1.16 | ||
go 1.17 | ||
|
||
require sigs.k8s.io/controller-tools v0.7.0 | ||
require ( | ||
dies.dev/diegen v0.2.0 | ||
sigs.k8s.io/controller-tools v0.7.0 | ||
) | ||
|
||
require ( | ||
github.com/fatih/color v1.12.0 // indirect | ||
github.com/go-logr/logr v0.4.0 // indirect | ||
github.com/gobuffalo/flect v0.2.3 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/google/go-cmp v0.5.6 // indirect | ||
github.com/google/gofuzz v1.1.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.11 // indirect | ||
github.com/mattn/go-colorable v0.1.8 // indirect | ||
github.com/mattn/go-isatty v0.0.12 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/spf13/cobra v1.2.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
golang.org/x/mod v0.4.2 // indirect | ||
golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b // indirect | ||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/tools v0.1.5 // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
k8s.io/api v0.22.2 // indirect | ||
k8s.io/apiextensions-apiserver v0.22.2 // indirect | ||
k8s.io/apimachinery v0.22.2 // indirect | ||
k8s.io/klog/v2 v2.9.0 // indirect | ||
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect | ||
sigs.k8s.io/yaml v1.2.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
//go:build tools | ||
// +build tools | ||
|
||
// This package imports things required by build scripts, to force `go mod` to see them as dependencies | ||
package tools | ||
|
||
import _ "sigs.k8s.io/controller-tools/cmd/controller-gen" | ||
import ( | ||
_ "dies.dev/diegen" | ||
_ "sigs.k8s.io/controller-tools/cmd/controller-gen" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Copyright 2021 VMware, Inc. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package dies | ||
|
||
import ( | ||
diecorev1 "dies.dev/apis/core/v1" | ||
diemetav1 "dies.dev/apis/meta/v1" | ||
"github.com/vmware-labs/reconciler-runtime/internal/resources" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +die:object=true | ||
type _ = resources.TestResource | ||
|
||
// +die | ||
type _ = resources.TestResourceSpec | ||
|
||
func (d *TestResourceSpecDie) AddField(key, value string) *TestResourceSpecDie { | ||
return d.DieStamp(func(r *resources.TestResourceSpec) { | ||
if r.Fields == nil { | ||
r.Fields = map[string]string{} | ||
} | ||
r.Fields[key] = value | ||
}) | ||
} | ||
|
||
func (d *TestResourceSpecDie) TemplateDie(fn func(d *diecorev1.PodTemplateSpecDie)) *TestResourceSpecDie { | ||
return d.DieStamp(func(r *resources.TestResourceSpec) { | ||
d := diecorev1.PodTemplateSpecBlank.DieImmutable(false).DieFeed(r.Template) | ||
fn(d) | ||
r.Template = d.DieRelease() | ||
}) | ||
} | ||
|
||
// +die | ||
type _ = resources.TestResourceStatus | ||
|
||
func (d *TestResourceStatusDie) ConditionsDie(conditions ...*diemetav1.ConditionDie) *TestResourceStatusDie { | ||
return d.DieStamp(func(r *resources.TestResourceStatus) { | ||
r.Conditions = make([]metav1.Condition, len(conditions)) | ||
for i := range conditions { | ||
r.Conditions[i] = conditions[i].DieRelease() | ||
} | ||
}) | ||
} | ||
|
||
func (d *TestResourceStatusDie) AddField(key, value string) *TestResourceStatusDie { | ||
return d.DieStamp(func(r *resources.TestResourceStatus) { | ||
if r.Fields == nil { | ||
r.Fields = map[string]string{} | ||
} | ||
r.Fields[key] = value | ||
}) | ||
} | ||
|
||
// +die:object=true | ||
type _ = resources.TestResourceNoStatus |
Oops, something went wrong.