diff --git a/README.md b/README.md index 67522ad..e268c62 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,16 @@ type MyResourceDie interface { // resource is nil, the empty value is used instead. DieFeedPtr(r *MyResource) *MyResourceDie - // DieFeedRawExtension returns a new die with the provided raw extension. + // DieFeedJSON returns a new die with the provided JSON. Panics on error. + DieFeedJSON(j []byte) *MyResourceDie + + // DieFeedYAML returns a new die with the provided YAML. Panics on error. + DieFeedYAML(y []byte) *MyResourceDie + + // DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. + DieFeedYAMLFile(name string) *MyResourceDie + + // DieFeedRawExtension returns a new die with the provided raw extension. Panics on error. DieFeedRawExtension(raw runtime.RawExtension) *MyResourceDie // DieRelease returns the resource managed by the die. @@ -131,8 +140,14 @@ type MyResourceDie interface { // DieReleasePtr returns a pointer to the resource managed by the die. DieReleasePtr() *MyResource + // DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. + DieReleaseJSON() []byte + + // DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. + DieReleaseYAML() []byte + // DieReleaseRawExtension returns the resource managed by the die as an - // raw extension. + // raw extension. Panics on error. DieReleaseRawExtension() runtime.RawExtension // DieImmutable returns a new die for the current die's state that is diff --git a/apis/admission/v1/zz_generated.die.go b/apis/admission/v1/zz_generated.die.go index 4399eee..c7c5ac5 100644 --- a/apis/admission/v1/zz_generated.die.go +++ b/apis/admission/v1/zz_generated.die.go @@ -28,6 +28,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" + osx "os" + yaml "sigs.k8s.io/yaml" ) var AdmissionRequestBlank = (&AdmissionRequestDie{}).DieFeed(admissionv1.AdmissionRequest{}) @@ -67,14 +69,42 @@ func (d *AdmissionRequestDie) DieFeedPtr(r *admissionv1.AdmissionRequest) *Admis return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionRequestDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AdmissionRequestDie) DieFeedJSON(j []byte) *AdmissionRequestDie { r := admissionv1.AdmissionRequest{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AdmissionRequestDie) DieFeedYAML(y []byte) *AdmissionRequestDie { + r := admissionv1.AdmissionRequest{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AdmissionRequestDie) DieFeedYAMLFile(name string) *AdmissionRequestDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionRequestDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AdmissionRequestDie) DieRelease() admissionv1.AdmissionRequest { if d.mutable { @@ -89,12 +119,33 @@ func (d *AdmissionRequestDie) DieReleasePtr() *admissionv1.AdmissionRequest { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionRequestDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AdmissionRequestDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AdmissionRequestDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionRequestDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -264,14 +315,42 @@ func (d *AdmissionResponseDie) DieFeedPtr(r *admissionv1.AdmissionResponse) *Adm return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionResponseDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionResponseDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AdmissionResponseDie) DieFeedJSON(j []byte) *AdmissionResponseDie { + r := admissionv1.AdmissionResponse{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AdmissionResponseDie) DieFeedYAML(y []byte) *AdmissionResponseDie { r := admissionv1.AdmissionResponse{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AdmissionResponseDie) DieFeedYAMLFile(name string) *AdmissionResponseDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionResponseDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionResponseDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AdmissionResponseDie) DieRelease() admissionv1.AdmissionResponse { if d.mutable { @@ -286,12 +365,33 @@ func (d *AdmissionResponseDie) DieReleasePtr() *admissionv1.AdmissionResponse { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionResponseDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AdmissionResponseDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AdmissionResponseDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionResponseDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -397,14 +497,42 @@ func (d *AdmissionReviewDie) DieFeedPtr(r *admissionv1.AdmissionReview) *Admissi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AdmissionReviewDie) DieFeedJSON(j []byte) *AdmissionReviewDie { + r := admissionv1.AdmissionReview{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AdmissionReviewDie) DieFeedYAML(y []byte) *AdmissionReviewDie { r := admissionv1.AdmissionReview{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AdmissionReviewDie) DieFeedYAMLFile(name string) *AdmissionReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AdmissionReviewDie) DieRelease() admissionv1.AdmissionReview { if d.mutable { @@ -419,12 +547,33 @@ func (d *AdmissionReviewDie) DieReleasePtr() *admissionv1.AdmissionReview { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AdmissionReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AdmissionReviewDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AdmissionReviewDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AdmissionReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/admissionregistration/v1/zz_generated.die.go b/apis/admissionregistration/v1/zz_generated.die.go index 72215d2..5b67bb1 100644 --- a/apis/admissionregistration/v1/zz_generated.die.go +++ b/apis/admissionregistration/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var WebhookClientConfigBlank = (&WebhookClientConfigDie{}).DieFeed(admissionregistrationv1.WebhookClientConfig{}) @@ -69,14 +71,42 @@ func (d *WebhookClientConfigDie) DieFeedPtr(r *admissionregistrationv1.WebhookCl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookClientConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookClientConfigDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *WebhookClientConfigDie) DieFeedJSON(j []byte) *WebhookClientConfigDie { r := admissionregistrationv1.WebhookClientConfig{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *WebhookClientConfigDie) DieFeedYAML(y []byte) *WebhookClientConfigDie { + r := admissionregistrationv1.WebhookClientConfig{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *WebhookClientConfigDie) DieFeedYAMLFile(name string) *WebhookClientConfigDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookClientConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookClientConfigDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *WebhookClientConfigDie) DieRelease() admissionregistrationv1.WebhookClientConfig { if d.mutable { @@ -91,12 +121,33 @@ func (d *WebhookClientConfigDie) DieReleasePtr() *admissionregistrationv1.Webhoo return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookClientConfigDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -186,14 +237,42 @@ func (d *ServiceReferenceDie) DieFeedPtr(r *admissionregistrationv1.ServiceRefer return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceReferenceDie) DieFeedJSON(j []byte) *ServiceReferenceDie { r := admissionregistrationv1.ServiceReference{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAML(y []byte) *ServiceReferenceDie { + r := admissionregistrationv1.ServiceReference{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAMLFile(name string) *ServiceReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceReferenceDie) DieRelease() admissionregistrationv1.ServiceReference { if d.mutable { @@ -208,12 +287,33 @@ func (d *ServiceReferenceDie) DieReleasePtr() *admissionregistrationv1.ServiceRe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -298,14 +398,42 @@ func (d *RuleWithOperationsDie) DieFeedPtr(r *admissionregistrationv1.RuleWithOp return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RuleWithOperationsDie) DieFeedRawExtension(raw runtime.RawExtension) *RuleWithOperationsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RuleWithOperationsDie) DieFeedJSON(j []byte) *RuleWithOperationsDie { r := admissionregistrationv1.RuleWithOperations{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RuleWithOperationsDie) DieFeedYAML(y []byte) *RuleWithOperationsDie { + r := admissionregistrationv1.RuleWithOperations{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RuleWithOperationsDie) DieFeedYAMLFile(name string) *RuleWithOperationsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuleWithOperationsDie) DieFeedRawExtension(raw runtime.RawExtension) *RuleWithOperationsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RuleWithOperationsDie) DieRelease() admissionregistrationv1.RuleWithOperations { if d.mutable { @@ -320,12 +448,33 @@ func (d *RuleWithOperationsDie) DieReleasePtr() *admissionregistrationv1.RuleWit return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RuleWithOperationsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RuleWithOperationsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RuleWithOperationsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuleWithOperationsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -396,14 +545,42 @@ func (d *RuleDie) DieFeedPtr(r *admissionregistrationv1.Rule) *RuleDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RuleDie) DieFeedRawExtension(raw runtime.RawExtension) *RuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RuleDie) DieFeedJSON(j []byte) *RuleDie { r := admissionregistrationv1.Rule{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RuleDie) DieFeedYAML(y []byte) *RuleDie { + r := admissionregistrationv1.Rule{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RuleDie) DieFeedYAMLFile(name string) *RuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuleDie) DieFeedRawExtension(raw runtime.RawExtension) *RuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RuleDie) DieRelease() admissionregistrationv1.Rule { if d.mutable { @@ -418,12 +595,33 @@ func (d *RuleDie) DieReleasePtr() *admissionregistrationv1.Rule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -517,14 +715,42 @@ func (d *MutatingWebhookConfigurationDie) DieFeedPtr(r *admissionregistrationv1. return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *MutatingWebhookConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *MutatingWebhookConfigurationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieFeedJSON(j []byte) *MutatingWebhookConfigurationDie { r := admissionregistrationv1.MutatingWebhookConfiguration{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieFeedYAML(y []byte) *MutatingWebhookConfigurationDie { + r := admissionregistrationv1.MutatingWebhookConfiguration{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieFeedYAMLFile(name string) *MutatingWebhookConfigurationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *MutatingWebhookConfigurationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *MutatingWebhookConfigurationDie) DieRelease() admissionregistrationv1.MutatingWebhookConfiguration { if d.mutable { @@ -539,21 +765,45 @@ func (d *MutatingWebhookConfigurationDie) DieReleasePtr() *admissionregistration return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *MutatingWebhookConfigurationDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *MutatingWebhookConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *MutatingWebhookConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -669,14 +919,42 @@ func (d *MutatingWebhookDie) DieFeedPtr(r *admissionregistrationv1.MutatingWebho return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *MutatingWebhookDie) DieFeedRawExtension(raw runtime.RawExtension) *MutatingWebhookDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *MutatingWebhookDie) DieFeedJSON(j []byte) *MutatingWebhookDie { r := admissionregistrationv1.MutatingWebhook{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *MutatingWebhookDie) DieFeedYAML(y []byte) *MutatingWebhookDie { + r := admissionregistrationv1.MutatingWebhook{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *MutatingWebhookDie) DieFeedYAMLFile(name string) *MutatingWebhookDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *MutatingWebhookDie) DieFeedRawExtension(raw runtime.RawExtension) *MutatingWebhookDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *MutatingWebhookDie) DieRelease() admissionregistrationv1.MutatingWebhook { if d.mutable { @@ -691,12 +969,33 @@ func (d *MutatingWebhookDie) DieReleasePtr() *admissionregistrationv1.MutatingWe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *MutatingWebhookDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *MutatingWebhookDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *MutatingWebhookDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *MutatingWebhookDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -853,14 +1152,42 @@ func (d *ValidatingWebhookConfigurationDie) DieFeedPtr(r *admissionregistrationv return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ValidatingWebhookConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *ValidatingWebhookConfigurationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieFeedJSON(j []byte) *ValidatingWebhookConfigurationDie { r := admissionregistrationv1.ValidatingWebhookConfiguration{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieFeedYAML(y []byte) *ValidatingWebhookConfigurationDie { + r := admissionregistrationv1.ValidatingWebhookConfiguration{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieFeedYAMLFile(name string) *ValidatingWebhookConfigurationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *ValidatingWebhookConfigurationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ValidatingWebhookConfigurationDie) DieRelease() admissionregistrationv1.ValidatingWebhookConfiguration { if d.mutable { @@ -875,21 +1202,45 @@ func (d *ValidatingWebhookConfigurationDie) DieReleasePtr() *admissionregistrati return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ValidatingWebhookConfigurationDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ValidatingWebhookConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ValidatingWebhookConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1005,14 +1356,42 @@ func (d *ValidatingWebhookDie) DieFeedPtr(r *admissionregistrationv1.ValidatingW return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ValidatingWebhookDie) DieFeedRawExtension(raw runtime.RawExtension) *ValidatingWebhookDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ValidatingWebhookDie) DieFeedJSON(j []byte) *ValidatingWebhookDie { + r := admissionregistrationv1.ValidatingWebhook{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ValidatingWebhookDie) DieFeedYAML(y []byte) *ValidatingWebhookDie { r := admissionregistrationv1.ValidatingWebhook{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ValidatingWebhookDie) DieFeedYAMLFile(name string) *ValidatingWebhookDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ValidatingWebhookDie) DieFeedRawExtension(raw runtime.RawExtension) *ValidatingWebhookDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ValidatingWebhookDie) DieRelease() admissionregistrationv1.ValidatingWebhook { if d.mutable { @@ -1027,12 +1406,33 @@ func (d *ValidatingWebhookDie) DieReleasePtr() *admissionregistrationv1.Validati return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ValidatingWebhookDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ValidatingWebhookDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ValidatingWebhookDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ValidatingWebhookDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/apiextensions/v1/zz_generated.die.go b/apis/apiextensions/v1/zz_generated.die.go index e3c9631..e3b9753 100644 --- a/apis/apiextensions/v1/zz_generated.die.go +++ b/apis/apiextensions/v1/zz_generated.die.go @@ -29,6 +29,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var CustomResourceDefinitionBlank = (&CustomResourceDefinitionDie{}).DieFeed(apiextensionsv1.CustomResourceDefinition{}) @@ -71,14 +73,42 @@ func (d *CustomResourceDefinitionDie) DieFeedPtr(r *apiextensionsv1.CustomResour return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceDefinitionDie) DieFeedJSON(j []byte) *CustomResourceDefinitionDie { + r := apiextensionsv1.CustomResourceDefinition{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceDefinitionDie) DieFeedYAML(y []byte) *CustomResourceDefinitionDie { r := apiextensionsv1.CustomResourceDefinition{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceDefinitionDie) DieFeedYAMLFile(name string) *CustomResourceDefinitionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceDefinitionDie) DieRelease() apiextensionsv1.CustomResourceDefinition { if d.mutable { @@ -93,21 +123,45 @@ func (d *CustomResourceDefinitionDie) DieReleasePtr() *apiextensionsv1.CustomRes return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CustomResourceDefinitionDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceDefinitionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceDefinitionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -248,14 +302,42 @@ func (d *CustomResourceDefinitionSpecDie) DieFeedPtr(r *apiextensionsv1.CustomRe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieFeedJSON(j []byte) *CustomResourceDefinitionSpecDie { + r := apiextensionsv1.CustomResourceDefinitionSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieFeedYAML(y []byte) *CustomResourceDefinitionSpecDie { r := apiextensionsv1.CustomResourceDefinitionSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieFeedYAMLFile(name string) *CustomResourceDefinitionSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceDefinitionSpecDie) DieRelease() apiextensionsv1.CustomResourceDefinitionSpec { if d.mutable { @@ -270,12 +352,33 @@ func (d *CustomResourceDefinitionSpecDie) DieReleasePtr() *apiextensionsv1.Custo return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -374,14 +477,42 @@ func (d *CustomResourceDefinitionVersionDie) DieFeedPtr(r *apiextensionsv1.Custo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionVersionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionVersionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieFeedJSON(j []byte) *CustomResourceDefinitionVersionDie { r := apiextensionsv1.CustomResourceDefinitionVersion{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieFeedYAML(y []byte) *CustomResourceDefinitionVersionDie { + r := apiextensionsv1.CustomResourceDefinitionVersion{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieFeedYAMLFile(name string) *CustomResourceDefinitionVersionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionVersionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceDefinitionVersionDie) DieRelease() apiextensionsv1.CustomResourceDefinitionVersion { if d.mutable { @@ -396,12 +527,33 @@ func (d *CustomResourceDefinitionVersionDie) DieReleasePtr() *apiextensionsv1.Cu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionVersionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionVersionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -514,14 +666,42 @@ func (d *CustomResourceValidationDie) DieFeedPtr(r *apiextensionsv1.CustomResour return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceValidationDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceValidationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceValidationDie) DieFeedJSON(j []byte) *CustomResourceValidationDie { r := apiextensionsv1.CustomResourceValidation{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceValidationDie) DieFeedYAML(y []byte) *CustomResourceValidationDie { + r := apiextensionsv1.CustomResourceValidation{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceValidationDie) DieFeedYAMLFile(name string) *CustomResourceValidationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceValidationDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceValidationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceValidationDie) DieRelease() apiextensionsv1.CustomResourceValidation { if d.mutable { @@ -536,12 +716,33 @@ func (d *CustomResourceValidationDie) DieReleasePtr() *apiextensionsv1.CustomRes return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceValidationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceValidationDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceValidationDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceValidationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -605,14 +806,42 @@ func (d *CustomResourceSubresourcesDie) DieFeedPtr(r *apiextensionsv1.CustomReso return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceSubresourcesDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceSubresourcesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceSubresourcesDie) DieFeedJSON(j []byte) *CustomResourceSubresourcesDie { r := apiextensionsv1.CustomResourceSubresources{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceSubresourcesDie) DieFeedYAML(y []byte) *CustomResourceSubresourcesDie { + r := apiextensionsv1.CustomResourceSubresources{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceSubresourcesDie) DieFeedYAMLFile(name string) *CustomResourceSubresourcesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceSubresourcesDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceSubresourcesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceSubresourcesDie) DieRelease() apiextensionsv1.CustomResourceSubresources { if d.mutable { @@ -627,12 +856,33 @@ func (d *CustomResourceSubresourcesDie) DieReleasePtr() *apiextensionsv1.CustomR return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceSubresourcesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceSubresourcesDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceSubresourcesDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceSubresourcesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -703,14 +953,42 @@ func (d *CustomResourceSubresourceScaleDie) DieFeedPtr(r *apiextensionsv1.Custom return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceSubresourceScaleDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceSubresourceScaleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieFeedJSON(j []byte) *CustomResourceSubresourceScaleDie { + r := apiextensionsv1.CustomResourceSubresourceScale{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieFeedYAML(y []byte) *CustomResourceSubresourceScaleDie { r := apiextensionsv1.CustomResourceSubresourceScale{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieFeedYAMLFile(name string) *CustomResourceSubresourceScaleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceSubresourceScaleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceSubresourceScaleDie) DieRelease() apiextensionsv1.CustomResourceSubresourceScale { if d.mutable { @@ -725,12 +1003,33 @@ func (d *CustomResourceSubresourceScaleDie) DieReleasePtr() *apiextensionsv1.Cus return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceSubresourceScaleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceSubresourceScaleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -808,14 +1107,42 @@ func (d *CustomResourceColumnDefinitionDie) DieFeedPtr(r *apiextensionsv1.Custom return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceColumnDefinitionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceColumnDefinitionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieFeedJSON(j []byte) *CustomResourceColumnDefinitionDie { r := apiextensionsv1.CustomResourceColumnDefinition{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieFeedYAML(y []byte) *CustomResourceColumnDefinitionDie { + r := apiextensionsv1.CustomResourceColumnDefinition{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieFeedYAMLFile(name string) *CustomResourceColumnDefinitionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceColumnDefinitionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceColumnDefinitionDie) DieRelease() apiextensionsv1.CustomResourceColumnDefinition { if d.mutable { @@ -830,12 +1157,33 @@ func (d *CustomResourceColumnDefinitionDie) DieReleasePtr() *apiextensionsv1.Cus return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceColumnDefinitionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceColumnDefinitionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -934,14 +1282,42 @@ func (d *CustomResourceConversionDie) DieFeedPtr(r *apiextensionsv1.CustomResour return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceConversionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceConversionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceConversionDie) DieFeedJSON(j []byte) *CustomResourceConversionDie { + r := apiextensionsv1.CustomResourceConversion{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceConversionDie) DieFeedYAML(y []byte) *CustomResourceConversionDie { r := apiextensionsv1.CustomResourceConversion{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceConversionDie) DieFeedYAMLFile(name string) *CustomResourceConversionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceConversionDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceConversionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceConversionDie) DieRelease() apiextensionsv1.CustomResourceConversion { if d.mutable { @@ -956,12 +1332,33 @@ func (d *CustomResourceConversionDie) DieReleasePtr() *apiextensionsv1.CustomRes return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceConversionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceConversionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceConversionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceConversionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1032,14 +1429,42 @@ func (d *WebhookConversionDie) DieFeedPtr(r *apiextensionsv1.WebhookConversion) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookConversionDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookConversionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *WebhookConversionDie) DieFeedJSON(j []byte) *WebhookConversionDie { + r := apiextensionsv1.WebhookConversion{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *WebhookConversionDie) DieFeedYAML(y []byte) *WebhookConversionDie { r := apiextensionsv1.WebhookConversion{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *WebhookConversionDie) DieFeedYAMLFile(name string) *WebhookConversionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookConversionDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookConversionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *WebhookConversionDie) DieRelease() apiextensionsv1.WebhookConversion { if d.mutable { @@ -1054,12 +1479,33 @@ func (d *WebhookConversionDie) DieReleasePtr() *apiextensionsv1.WebhookConversio return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookConversionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *WebhookConversionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *WebhookConversionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookConversionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1130,14 +1576,42 @@ func (d *WebhookClientConfigDie) DieFeedPtr(r *apiextensionsv1.WebhookClientConf return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookClientConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookClientConfigDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *WebhookClientConfigDie) DieFeedJSON(j []byte) *WebhookClientConfigDie { + r := apiextensionsv1.WebhookClientConfig{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *WebhookClientConfigDie) DieFeedYAML(y []byte) *WebhookClientConfigDie { r := apiextensionsv1.WebhookClientConfig{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *WebhookClientConfigDie) DieFeedYAMLFile(name string) *WebhookClientConfigDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookClientConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *WebhookClientConfigDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *WebhookClientConfigDie) DieRelease() apiextensionsv1.WebhookClientConfig { if d.mutable { @@ -1152,12 +1626,33 @@ func (d *WebhookClientConfigDie) DieReleasePtr() *apiextensionsv1.WebhookClientC return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *WebhookClientConfigDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WebhookClientConfigDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1247,14 +1742,42 @@ func (d *ServiceReferenceDie) DieFeedPtr(r *apiextensionsv1.ServiceReference) *S return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceReferenceDie) DieFeedJSON(j []byte) *ServiceReferenceDie { + r := apiextensionsv1.ServiceReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAML(y []byte) *ServiceReferenceDie { r := apiextensionsv1.ServiceReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAMLFile(name string) *ServiceReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceReferenceDie) DieRelease() apiextensionsv1.ServiceReference { if d.mutable { @@ -1269,12 +1792,33 @@ func (d *ServiceReferenceDie) DieReleasePtr() *apiextensionsv1.ServiceReference return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1359,14 +1903,42 @@ func (d *CustomResourceDefinitionStatusDie) DieFeedPtr(r *apiextensionsv1.Custom return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieFeedJSON(j []byte) *CustomResourceDefinitionStatusDie { r := apiextensionsv1.CustomResourceDefinitionStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieFeedYAML(y []byte) *CustomResourceDefinitionStatusDie { + r := apiextensionsv1.CustomResourceDefinitionStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieFeedYAMLFile(name string) *CustomResourceDefinitionStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceDefinitionStatusDie) DieRelease() apiextensionsv1.CustomResourceDefinitionStatus { if d.mutable { @@ -1381,12 +1953,33 @@ func (d *CustomResourceDefinitionStatusDie) DieReleasePtr() *apiextensionsv1.Cus return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1464,14 +2057,42 @@ func (d *CustomResourceDefinitionNamesDie) DieFeedPtr(r *apiextensionsv1.CustomR return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionNamesDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionNamesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieFeedJSON(j []byte) *CustomResourceDefinitionNamesDie { r := apiextensionsv1.CustomResourceDefinitionNames{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieFeedYAML(y []byte) *CustomResourceDefinitionNamesDie { + r := apiextensionsv1.CustomResourceDefinitionNames{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieFeedYAMLFile(name string) *CustomResourceDefinitionNamesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieFeedRawExtension(raw runtime.RawExtension) *CustomResourceDefinitionNamesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CustomResourceDefinitionNamesDie) DieRelease() apiextensionsv1.CustomResourceDefinitionNames { if d.mutable { @@ -1486,12 +2107,33 @@ func (d *CustomResourceDefinitionNamesDie) DieReleasePtr() *apiextensionsv1.Cust return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CustomResourceDefinitionNamesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CustomResourceDefinitionNamesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/apiregistration/v1/zz_generated.die.go b/apis/apiregistration/v1/zz_generated.die.go index 213129b..8e37038 100644 --- a/apis/apiregistration/v1/zz_generated.die.go +++ b/apis/apiregistration/v1/zz_generated.die.go @@ -29,6 +29,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kube-aggregator/pkg/apis/apiregistration" + osx "os" + yaml "sigs.k8s.io/yaml" ) var APIServiceBlank = (&APIServiceDie{}).DieFeed(apiregistration.APIService{}) @@ -71,14 +73,42 @@ func (d *APIServiceDie) DieFeedPtr(r *apiregistration.APIService) *APIServiceDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *APIServiceDie) DieFeedJSON(j []byte) *APIServiceDie { r := apiregistration.APIService{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *APIServiceDie) DieFeedYAML(y []byte) *APIServiceDie { + r := apiregistration.APIService{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *APIServiceDie) DieFeedYAMLFile(name string) *APIServiceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *APIServiceDie) DieRelease() apiregistration.APIService { if d.mutable { @@ -93,21 +123,45 @@ func (d *APIServiceDie) DieReleasePtr() *apiregistration.APIService { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *APIServiceDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *APIServiceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *APIServiceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -248,14 +302,42 @@ func (d *APIServiceSpecDie) DieFeedPtr(r *apiregistration.APIServiceSpec) *APISe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *APIServiceSpecDie) DieFeedJSON(j []byte) *APIServiceSpecDie { + r := apiregistration.APIServiceSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *APIServiceSpecDie) DieFeedYAML(y []byte) *APIServiceSpecDie { r := apiregistration.APIServiceSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *APIServiceSpecDie) DieFeedYAMLFile(name string) *APIServiceSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *APIServiceSpecDie) DieRelease() apiregistration.APIServiceSpec { if d.mutable { @@ -270,12 +352,33 @@ func (d *APIServiceSpecDie) DieReleasePtr() *apiregistration.APIServiceSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *APIServiceSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *APIServiceSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -381,14 +484,42 @@ func (d *ServiceReferenceDie) DieFeedPtr(r *apiregistration.ServiceReference) *S return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceReferenceDie) DieFeedJSON(j []byte) *ServiceReferenceDie { + r := apiregistration.ServiceReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAML(y []byte) *ServiceReferenceDie { r := apiregistration.ServiceReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceReferenceDie) DieFeedYAMLFile(name string) *ServiceReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceReferenceDie) DieRelease() apiregistration.ServiceReference { if d.mutable { @@ -403,12 +534,33 @@ func (d *ServiceReferenceDie) DieReleasePtr() *apiregistration.ServiceReference return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -486,14 +638,42 @@ func (d *APIServiceStatusDie) DieFeedPtr(r *apiregistration.APIServiceStatus) *A return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *APIServiceStatusDie) DieFeedJSON(j []byte) *APIServiceStatusDie { + r := apiregistration.APIServiceStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *APIServiceStatusDie) DieFeedYAML(y []byte) *APIServiceStatusDie { r := apiregistration.APIServiceStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *APIServiceStatusDie) DieFeedYAMLFile(name string) *APIServiceStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *APIServiceStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *APIServiceStatusDie) DieRelease() apiregistration.APIServiceStatus { if d.mutable { @@ -508,12 +688,33 @@ func (d *APIServiceStatusDie) DieReleasePtr() *apiregistration.APIServiceStatus return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *APIServiceStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *APIServiceStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *APIServiceStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *APIServiceStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/apiserver/flowcontrol/v1beta1/zz_generated.die.go b/apis/apiserver/flowcontrol/v1beta1/zz_generated.die.go index 5be560a..6075cc4 100644 --- a/apis/apiserver/flowcontrol/v1beta1/zz_generated.die.go +++ b/apis/apiserver/flowcontrol/v1beta1/zz_generated.die.go @@ -29,6 +29,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var FlowSchemaBlank = (&FlowSchemaDie{}).DieFeed(flowcontrolv1beta1.FlowSchema{}) @@ -71,14 +73,42 @@ func (d *FlowSchemaDie) DieFeedPtr(r *flowcontrolv1beta1.FlowSchema) *FlowSchema return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlowSchemaDie) DieFeedJSON(j []byte) *FlowSchemaDie { r := flowcontrolv1beta1.FlowSchema{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlowSchemaDie) DieFeedYAML(y []byte) *FlowSchemaDie { + r := flowcontrolv1beta1.FlowSchema{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlowSchemaDie) DieFeedYAMLFile(name string) *FlowSchemaDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlowSchemaDie) DieRelease() flowcontrolv1beta1.FlowSchema { if d.mutable { @@ -93,21 +123,45 @@ func (d *FlowSchemaDie) DieReleasePtr() *flowcontrolv1beta1.FlowSchema { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *FlowSchemaDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlowSchemaDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlowSchemaDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -248,14 +302,42 @@ func (d *FlowSchemaSpecDie) DieFeedPtr(r *flowcontrolv1beta1.FlowSchemaSpec) *Fl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlowSchemaSpecDie) DieFeedJSON(j []byte) *FlowSchemaSpecDie { r := flowcontrolv1beta1.FlowSchemaSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlowSchemaSpecDie) DieFeedYAML(y []byte) *FlowSchemaSpecDie { + r := flowcontrolv1beta1.FlowSchemaSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlowSchemaSpecDie) DieFeedYAMLFile(name string) *FlowSchemaSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlowSchemaSpecDie) DieRelease() flowcontrolv1beta1.FlowSchemaSpec { if d.mutable { @@ -270,12 +352,33 @@ func (d *FlowSchemaSpecDie) DieReleasePtr() *flowcontrolv1beta1.FlowSchemaSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlowSchemaSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlowSchemaSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -360,14 +463,42 @@ func (d *FlowSchemaStatusDie) DieFeedPtr(r *flowcontrolv1beta1.FlowSchemaStatus) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlowSchemaStatusDie) DieFeedJSON(j []byte) *FlowSchemaStatusDie { r := flowcontrolv1beta1.FlowSchemaStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlowSchemaStatusDie) DieFeedYAML(y []byte) *FlowSchemaStatusDie { + r := flowcontrolv1beta1.FlowSchemaStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlowSchemaStatusDie) DieFeedYAMLFile(name string) *FlowSchemaStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowSchemaStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlowSchemaStatusDie) DieRelease() flowcontrolv1beta1.FlowSchemaStatus { if d.mutable { @@ -382,12 +513,33 @@ func (d *FlowSchemaStatusDie) DieReleasePtr() *flowcontrolv1beta1.FlowSchemaStat return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowSchemaStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlowSchemaStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlowSchemaStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowSchemaStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -451,14 +603,42 @@ func (d *PriorityLevelConfigurationReferenceDie) DieFeedPtr(r *flowcontrolv1beta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieFeedJSON(j []byte) *PriorityLevelConfigurationReferenceDie { r := flowcontrolv1beta1.PriorityLevelConfigurationReference{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieFeedYAML(y []byte) *PriorityLevelConfigurationReferenceDie { + r := flowcontrolv1beta1.PriorityLevelConfigurationReference{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieFeedYAMLFile(name string) *PriorityLevelConfigurationReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PriorityLevelConfigurationReferenceDie) DieRelease() flowcontrolv1beta1.PriorityLevelConfigurationReference { if d.mutable { @@ -473,12 +653,33 @@ func (d *PriorityLevelConfigurationReferenceDie) DieReleasePtr() *flowcontrolv1b return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -542,14 +743,42 @@ func (d *FlowDistinguisherMethodDie) DieFeedPtr(r *flowcontrolv1beta1.FlowDistin return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowDistinguisherMethodDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowDistinguisherMethodDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlowDistinguisherMethodDie) DieFeedJSON(j []byte) *FlowDistinguisherMethodDie { r := flowcontrolv1beta1.FlowDistinguisherMethod{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlowDistinguisherMethodDie) DieFeedYAML(y []byte) *FlowDistinguisherMethodDie { + r := flowcontrolv1beta1.FlowDistinguisherMethod{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlowDistinguisherMethodDie) DieFeedYAMLFile(name string) *FlowDistinguisherMethodDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowDistinguisherMethodDie) DieFeedRawExtension(raw runtime.RawExtension) *FlowDistinguisherMethodDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlowDistinguisherMethodDie) DieRelease() flowcontrolv1beta1.FlowDistinguisherMethod { if d.mutable { @@ -564,12 +793,33 @@ func (d *FlowDistinguisherMethodDie) DieReleasePtr() *flowcontrolv1beta1.FlowDis return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlowDistinguisherMethodDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlowDistinguisherMethodDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlowDistinguisherMethodDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlowDistinguisherMethodDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -633,14 +883,42 @@ func (d *PolicyRulesWithSubjectsDie) DieFeedPtr(r *flowcontrolv1beta1.PolicyRule return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PolicyRulesWithSubjectsDie) DieFeedRawExtension(raw runtime.RawExtension) *PolicyRulesWithSubjectsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieFeedJSON(j []byte) *PolicyRulesWithSubjectsDie { r := flowcontrolv1beta1.PolicyRulesWithSubjects{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieFeedYAML(y []byte) *PolicyRulesWithSubjectsDie { + r := flowcontrolv1beta1.PolicyRulesWithSubjects{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieFeedYAMLFile(name string) *PolicyRulesWithSubjectsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieFeedRawExtension(raw runtime.RawExtension) *PolicyRulesWithSubjectsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PolicyRulesWithSubjectsDie) DieRelease() flowcontrolv1beta1.PolicyRulesWithSubjects { if d.mutable { @@ -655,12 +933,33 @@ func (d *PolicyRulesWithSubjectsDie) DieReleasePtr() *flowcontrolv1beta1.PolicyR return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PolicyRulesWithSubjectsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PolicyRulesWithSubjectsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -738,14 +1037,42 @@ func (d *SubjectDie) DieFeedPtr(r *flowcontrolv1beta1.Subject) *SubjectDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectDie) DieFeedJSON(j []byte) *SubjectDie { r := flowcontrolv1beta1.Subject{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectDie) DieFeedYAML(y []byte) *SubjectDie { + r := flowcontrolv1beta1.Subject{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectDie) DieFeedYAMLFile(name string) *SubjectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectDie) DieRelease() flowcontrolv1beta1.Subject { if d.mutable { @@ -760,12 +1087,33 @@ func (d *SubjectDie) DieReleasePtr() *flowcontrolv1beta1.Subject { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -850,14 +1198,42 @@ func (d *UserSubjectDie) DieFeedPtr(r *flowcontrolv1beta1.UserSubject) *UserSubj return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *UserSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *UserSubjectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *UserSubjectDie) DieFeedJSON(j []byte) *UserSubjectDie { r := flowcontrolv1beta1.UserSubject{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *UserSubjectDie) DieFeedYAML(y []byte) *UserSubjectDie { + r := flowcontrolv1beta1.UserSubject{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *UserSubjectDie) DieFeedYAMLFile(name string) *UserSubjectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UserSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *UserSubjectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *UserSubjectDie) DieRelease() flowcontrolv1beta1.UserSubject { if d.mutable { @@ -872,12 +1248,33 @@ func (d *UserSubjectDie) DieReleasePtr() *flowcontrolv1beta1.UserSubject { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *UserSubjectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *UserSubjectDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *UserSubjectDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UserSubjectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -941,14 +1338,42 @@ func (d *GroupSubjectDie) DieFeedPtr(r *flowcontrolv1beta1.GroupSubject) *GroupS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupSubjectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupSubjectDie) DieFeedJSON(j []byte) *GroupSubjectDie { + r := flowcontrolv1beta1.GroupSubject{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupSubjectDie) DieFeedYAML(y []byte) *GroupSubjectDie { r := flowcontrolv1beta1.GroupSubject{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupSubjectDie) DieFeedYAMLFile(name string) *GroupSubjectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupSubjectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupSubjectDie) DieRelease() flowcontrolv1beta1.GroupSubject { if d.mutable { @@ -963,12 +1388,33 @@ func (d *GroupSubjectDie) DieReleasePtr() *flowcontrolv1beta1.GroupSubject { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupSubjectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupSubjectDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupSubjectDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupSubjectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1032,14 +1478,42 @@ func (d *ServiceAccountSubjectDie) DieFeedPtr(r *flowcontrolv1beta1.ServiceAccou return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountSubjectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceAccountSubjectDie) DieFeedJSON(j []byte) *ServiceAccountSubjectDie { r := flowcontrolv1beta1.ServiceAccountSubject{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceAccountSubjectDie) DieFeedYAML(y []byte) *ServiceAccountSubjectDie { + r := flowcontrolv1beta1.ServiceAccountSubject{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceAccountSubjectDie) DieFeedYAMLFile(name string) *ServiceAccountSubjectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountSubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountSubjectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceAccountSubjectDie) DieRelease() flowcontrolv1beta1.ServiceAccountSubject { if d.mutable { @@ -1054,12 +1528,33 @@ func (d *ServiceAccountSubjectDie) DieReleasePtr() *flowcontrolv1beta1.ServiceAc return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountSubjectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceAccountSubjectDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceAccountSubjectDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountSubjectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1130,14 +1625,42 @@ func (d *ResourcePolicyRuleDie) DieFeedPtr(r *flowcontrolv1beta1.ResourcePolicyR return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourcePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourcePolicyRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourcePolicyRuleDie) DieFeedJSON(j []byte) *ResourcePolicyRuleDie { r := flowcontrolv1beta1.ResourcePolicyRule{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourcePolicyRuleDie) DieFeedYAML(y []byte) *ResourcePolicyRuleDie { + r := flowcontrolv1beta1.ResourcePolicyRule{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourcePolicyRuleDie) DieFeedYAMLFile(name string) *ResourcePolicyRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourcePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourcePolicyRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourcePolicyRuleDie) DieRelease() flowcontrolv1beta1.ResourcePolicyRule { if d.mutable { @@ -1152,12 +1675,33 @@ func (d *ResourcePolicyRuleDie) DieReleasePtr() *flowcontrolv1beta1.ResourcePoli return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourcePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourcePolicyRuleDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourcePolicyRuleDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourcePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1249,14 +1793,42 @@ func (d *NonResourcePolicyRuleDie) DieFeedPtr(r *flowcontrolv1beta1.NonResourceP return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourcePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourcePolicyRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NonResourcePolicyRuleDie) DieFeedJSON(j []byte) *NonResourcePolicyRuleDie { r := flowcontrolv1beta1.NonResourcePolicyRule{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NonResourcePolicyRuleDie) DieFeedYAML(y []byte) *NonResourcePolicyRuleDie { + r := flowcontrolv1beta1.NonResourcePolicyRule{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NonResourcePolicyRuleDie) DieFeedYAMLFile(name string) *NonResourcePolicyRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourcePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourcePolicyRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NonResourcePolicyRuleDie) DieRelease() flowcontrolv1beta1.NonResourcePolicyRule { if d.mutable { @@ -1271,12 +1843,33 @@ func (d *NonResourcePolicyRuleDie) DieReleasePtr() *flowcontrolv1beta1.NonResour return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourcePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NonResourcePolicyRuleDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NonResourcePolicyRuleDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourcePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1350,14 +1943,42 @@ func (d *PriorityLevelConfigurationDie) DieFeedPtr(r *flowcontrolv1beta1.Priorit return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PriorityLevelConfigurationDie) DieFeedJSON(j []byte) *PriorityLevelConfigurationDie { r := flowcontrolv1beta1.PriorityLevelConfiguration{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PriorityLevelConfigurationDie) DieFeedYAML(y []byte) *PriorityLevelConfigurationDie { + r := flowcontrolv1beta1.PriorityLevelConfiguration{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PriorityLevelConfigurationDie) DieFeedYAMLFile(name string) *PriorityLevelConfigurationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PriorityLevelConfigurationDie) DieRelease() flowcontrolv1beta1.PriorityLevelConfiguration { if d.mutable { @@ -1372,21 +1993,45 @@ func (d *PriorityLevelConfigurationDie) DieReleasePtr() *flowcontrolv1beta1.Prio return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PriorityLevelConfigurationDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PriorityLevelConfigurationDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PriorityLevelConfigurationDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1527,14 +2172,42 @@ func (d *PriorityLevelConfigurationSpecDie) DieFeedPtr(r *flowcontrolv1beta1.Pri return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieFeedJSON(j []byte) *PriorityLevelConfigurationSpecDie { r := flowcontrolv1beta1.PriorityLevelConfigurationSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieFeedYAML(y []byte) *PriorityLevelConfigurationSpecDie { + r := flowcontrolv1beta1.PriorityLevelConfigurationSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieFeedYAMLFile(name string) *PriorityLevelConfigurationSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PriorityLevelConfigurationSpecDie) DieRelease() flowcontrolv1beta1.PriorityLevelConfigurationSpec { if d.mutable { @@ -1549,12 +2222,33 @@ func (d *PriorityLevelConfigurationSpecDie) DieReleasePtr() *flowcontrolv1beta1. return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1625,14 +2319,42 @@ func (d *LimitedPriorityLevelConfigurationDie) DieFeedPtr(r *flowcontrolv1beta1. return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitedPriorityLevelConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitedPriorityLevelConfigurationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieFeedJSON(j []byte) *LimitedPriorityLevelConfigurationDie { r := flowcontrolv1beta1.LimitedPriorityLevelConfiguration{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieFeedYAML(y []byte) *LimitedPriorityLevelConfigurationDie { + r := flowcontrolv1beta1.LimitedPriorityLevelConfiguration{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieFeedYAMLFile(name string) *LimitedPriorityLevelConfigurationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitedPriorityLevelConfigurationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LimitedPriorityLevelConfigurationDie) DieRelease() flowcontrolv1beta1.LimitedPriorityLevelConfiguration { if d.mutable { @@ -1647,12 +2369,33 @@ func (d *LimitedPriorityLevelConfigurationDie) DieReleasePtr() *flowcontrolv1bet return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitedPriorityLevelConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitedPriorityLevelConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1747,14 +2490,42 @@ func (d *LimitResponseDie) DieFeedPtr(r *flowcontrolv1beta1.LimitResponse) *Limi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitResponseDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitResponseDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LimitResponseDie) DieFeedJSON(j []byte) *LimitResponseDie { r := flowcontrolv1beta1.LimitResponse{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LimitResponseDie) DieFeedYAML(y []byte) *LimitResponseDie { + r := flowcontrolv1beta1.LimitResponse{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LimitResponseDie) DieFeedYAMLFile(name string) *LimitResponseDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitResponseDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitResponseDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LimitResponseDie) DieRelease() flowcontrolv1beta1.LimitResponse { if d.mutable { @@ -1769,12 +2540,33 @@ func (d *LimitResponseDie) DieReleasePtr() *flowcontrolv1beta1.LimitResponse { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitResponseDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LimitResponseDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LimitResponseDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitResponseDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1845,14 +2637,42 @@ func (d *QueuingConfigurationDie) DieFeedPtr(r *flowcontrolv1beta1.QueuingConfig return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *QueuingConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *QueuingConfigurationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *QueuingConfigurationDie) DieFeedJSON(j []byte) *QueuingConfigurationDie { r := flowcontrolv1beta1.QueuingConfiguration{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *QueuingConfigurationDie) DieFeedYAML(y []byte) *QueuingConfigurationDie { + r := flowcontrolv1beta1.QueuingConfiguration{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *QueuingConfigurationDie) DieFeedYAMLFile(name string) *QueuingConfigurationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *QueuingConfigurationDie) DieFeedRawExtension(raw runtime.RawExtension) *QueuingConfigurationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *QueuingConfigurationDie) DieRelease() flowcontrolv1beta1.QueuingConfiguration { if d.mutable { @@ -1867,12 +2687,33 @@ func (d *QueuingConfigurationDie) DieReleasePtr() *flowcontrolv1beta1.QueuingCon return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *QueuingConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *QueuingConfigurationDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *QueuingConfigurationDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *QueuingConfigurationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1950,14 +2791,42 @@ func (d *PriorityLevelConfigurationStatusDie) DieFeedPtr(r *flowcontrolv1beta1.P return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieFeedJSON(j []byte) *PriorityLevelConfigurationStatusDie { + r := flowcontrolv1beta1.PriorityLevelConfigurationStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieFeedYAML(y []byte) *PriorityLevelConfigurationStatusDie { r := flowcontrolv1beta1.PriorityLevelConfigurationStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieFeedYAMLFile(name string) *PriorityLevelConfigurationStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityLevelConfigurationStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PriorityLevelConfigurationStatusDie) DieRelease() flowcontrolv1beta1.PriorityLevelConfigurationStatus { if d.mutable { @@ -1972,12 +2841,33 @@ func (d *PriorityLevelConfigurationStatusDie) DieReleasePtr() *flowcontrolv1beta return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityLevelConfigurationStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityLevelConfigurationStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/apps/v1/zz_generated.die.go b/apis/apps/v1/zz_generated.die.go index 6b750e9..7604044 100644 --- a/apis/apps/v1/zz_generated.die.go +++ b/apis/apps/v1/zz_generated.die.go @@ -32,6 +32,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" intstr "k8s.io/apimachinery/pkg/util/intstr" + osx "os" + yaml "sigs.k8s.io/yaml" ) var ControllerRevisionBlank = (&ControllerRevisionDie{}).DieFeed(appsv1.ControllerRevision{}) @@ -74,14 +76,42 @@ func (d *ControllerRevisionDie) DieFeedPtr(r *appsv1.ControllerRevision) *Contro return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ControllerRevisionDie) DieFeedRawExtension(raw runtime.RawExtension) *ControllerRevisionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ControllerRevisionDie) DieFeedJSON(j []byte) *ControllerRevisionDie { + r := appsv1.ControllerRevision{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ControllerRevisionDie) DieFeedYAML(y []byte) *ControllerRevisionDie { r := appsv1.ControllerRevision{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ControllerRevisionDie) DieFeedYAMLFile(name string) *ControllerRevisionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ControllerRevisionDie) DieFeedRawExtension(raw runtime.RawExtension) *ControllerRevisionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ControllerRevisionDie) DieRelease() appsv1.ControllerRevision { if d.mutable { @@ -96,21 +126,45 @@ func (d *ControllerRevisionDie) DieReleasePtr() *appsv1.ControllerRevision { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ControllerRevisionDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ControllerRevisionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ControllerRevisionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ControllerRevisionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ControllerRevisionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -236,14 +290,42 @@ func (d *DaemonSetDie) DieFeedPtr(r *appsv1.DaemonSet) *DaemonSetDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DaemonSetDie) DieFeedJSON(j []byte) *DaemonSetDie { + r := appsv1.DaemonSet{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DaemonSetDie) DieFeedYAML(y []byte) *DaemonSetDie { r := appsv1.DaemonSet{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DaemonSetDie) DieFeedYAMLFile(name string) *DaemonSetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DaemonSetDie) DieRelease() appsv1.DaemonSet { if d.mutable { @@ -258,21 +340,45 @@ func (d *DaemonSetDie) DieReleasePtr() *appsv1.DaemonSet { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *DaemonSetDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DaemonSetDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DaemonSetDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -413,14 +519,42 @@ func (d *DaemonSetSpecDie) DieFeedPtr(r *appsv1.DaemonSetSpec) *DaemonSetSpecDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DaemonSetSpecDie) DieFeedJSON(j []byte) *DaemonSetSpecDie { + r := appsv1.DaemonSetSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DaemonSetSpecDie) DieFeedYAML(y []byte) *DaemonSetSpecDie { r := appsv1.DaemonSetSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DaemonSetSpecDie) DieFeedYAMLFile(name string) *DaemonSetSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DaemonSetSpecDie) DieRelease() appsv1.DaemonSetSpec { if d.mutable { @@ -435,12 +569,33 @@ func (d *DaemonSetSpecDie) DieReleasePtr() *appsv1.DaemonSetSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DaemonSetSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DaemonSetSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -532,14 +687,42 @@ func (d *DaemonSetUpdateStrategyDie) DieFeedPtr(r *appsv1.DaemonSetUpdateStrateg return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetUpdateStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetUpdateStrategyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieFeedJSON(j []byte) *DaemonSetUpdateStrategyDie { + r := appsv1.DaemonSetUpdateStrategy{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieFeedYAML(y []byte) *DaemonSetUpdateStrategyDie { r := appsv1.DaemonSetUpdateStrategy{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieFeedYAMLFile(name string) *DaemonSetUpdateStrategyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetUpdateStrategyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DaemonSetUpdateStrategyDie) DieRelease() appsv1.DaemonSetUpdateStrategy { if d.mutable { @@ -554,12 +737,33 @@ func (d *DaemonSetUpdateStrategyDie) DieReleasePtr() *appsv1.DaemonSetUpdateStra return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetUpdateStrategyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetUpdateStrategyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -630,14 +834,42 @@ func (d *RollingUpdateDaemonSetDie) DieFeedPtr(r *appsv1.RollingUpdateDaemonSet) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateDaemonSetDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateDaemonSetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieFeedJSON(j []byte) *RollingUpdateDaemonSetDie { + r := appsv1.RollingUpdateDaemonSet{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieFeedYAML(y []byte) *RollingUpdateDaemonSetDie { r := appsv1.RollingUpdateDaemonSet{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieFeedYAMLFile(name string) *RollingUpdateDaemonSetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateDaemonSetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RollingUpdateDaemonSetDie) DieRelease() appsv1.RollingUpdateDaemonSet { if d.mutable { @@ -652,12 +884,33 @@ func (d *RollingUpdateDaemonSetDie) DieReleasePtr() *appsv1.RollingUpdateDaemonS return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateDaemonSetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateDaemonSetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -756,14 +1009,42 @@ func (d *DaemonSetStatusDie) DieFeedPtr(r *appsv1.DaemonSetStatus) *DaemonSetSta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DaemonSetStatusDie) DieFeedJSON(j []byte) *DaemonSetStatusDie { r := appsv1.DaemonSetStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DaemonSetStatusDie) DieFeedYAML(y []byte) *DaemonSetStatusDie { + r := appsv1.DaemonSetStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DaemonSetStatusDie) DieFeedYAMLFile(name string) *DaemonSetStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonSetStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DaemonSetStatusDie) DieRelease() appsv1.DaemonSetStatus { if d.mutable { @@ -778,12 +1059,33 @@ func (d *DaemonSetStatusDie) DieReleasePtr() *appsv1.DaemonSetStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DaemonSetStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DaemonSetStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -913,14 +1215,42 @@ func (d *DeploymentDie) DieFeedPtr(r *appsv1.Deployment) *DeploymentDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DeploymentDie) DieFeedJSON(j []byte) *DeploymentDie { + r := appsv1.Deployment{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DeploymentDie) DieFeedYAML(y []byte) *DeploymentDie { r := appsv1.Deployment{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DeploymentDie) DieFeedYAMLFile(name string) *DeploymentDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DeploymentDie) DieRelease() appsv1.Deployment { if d.mutable { @@ -935,21 +1265,45 @@ func (d *DeploymentDie) DieReleasePtr() *appsv1.Deployment { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *DeploymentDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DeploymentDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DeploymentDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1090,14 +1444,42 @@ func (d *DeploymentSpecDie) DieFeedPtr(r *appsv1.DeploymentSpec) *DeploymentSpec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DeploymentSpecDie) DieFeedJSON(j []byte) *DeploymentSpecDie { + r := appsv1.DeploymentSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DeploymentSpecDie) DieFeedYAML(y []byte) *DeploymentSpecDie { r := appsv1.DeploymentSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DeploymentSpecDie) DieFeedYAMLFile(name string) *DeploymentSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DeploymentSpecDie) DieRelease() appsv1.DeploymentSpec { if d.mutable { @@ -1112,12 +1494,33 @@ func (d *DeploymentSpecDie) DieReleasePtr() *appsv1.DeploymentSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DeploymentSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DeploymentSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1230,14 +1633,42 @@ func (d *DeploymentStrategyDie) DieFeedPtr(r *appsv1.DeploymentStrategy) *Deploy return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentStrategyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DeploymentStrategyDie) DieFeedJSON(j []byte) *DeploymentStrategyDie { + r := appsv1.DeploymentStrategy{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DeploymentStrategyDie) DieFeedYAML(y []byte) *DeploymentStrategyDie { r := appsv1.DeploymentStrategy{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DeploymentStrategyDie) DieFeedYAMLFile(name string) *DeploymentStrategyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentStrategyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DeploymentStrategyDie) DieRelease() appsv1.DeploymentStrategy { if d.mutable { @@ -1252,12 +1683,33 @@ func (d *DeploymentStrategyDie) DieReleasePtr() *appsv1.DeploymentStrategy { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentStrategyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DeploymentStrategyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DeploymentStrategyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentStrategyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1328,14 +1780,42 @@ func (d *RollingUpdateDeploymentDie) DieFeedPtr(r *appsv1.RollingUpdateDeploymen return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateDeploymentDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateDeploymentDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RollingUpdateDeploymentDie) DieFeedJSON(j []byte) *RollingUpdateDeploymentDie { r := appsv1.RollingUpdateDeployment{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RollingUpdateDeploymentDie) DieFeedYAML(y []byte) *RollingUpdateDeploymentDie { + r := appsv1.RollingUpdateDeployment{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RollingUpdateDeploymentDie) DieFeedYAMLFile(name string) *RollingUpdateDeploymentDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateDeploymentDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateDeploymentDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RollingUpdateDeploymentDie) DieRelease() appsv1.RollingUpdateDeployment { if d.mutable { @@ -1350,12 +1830,33 @@ func (d *RollingUpdateDeploymentDie) DieReleasePtr() *appsv1.RollingUpdateDeploy return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateDeploymentDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RollingUpdateDeploymentDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RollingUpdateDeploymentDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateDeploymentDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1454,14 +1955,42 @@ func (d *DeploymentStatusDie) DieFeedPtr(r *appsv1.DeploymentStatus) *Deployment return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DeploymentStatusDie) DieFeedJSON(j []byte) *DeploymentStatusDie { r := appsv1.DeploymentStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DeploymentStatusDie) DieFeedYAML(y []byte) *DeploymentStatusDie { + r := appsv1.DeploymentStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DeploymentStatusDie) DieFeedYAMLFile(name string) *DeploymentStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *DeploymentStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DeploymentStatusDie) DieRelease() appsv1.DeploymentStatus { if d.mutable { @@ -1476,12 +2005,33 @@ func (d *DeploymentStatusDie) DieReleasePtr() *appsv1.DeploymentStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DeploymentStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DeploymentStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DeploymentStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DeploymentStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1597,14 +2147,42 @@ func (d *ReplicaSetDie) DieFeedPtr(r *appsv1.ReplicaSet) *ReplicaSetDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicaSetDie) DieFeedJSON(j []byte) *ReplicaSetDie { + r := appsv1.ReplicaSet{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicaSetDie) DieFeedYAML(y []byte) *ReplicaSetDie { r := appsv1.ReplicaSet{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicaSetDie) DieFeedYAMLFile(name string) *ReplicaSetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicaSetDie) DieRelease() appsv1.ReplicaSet { if d.mutable { @@ -1619,21 +2197,45 @@ func (d *ReplicaSetDie) DieReleasePtr() *appsv1.ReplicaSet { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ReplicaSetDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicaSetDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicaSetDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1774,14 +2376,42 @@ func (d *ReplicaSetSpecDie) DieFeedPtr(r *appsv1.ReplicaSetSpec) *ReplicaSetSpec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicaSetSpecDie) DieFeedJSON(j []byte) *ReplicaSetSpecDie { + r := appsv1.ReplicaSetSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicaSetSpecDie) DieFeedYAML(y []byte) *ReplicaSetSpecDie { r := appsv1.ReplicaSetSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicaSetSpecDie) DieFeedYAMLFile(name string) *ReplicaSetSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicaSetSpecDie) DieRelease() appsv1.ReplicaSetSpec { if d.mutable { @@ -1796,12 +2426,33 @@ func (d *ReplicaSetSpecDie) DieReleasePtr() *appsv1.ReplicaSetSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicaSetSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicaSetSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1886,14 +2537,42 @@ func (d *ReplicaSetStatusDie) DieFeedPtr(r *appsv1.ReplicaSetStatus) *ReplicaSet return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicaSetStatusDie) DieFeedJSON(j []byte) *ReplicaSetStatusDie { r := appsv1.ReplicaSetStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicaSetStatusDie) DieFeedYAML(y []byte) *ReplicaSetStatusDie { + r := appsv1.ReplicaSetStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicaSetStatusDie) DieFeedYAMLFile(name string) *ReplicaSetStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicaSetStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicaSetStatusDie) DieRelease() appsv1.ReplicaSetStatus { if d.mutable { @@ -1908,12 +2587,33 @@ func (d *ReplicaSetStatusDie) DieReleasePtr() *appsv1.ReplicaSetStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicaSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicaSetStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicaSetStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicaSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2015,14 +2715,42 @@ func (d *StatefulSetDie) DieFeedPtr(r *appsv1.StatefulSet) *StatefulSetDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetDie) DieFeedJSON(j []byte) *StatefulSetDie { + r := appsv1.StatefulSet{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetDie) DieFeedYAML(y []byte) *StatefulSetDie { r := appsv1.StatefulSet{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetDie) DieFeedYAMLFile(name string) *StatefulSetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetDie) DieRelease() appsv1.StatefulSet { if d.mutable { @@ -2037,21 +2765,45 @@ func (d *StatefulSetDie) DieReleasePtr() *appsv1.StatefulSet { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *StatefulSetDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2192,14 +2944,42 @@ func (d *StatefulSetSpecDie) DieFeedPtr(r *appsv1.StatefulSetSpec) *StatefulSetS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetSpecDie) DieFeedJSON(j []byte) *StatefulSetSpecDie { r := appsv1.StatefulSetSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetSpecDie) DieFeedYAML(y []byte) *StatefulSetSpecDie { + r := appsv1.StatefulSetSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetSpecDie) DieFeedYAMLFile(name string) *StatefulSetSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetSpecDie) DieRelease() appsv1.StatefulSetSpec { if d.mutable { @@ -2214,12 +2994,33 @@ func (d *StatefulSetSpecDie) DieReleasePtr() *appsv1.StatefulSetSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2353,14 +3154,42 @@ func (d *StatefulSetUpdateStrategyDie) DieFeedPtr(r *appsv1.StatefulSetUpdateStr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetUpdateStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetUpdateStrategyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieFeedJSON(j []byte) *StatefulSetUpdateStrategyDie { r := appsv1.StatefulSetUpdateStrategy{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieFeedYAML(y []byte) *StatefulSetUpdateStrategyDie { + r := appsv1.StatefulSetUpdateStrategy{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieFeedYAMLFile(name string) *StatefulSetUpdateStrategyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetUpdateStrategyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetUpdateStrategyDie) DieRelease() appsv1.StatefulSetUpdateStrategy { if d.mutable { @@ -2375,12 +3204,33 @@ func (d *StatefulSetUpdateStrategyDie) DieReleasePtr() *appsv1.StatefulSetUpdate return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetUpdateStrategyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetUpdateStrategyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2451,14 +3301,42 @@ func (d *RollingUpdateStatefulSetStrategyDie) DieFeedPtr(r *appsv1.RollingUpdate return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateStatefulSetStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateStatefulSetStrategyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieFeedJSON(j []byte) *RollingUpdateStatefulSetStrategyDie { r := appsv1.RollingUpdateStatefulSetStrategy{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieFeedYAML(y []byte) *RollingUpdateStatefulSetStrategyDie { + r := appsv1.RollingUpdateStatefulSetStrategy{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieFeedYAMLFile(name string) *RollingUpdateStatefulSetStrategyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieFeedRawExtension(raw runtime.RawExtension) *RollingUpdateStatefulSetStrategyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RollingUpdateStatefulSetStrategyDie) DieRelease() appsv1.RollingUpdateStatefulSetStrategy { if d.mutable { @@ -2473,12 +3351,33 @@ func (d *RollingUpdateStatefulSetStrategyDie) DieReleasePtr() *appsv1.RollingUpd return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RollingUpdateStatefulSetStrategyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RollingUpdateStatefulSetStrategyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2563,14 +3462,42 @@ func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedPtr(r *appsv return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetPersistentVolumeClaimRetentionPolicyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedJSON(j []byte) *StatefulSetPersistentVolumeClaimRetentionPolicyDie { r := appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedYAML(y []byte) *StatefulSetPersistentVolumeClaimRetentionPolicyDie { + r := appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedYAMLFile(name string) *StatefulSetPersistentVolumeClaimRetentionPolicyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetPersistentVolumeClaimRetentionPolicyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieRelease() appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy { if d.mutable { @@ -2585,12 +3512,33 @@ func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieReleasePtr() *ap return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetPersistentVolumeClaimRetentionPolicyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2661,14 +3609,42 @@ func (d *StatefulSetOrdinalsDie) DieFeedPtr(r *appsv1.StatefulSetOrdinals) *Stat return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetOrdinalsDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetOrdinalsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetOrdinalsDie) DieFeedJSON(j []byte) *StatefulSetOrdinalsDie { r := appsv1.StatefulSetOrdinals{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetOrdinalsDie) DieFeedYAML(y []byte) *StatefulSetOrdinalsDie { + r := appsv1.StatefulSetOrdinals{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetOrdinalsDie) DieFeedYAMLFile(name string) *StatefulSetOrdinalsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetOrdinalsDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetOrdinalsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetOrdinalsDie) DieRelease() appsv1.StatefulSetOrdinals { if d.mutable { @@ -2683,12 +3659,33 @@ func (d *StatefulSetOrdinalsDie) DieReleasePtr() *appsv1.StatefulSetOrdinals { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetOrdinalsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetOrdinalsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetOrdinalsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetOrdinalsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2752,14 +3749,42 @@ func (d *StatefulSetStatusDie) DieFeedPtr(r *appsv1.StatefulSetStatus) *Stateful return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatefulSetStatusDie) DieFeedJSON(j []byte) *StatefulSetStatusDie { r := appsv1.StatefulSetStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatefulSetStatusDie) DieFeedYAML(y []byte) *StatefulSetStatusDie { + r := appsv1.StatefulSetStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatefulSetStatusDie) DieFeedYAMLFile(name string) *StatefulSetStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *StatefulSetStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatefulSetStatusDie) DieRelease() appsv1.StatefulSetStatus { if d.mutable { @@ -2774,12 +3799,33 @@ func (d *StatefulSetStatusDie) DieReleasePtr() *appsv1.StatefulSetStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatefulSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatefulSetStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatefulSetStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatefulSetStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/authentication/v1/zz_generated.die.go b/apis/authentication/v1/zz_generated.die.go index 75abb04..d8ddbd7 100644 --- a/apis/authentication/v1/zz_generated.die.go +++ b/apis/authentication/v1/zz_generated.die.go @@ -31,6 +31,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" + osx "os" + yaml "sigs.k8s.io/yaml" ) var TokenReviewBlank = (&TokenReviewDie{}).DieFeed(authenticationv1.TokenReview{}) @@ -73,14 +75,42 @@ func (d *TokenReviewDie) DieFeedPtr(r *authenticationv1.TokenReview) *TokenRevie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TokenReviewDie) DieFeedJSON(j []byte) *TokenReviewDie { + r := authenticationv1.TokenReview{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TokenReviewDie) DieFeedYAML(y []byte) *TokenReviewDie { r := authenticationv1.TokenReview{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TokenReviewDie) DieFeedYAMLFile(name string) *TokenReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TokenReviewDie) DieRelease() authenticationv1.TokenReview { if d.mutable { @@ -95,21 +125,45 @@ func (d *TokenReviewDie) DieReleasePtr() *authenticationv1.TokenReview { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *TokenReviewDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TokenReviewDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TokenReviewDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -232,14 +286,42 @@ func (d *TokenRequestSpecDie) DieFeedPtr(r *authenticationv1.TokenRequestSpec) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TokenRequestSpecDie) DieFeedJSON(j []byte) *TokenRequestSpecDie { r := authenticationv1.TokenRequestSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TokenRequestSpecDie) DieFeedYAML(y []byte) *TokenRequestSpecDie { + r := authenticationv1.TokenRequestSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TokenRequestSpecDie) DieFeedYAMLFile(name string) *TokenRequestSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TokenRequestSpecDie) DieRelease() authenticationv1.TokenRequestSpec { if d.mutable { @@ -254,12 +336,33 @@ func (d *TokenRequestSpecDie) DieReleasePtr() *authenticationv1.TokenRequestSpec return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TokenRequestSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TokenRequestSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -337,14 +440,42 @@ func (d *BoundObjectReferenceDie) DieFeedPtr(r *authenticationv1.BoundObjectRefe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *BoundObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *BoundObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *BoundObjectReferenceDie) DieFeedJSON(j []byte) *BoundObjectReferenceDie { r := authenticationv1.BoundObjectReference{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *BoundObjectReferenceDie) DieFeedYAML(y []byte) *BoundObjectReferenceDie { + r := authenticationv1.BoundObjectReference{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *BoundObjectReferenceDie) DieFeedYAMLFile(name string) *BoundObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *BoundObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *BoundObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *BoundObjectReferenceDie) DieRelease() authenticationv1.BoundObjectReference { if d.mutable { @@ -359,12 +490,33 @@ func (d *BoundObjectReferenceDie) DieReleasePtr() *authenticationv1.BoundObjectR return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *BoundObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *BoundObjectReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *BoundObjectReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *BoundObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -449,14 +601,42 @@ func (d *TokenRequestStatusDie) DieFeedPtr(r *authenticationv1.TokenRequestStatu return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TokenRequestStatusDie) DieFeedJSON(j []byte) *TokenRequestStatusDie { + r := authenticationv1.TokenRequestStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TokenRequestStatusDie) DieFeedYAML(y []byte) *TokenRequestStatusDie { r := authenticationv1.TokenRequestStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TokenRequestStatusDie) DieFeedYAMLFile(name string) *TokenRequestStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TokenRequestStatusDie) DieRelease() authenticationv1.TokenRequestStatus { if d.mutable { @@ -471,12 +651,33 @@ func (d *TokenRequestStatusDie) DieReleasePtr() *authenticationv1.TokenRequestSt return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TokenRequestStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TokenRequestStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -547,14 +748,42 @@ func (d *UserInfoDie) DieFeedPtr(r *authenticationv1.UserInfo) *UserInfoDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *UserInfoDie) DieFeedRawExtension(raw runtime.RawExtension) *UserInfoDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *UserInfoDie) DieFeedJSON(j []byte) *UserInfoDie { r := authenticationv1.UserInfo{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *UserInfoDie) DieFeedYAML(y []byte) *UserInfoDie { + r := authenticationv1.UserInfo{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *UserInfoDie) DieFeedYAMLFile(name string) *UserInfoDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UserInfoDie) DieFeedRawExtension(raw runtime.RawExtension) *UserInfoDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *UserInfoDie) DieRelease() authenticationv1.UserInfo { if d.mutable { @@ -569,12 +798,33 @@ func (d *UserInfoDie) DieReleasePtr() *authenticationv1.UserInfo { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *UserInfoDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *UserInfoDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *UserInfoDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UserInfoDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/authorization/rbac/v1/zz_generated.die.go b/apis/authorization/rbac/v1/zz_generated.die.go index 2f28d39..ccfdaf2 100644 --- a/apis/authorization/rbac/v1/zz_generated.die.go +++ b/apis/authorization/rbac/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var ClusterRoleBlank = (&ClusterRoleDie{}).DieFeed(rbacv1.ClusterRole{}) @@ -72,14 +74,42 @@ func (d *ClusterRoleDie) DieFeedPtr(r *rbacv1.ClusterRole) *ClusterRoleDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ClusterRoleDie) DieFeedRawExtension(raw runtime.RawExtension) *ClusterRoleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ClusterRoleDie) DieFeedJSON(j []byte) *ClusterRoleDie { r := rbacv1.ClusterRole{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ClusterRoleDie) DieFeedYAML(y []byte) *ClusterRoleDie { + r := rbacv1.ClusterRole{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ClusterRoleDie) DieFeedYAMLFile(name string) *ClusterRoleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClusterRoleDie) DieFeedRawExtension(raw runtime.RawExtension) *ClusterRoleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ClusterRoleDie) DieRelease() rbacv1.ClusterRole { if d.mutable { @@ -94,21 +124,45 @@ func (d *ClusterRoleDie) DieReleasePtr() *rbacv1.ClusterRole { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ClusterRoleDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ClusterRoleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ClusterRoleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ClusterRoleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClusterRoleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -231,14 +285,42 @@ func (d *AggregationRuleDie) DieFeedPtr(r *rbacv1.AggregationRule) *AggregationR return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AggregationRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *AggregationRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AggregationRuleDie) DieFeedJSON(j []byte) *AggregationRuleDie { + r := rbacv1.AggregationRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AggregationRuleDie) DieFeedYAML(y []byte) *AggregationRuleDie { r := rbacv1.AggregationRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AggregationRuleDie) DieFeedYAMLFile(name string) *AggregationRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AggregationRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *AggregationRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AggregationRuleDie) DieRelease() rbacv1.AggregationRule { if d.mutable { @@ -253,12 +335,33 @@ func (d *AggregationRuleDie) DieReleasePtr() *rbacv1.AggregationRule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AggregationRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AggregationRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AggregationRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AggregationRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -325,14 +428,42 @@ func (d *ClusterRoleBindingDie) DieFeedPtr(r *rbacv1.ClusterRoleBinding) *Cluste return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ClusterRoleBindingDie) DieFeedRawExtension(raw runtime.RawExtension) *ClusterRoleBindingDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ClusterRoleBindingDie) DieFeedJSON(j []byte) *ClusterRoleBindingDie { r := rbacv1.ClusterRoleBinding{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ClusterRoleBindingDie) DieFeedYAML(y []byte) *ClusterRoleBindingDie { + r := rbacv1.ClusterRoleBinding{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ClusterRoleBindingDie) DieFeedYAMLFile(name string) *ClusterRoleBindingDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClusterRoleBindingDie) DieFeedRawExtension(raw runtime.RawExtension) *ClusterRoleBindingDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ClusterRoleBindingDie) DieRelease() rbacv1.ClusterRoleBinding { if d.mutable { @@ -347,21 +478,45 @@ func (d *ClusterRoleBindingDie) DieReleasePtr() *rbacv1.ClusterRoleBinding { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ClusterRoleBindingDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ClusterRoleBindingDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ClusterRoleBindingDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ClusterRoleBindingDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClusterRoleBindingDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -487,14 +642,42 @@ func (d *RoleDie) DieFeedPtr(r *rbacv1.Role) *RoleDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RoleDie) DieFeedJSON(j []byte) *RoleDie { + r := rbacv1.Role{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RoleDie) DieFeedYAML(y []byte) *RoleDie { r := rbacv1.Role{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RoleDie) DieFeedYAMLFile(name string) *RoleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RoleDie) DieRelease() rbacv1.Role { if d.mutable { @@ -509,21 +692,45 @@ func (d *RoleDie) DieReleasePtr() *rbacv1.Role { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *RoleDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RoleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RoleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -639,14 +846,42 @@ func (d *PolicyRuleDie) DieFeedPtr(r *rbacv1.PolicyRule) *PolicyRuleDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *PolicyRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PolicyRuleDie) DieFeedJSON(j []byte) *PolicyRuleDie { r := rbacv1.PolicyRule{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PolicyRuleDie) DieFeedYAML(y []byte) *PolicyRuleDie { + r := rbacv1.PolicyRule{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PolicyRuleDie) DieFeedYAMLFile(name string) *PolicyRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *PolicyRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PolicyRuleDie) DieRelease() rbacv1.PolicyRule { if d.mutable { @@ -661,12 +896,33 @@ func (d *PolicyRuleDie) DieReleasePtr() *rbacv1.PolicyRule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PolicyRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PolicyRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -761,14 +1017,42 @@ func (d *RoleBindingDie) DieFeedPtr(r *rbacv1.RoleBinding) *RoleBindingDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleBindingDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleBindingDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RoleBindingDie) DieFeedJSON(j []byte) *RoleBindingDie { + r := rbacv1.RoleBinding{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RoleBindingDie) DieFeedYAML(y []byte) *RoleBindingDie { r := rbacv1.RoleBinding{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RoleBindingDie) DieFeedYAMLFile(name string) *RoleBindingDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleBindingDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleBindingDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RoleBindingDie) DieRelease() rbacv1.RoleBinding { if d.mutable { @@ -783,21 +1067,45 @@ func (d *RoleBindingDie) DieReleasePtr() *rbacv1.RoleBinding { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *RoleBindingDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleBindingDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RoleBindingDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RoleBindingDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleBindingDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -920,14 +1228,42 @@ func (d *SubjectDie) DieFeedPtr(r *rbacv1.Subject) *SubjectDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectDie) DieFeedJSON(j []byte) *SubjectDie { r := rbacv1.Subject{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectDie) DieFeedYAML(y []byte) *SubjectDie { + r := rbacv1.Subject{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectDie) DieFeedYAMLFile(name string) *SubjectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectDie) DieRelease() rbacv1.Subject { if d.mutable { @@ -942,12 +1278,33 @@ func (d *SubjectDie) DieReleasePtr() *rbacv1.Subject { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1032,14 +1389,42 @@ func (d *RoleRefDie) DieFeedPtr(r *rbacv1.RoleRef) *RoleRefDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleRefDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleRefDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RoleRefDie) DieFeedJSON(j []byte) *RoleRefDie { + r := rbacv1.RoleRef{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RoleRefDie) DieFeedYAML(y []byte) *RoleRefDie { r := rbacv1.RoleRef{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RoleRefDie) DieFeedYAMLFile(name string) *RoleRefDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleRefDie) DieFeedRawExtension(raw runtime.RawExtension) *RoleRefDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RoleRefDie) DieRelease() rbacv1.RoleRef { if d.mutable { @@ -1054,12 +1439,33 @@ func (d *RoleRefDie) DieReleasePtr() *rbacv1.RoleRef { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RoleRefDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RoleRefDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RoleRefDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RoleRefDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/authorization/v1/zz_generated.die.go b/apis/authorization/v1/zz_generated.die.go index 6e73fa0..1795a07 100644 --- a/apis/authorization/v1/zz_generated.die.go +++ b/apis/authorization/v1/zz_generated.die.go @@ -29,6 +29,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var LocalSubjectAccessReviewBlank = (&LocalSubjectAccessReviewDie{}).DieFeed(authorizationv1.LocalSubjectAccessReview{}) @@ -71,14 +73,42 @@ func (d *LocalSubjectAccessReviewDie) DieFeedPtr(r *authorizationv1.LocalSubject return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LocalSubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *LocalSubjectAccessReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieFeedJSON(j []byte) *LocalSubjectAccessReviewDie { + r := authorizationv1.LocalSubjectAccessReview{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieFeedYAML(y []byte) *LocalSubjectAccessReviewDie { r := authorizationv1.LocalSubjectAccessReview{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieFeedYAMLFile(name string) *LocalSubjectAccessReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *LocalSubjectAccessReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LocalSubjectAccessReviewDie) DieRelease() authorizationv1.LocalSubjectAccessReview { if d.mutable { @@ -93,21 +123,45 @@ func (d *LocalSubjectAccessReviewDie) DieReleasePtr() *authorizationv1.LocalSubj return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *LocalSubjectAccessReviewDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LocalSubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LocalSubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -233,14 +287,42 @@ func (d *SelfSubjectAccessReviewDie) DieFeedPtr(r *authorizationv1.SelfSubjectAc return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectAccessReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieFeedJSON(j []byte) *SelfSubjectAccessReviewDie { + r := authorizationv1.SelfSubjectAccessReview{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieFeedYAML(y []byte) *SelfSubjectAccessReviewDie { r := authorizationv1.SelfSubjectAccessReview{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieFeedYAMLFile(name string) *SelfSubjectAccessReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectAccessReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SelfSubjectAccessReviewDie) DieRelease() authorizationv1.SelfSubjectAccessReview { if d.mutable { @@ -255,21 +337,45 @@ func (d *SelfSubjectAccessReviewDie) DieReleasePtr() *authorizationv1.SelfSubjec return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *SelfSubjectAccessReviewDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -410,14 +516,42 @@ func (d *SelfSubjectAccessReviewSpecDie) DieFeedPtr(r *authorizationv1.SelfSubje return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectAccessReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectAccessReviewSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieFeedJSON(j []byte) *SelfSubjectAccessReviewSpecDie { + r := authorizationv1.SelfSubjectAccessReviewSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieFeedYAML(y []byte) *SelfSubjectAccessReviewSpecDie { r := authorizationv1.SelfSubjectAccessReviewSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieFeedYAMLFile(name string) *SelfSubjectAccessReviewSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectAccessReviewSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SelfSubjectAccessReviewSpecDie) DieRelease() authorizationv1.SelfSubjectAccessReviewSpec { if d.mutable { @@ -432,12 +566,33 @@ func (d *SelfSubjectAccessReviewSpecDie) DieReleasePtr() *authorizationv1.SelfSu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectAccessReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectAccessReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -511,14 +666,42 @@ func (d *SelfSubjectRulesReviewDie) DieFeedPtr(r *authorizationv1.SelfSubjectRul return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectRulesReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectRulesReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieFeedJSON(j []byte) *SelfSubjectRulesReviewDie { + r := authorizationv1.SelfSubjectRulesReview{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieFeedYAML(y []byte) *SelfSubjectRulesReviewDie { r := authorizationv1.SelfSubjectRulesReview{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieFeedYAMLFile(name string) *SelfSubjectRulesReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectRulesReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SelfSubjectRulesReviewDie) DieRelease() authorizationv1.SelfSubjectRulesReview { if d.mutable { @@ -533,21 +716,45 @@ func (d *SelfSubjectRulesReviewDie) DieReleasePtr() *authorizationv1.SelfSubject return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *SelfSubjectRulesReviewDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectRulesReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectRulesReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -688,14 +895,42 @@ func (d *SelfSubjectRulesReviewSpecDie) DieFeedPtr(r *authorizationv1.SelfSubjec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectRulesReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectRulesReviewSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieFeedJSON(j []byte) *SelfSubjectRulesReviewSpecDie { + r := authorizationv1.SelfSubjectRulesReviewSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieFeedYAML(y []byte) *SelfSubjectRulesReviewSpecDie { r := authorizationv1.SelfSubjectRulesReviewSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieFeedYAMLFile(name string) *SelfSubjectRulesReviewSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SelfSubjectRulesReviewSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SelfSubjectRulesReviewSpecDie) DieRelease() authorizationv1.SelfSubjectRulesReviewSpec { if d.mutable { @@ -710,12 +945,33 @@ func (d *SelfSubjectRulesReviewSpecDie) DieReleasePtr() *authorizationv1.SelfSub return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SelfSubjectRulesReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SelfSubjectRulesReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -779,14 +1035,42 @@ func (d *SubjectRulesReviewStatusDie) DieFeedPtr(r *authorizationv1.SubjectRules return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectRulesReviewStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectRulesReviewStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieFeedJSON(j []byte) *SubjectRulesReviewStatusDie { + r := authorizationv1.SubjectRulesReviewStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieFeedYAML(y []byte) *SubjectRulesReviewStatusDie { r := authorizationv1.SubjectRulesReviewStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieFeedYAMLFile(name string) *SubjectRulesReviewStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectRulesReviewStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectRulesReviewStatusDie) DieRelease() authorizationv1.SubjectRulesReviewStatus { if d.mutable { @@ -801,12 +1085,33 @@ func (d *SubjectRulesReviewStatusDie) DieReleasePtr() *authorizationv1.SubjectRu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectRulesReviewStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectRulesReviewStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -891,14 +1196,42 @@ func (d *ResourceRuleDie) DieFeedPtr(r *authorizationv1.ResourceRule) *ResourceR return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceRuleDie) DieFeedJSON(j []byte) *ResourceRuleDie { r := authorizationv1.ResourceRule{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceRuleDie) DieFeedYAML(y []byte) *ResourceRuleDie { + r := authorizationv1.ResourceRule{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceRuleDie) DieFeedYAMLFile(name string) *ResourceRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceRuleDie) DieRelease() authorizationv1.ResourceRule { if d.mutable { @@ -913,12 +1246,33 @@ func (d *ResourceRuleDie) DieReleasePtr() *authorizationv1.ResourceRule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1003,14 +1357,42 @@ func (d *NonResourceRuleDie) DieFeedPtr(r *authorizationv1.NonResourceRule) *Non return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourceRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourceRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NonResourceRuleDie) DieFeedJSON(j []byte) *NonResourceRuleDie { + r := authorizationv1.NonResourceRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NonResourceRuleDie) DieFeedYAML(y []byte) *NonResourceRuleDie { r := authorizationv1.NonResourceRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NonResourceRuleDie) DieFeedYAMLFile(name string) *NonResourceRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourceRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourceRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NonResourceRuleDie) DieRelease() authorizationv1.NonResourceRule { if d.mutable { @@ -1025,12 +1407,33 @@ func (d *NonResourceRuleDie) DieReleasePtr() *authorizationv1.NonResourceRule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourceRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NonResourceRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NonResourceRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourceRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1104,14 +1507,42 @@ func (d *SubjectAccessReviewDie) DieFeedPtr(r *authorizationv1.SubjectAccessRevi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectAccessReviewDie) DieFeedJSON(j []byte) *SubjectAccessReviewDie { r := authorizationv1.SubjectAccessReview{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectAccessReviewDie) DieFeedYAML(y []byte) *SubjectAccessReviewDie { + r := authorizationv1.SubjectAccessReview{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectAccessReviewDie) DieFeedYAMLFile(name string) *SubjectAccessReviewDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectAccessReviewDie) DieRelease() authorizationv1.SubjectAccessReview { if d.mutable { @@ -1126,21 +1557,45 @@ func (d *SubjectAccessReviewDie) DieReleasePtr() *authorizationv1.SubjectAccessR return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *SubjectAccessReviewDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectAccessReviewDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectAccessReviewDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1281,14 +1736,42 @@ func (d *SubjectAccessReviewSpecDie) DieFeedPtr(r *authorizationv1.SubjectAccess return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieFeedJSON(j []byte) *SubjectAccessReviewSpecDie { + r := authorizationv1.SubjectAccessReviewSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieFeedYAML(y []byte) *SubjectAccessReviewSpecDie { r := authorizationv1.SubjectAccessReviewSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieFeedYAMLFile(name string) *SubjectAccessReviewSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectAccessReviewSpecDie) DieRelease() authorizationv1.SubjectAccessReviewSpec { if d.mutable { @@ -1303,12 +1786,33 @@ func (d *SubjectAccessReviewSpecDie) DieReleasePtr() *authorizationv1.SubjectAcc return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1400,14 +1904,42 @@ func (d *ResourceAttributesDie) DieFeedPtr(r *authorizationv1.ResourceAttributes return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceAttributesDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceAttributesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceAttributesDie) DieFeedJSON(j []byte) *ResourceAttributesDie { + r := authorizationv1.ResourceAttributes{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceAttributesDie) DieFeedYAML(y []byte) *ResourceAttributesDie { r := authorizationv1.ResourceAttributes{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceAttributesDie) DieFeedYAMLFile(name string) *ResourceAttributesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceAttributesDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceAttributesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceAttributesDie) DieRelease() authorizationv1.ResourceAttributes { if d.mutable { @@ -1422,12 +1954,33 @@ func (d *ResourceAttributesDie) DieReleasePtr() *authorizationv1.ResourceAttribu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceAttributesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceAttributesDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceAttributesDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceAttributesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1533,14 +2086,42 @@ func (d *NonResourceAttributesDie) DieFeedPtr(r *authorizationv1.NonResourceAttr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourceAttributesDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourceAttributesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NonResourceAttributesDie) DieFeedJSON(j []byte) *NonResourceAttributesDie { + r := authorizationv1.NonResourceAttributes{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NonResourceAttributesDie) DieFeedYAML(y []byte) *NonResourceAttributesDie { r := authorizationv1.NonResourceAttributes{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NonResourceAttributesDie) DieFeedYAMLFile(name string) *NonResourceAttributesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourceAttributesDie) DieFeedRawExtension(raw runtime.RawExtension) *NonResourceAttributesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NonResourceAttributesDie) DieRelease() authorizationv1.NonResourceAttributes { if d.mutable { @@ -1555,12 +2136,33 @@ func (d *NonResourceAttributesDie) DieReleasePtr() *authorizationv1.NonResourceA return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NonResourceAttributesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NonResourceAttributesDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NonResourceAttributesDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NonResourceAttributesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1631,14 +2233,42 @@ func (d *SubjectAccessReviewStatusDie) DieFeedPtr(r *authorizationv1.SubjectAcce return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieFeedJSON(j []byte) *SubjectAccessReviewStatusDie { r := authorizationv1.SubjectAccessReviewStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieFeedYAML(y []byte) *SubjectAccessReviewStatusDie { + r := authorizationv1.SubjectAccessReviewStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieFeedYAMLFile(name string) *SubjectAccessReviewStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *SubjectAccessReviewStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SubjectAccessReviewStatusDie) DieRelease() authorizationv1.SubjectAccessReviewStatus { if d.mutable { @@ -1653,12 +2283,33 @@ func (d *SubjectAccessReviewStatusDie) DieReleasePtr() *authorizationv1.SubjectA return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SubjectAccessReviewStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SubjectAccessReviewStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/autoscaling/v1/zz_generated.die.go b/apis/autoscaling/v1/zz_generated.die.go index dde086c..aae4f61 100644 --- a/apis/autoscaling/v1/zz_generated.die.go +++ b/apis/autoscaling/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var HorizontalPodAutoscalerBlank = (&HorizontalPodAutoscalerDie{}).DieFeed(autoscalingv1.HorizontalPodAutoscaler{}) @@ -72,14 +74,42 @@ func (d *HorizontalPodAutoscalerDie) DieFeedPtr(r *autoscalingv1.HorizontalPodAu return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieFeedJSON(j []byte) *HorizontalPodAutoscalerDie { r := autoscalingv1.HorizontalPodAutoscaler{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieFeedYAML(y []byte) *HorizontalPodAutoscalerDie { + r := autoscalingv1.HorizontalPodAutoscaler{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieFeedYAMLFile(name string) *HorizontalPodAutoscalerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HorizontalPodAutoscalerDie) DieRelease() autoscalingv1.HorizontalPodAutoscaler { if d.mutable { @@ -94,21 +124,45 @@ func (d *HorizontalPodAutoscalerDie) DieReleasePtr() *autoscalingv1.HorizontalPo return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *HorizontalPodAutoscalerDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -249,14 +303,42 @@ func (d *HorizontalPodAutoscalerSpecDie) DieFeedPtr(r *autoscalingv1.HorizontalP return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieFeedJSON(j []byte) *HorizontalPodAutoscalerSpecDie { + r := autoscalingv1.HorizontalPodAutoscalerSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieFeedYAML(y []byte) *HorizontalPodAutoscalerSpecDie { r := autoscalingv1.HorizontalPodAutoscalerSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieFeedYAMLFile(name string) *HorizontalPodAutoscalerSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HorizontalPodAutoscalerSpecDie) DieRelease() autoscalingv1.HorizontalPodAutoscalerSpec { if d.mutable { @@ -271,12 +353,33 @@ func (d *HorizontalPodAutoscalerSpecDie) DieReleasePtr() *autoscalingv1.Horizont return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -361,14 +464,42 @@ func (d *CrossVersionObjectReferenceDie) DieFeedPtr(r *autoscalingv1.CrossVersio return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CrossVersionObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *CrossVersionObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieFeedJSON(j []byte) *CrossVersionObjectReferenceDie { + r := autoscalingv1.CrossVersionObjectReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieFeedYAML(y []byte) *CrossVersionObjectReferenceDie { r := autoscalingv1.CrossVersionObjectReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieFeedYAMLFile(name string) *CrossVersionObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *CrossVersionObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CrossVersionObjectReferenceDie) DieRelease() autoscalingv1.CrossVersionObjectReference { if d.mutable { @@ -383,12 +514,33 @@ func (d *CrossVersionObjectReferenceDie) DieReleasePtr() *autoscalingv1.CrossVer return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CrossVersionObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CrossVersionObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -466,14 +618,42 @@ func (d *HorizontalPodAutoscalerStatusDie) DieFeedPtr(r *autoscalingv1.Horizonta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieFeedJSON(j []byte) *HorizontalPodAutoscalerStatusDie { + r := autoscalingv1.HorizontalPodAutoscalerStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieFeedYAML(y []byte) *HorizontalPodAutoscalerStatusDie { r := autoscalingv1.HorizontalPodAutoscalerStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieFeedYAMLFile(name string) *HorizontalPodAutoscalerStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *HorizontalPodAutoscalerStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HorizontalPodAutoscalerStatusDie) DieRelease() autoscalingv1.HorizontalPodAutoscalerStatus { if d.mutable { @@ -488,12 +668,33 @@ func (d *HorizontalPodAutoscalerStatusDie) DieReleasePtr() *autoscalingv1.Horizo return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HorizontalPodAutoscalerStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HorizontalPodAutoscalerStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/batch/v1/zz_generated.die.go b/apis/batch/v1/zz_generated.die.go index 18e5219..73b09a4 100644 --- a/apis/batch/v1/zz_generated.die.go +++ b/apis/batch/v1/zz_generated.die.go @@ -32,6 +32,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" + osx "os" + yaml "sigs.k8s.io/yaml" ) var CronJobBlank = (&CronJobDie{}).DieFeed(batchv1.CronJob{}) @@ -74,14 +76,42 @@ func (d *CronJobDie) DieFeedPtr(r *batchv1.CronJob) *CronJobDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CronJobDie) DieFeedJSON(j []byte) *CronJobDie { r := batchv1.CronJob{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CronJobDie) DieFeedYAML(y []byte) *CronJobDie { + r := batchv1.CronJob{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CronJobDie) DieFeedYAMLFile(name string) *CronJobDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CronJobDie) DieRelease() batchv1.CronJob { if d.mutable { @@ -96,21 +126,45 @@ func (d *CronJobDie) DieReleasePtr() *batchv1.CronJob { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CronJobDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CronJobDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CronJobDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -251,14 +305,42 @@ func (d *CronJobSpecDie) DieFeedPtr(r *batchv1.CronJobSpec) *CronJobSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CronJobSpecDie) DieFeedJSON(j []byte) *CronJobSpecDie { r := batchv1.CronJobSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CronJobSpecDie) DieFeedYAML(y []byte) *CronJobSpecDie { + r := batchv1.CronJobSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CronJobSpecDie) DieFeedYAMLFile(name string) *CronJobSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CronJobSpecDie) DieRelease() batchv1.CronJobSpec { if d.mutable { @@ -273,12 +355,33 @@ func (d *CronJobSpecDie) DieReleasePtr() *batchv1.CronJobSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CronJobSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CronJobSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -391,14 +494,42 @@ func (d *CronJobStatusDie) DieFeedPtr(r *batchv1.CronJobStatus) *CronJobStatusDi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CronJobStatusDie) DieFeedJSON(j []byte) *CronJobStatusDie { r := batchv1.CronJobStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CronJobStatusDie) DieFeedYAML(y []byte) *CronJobStatusDie { + r := batchv1.CronJobStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CronJobStatusDie) DieFeedYAMLFile(name string) *CronJobStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CronJobStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CronJobStatusDie) DieRelease() batchv1.CronJobStatus { if d.mutable { @@ -413,12 +544,33 @@ func (d *CronJobStatusDie) DieReleasePtr() *batchv1.CronJobStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CronJobStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CronJobStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CronJobStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CronJobStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -499,14 +651,42 @@ func (d *JobDie) DieFeedPtr(r *batchv1.Job) *JobDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *JobDie) DieFeedRawExtension(raw runtime.RawExtension) *JobDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *JobDie) DieFeedJSON(j []byte) *JobDie { r := batchv1.Job{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *JobDie) DieFeedYAML(y []byte) *JobDie { + r := batchv1.Job{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *JobDie) DieFeedYAMLFile(name string) *JobDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobDie) DieFeedRawExtension(raw runtime.RawExtension) *JobDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *JobDie) DieRelease() batchv1.Job { if d.mutable { @@ -521,21 +701,45 @@ func (d *JobDie) DieReleasePtr() *batchv1.Job { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *JobDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *JobDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *JobDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *JobDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -676,14 +880,42 @@ func (d *JobSpecDie) DieFeedPtr(r *batchv1.JobSpec) *JobSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *JobSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *JobSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *JobSpecDie) DieFeedJSON(j []byte) *JobSpecDie { + r := batchv1.JobSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *JobSpecDie) DieFeedYAML(y []byte) *JobSpecDie { r := batchv1.JobSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *JobSpecDie) DieFeedYAMLFile(name string) *JobSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *JobSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *JobSpecDie) DieRelease() batchv1.JobSpec { if d.mutable { @@ -698,12 +930,33 @@ func (d *JobSpecDie) DieReleasePtr() *batchv1.JobSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *JobSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *JobSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *JobSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -845,14 +1098,42 @@ func (d *PodFailurePolicyDie) DieFeedPtr(r *batchv1.PodFailurePolicy) *PodFailur return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodFailurePolicyDie) DieFeedJSON(j []byte) *PodFailurePolicyDie { + r := batchv1.PodFailurePolicy{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodFailurePolicyDie) DieFeedYAML(y []byte) *PodFailurePolicyDie { r := batchv1.PodFailurePolicy{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodFailurePolicyDie) DieFeedYAMLFile(name string) *PodFailurePolicyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodFailurePolicyDie) DieRelease() batchv1.PodFailurePolicy { if d.mutable { @@ -867,12 +1148,33 @@ func (d *PodFailurePolicyDie) DieReleasePtr() *batchv1.PodFailurePolicy { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodFailurePolicyDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodFailurePolicyDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -936,14 +1238,42 @@ func (d *PodFailurePolicyRuleDie) DieFeedPtr(r *batchv1.PodFailurePolicyRule) *P return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodFailurePolicyRuleDie) DieFeedJSON(j []byte) *PodFailurePolicyRuleDie { + r := batchv1.PodFailurePolicyRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodFailurePolicyRuleDie) DieFeedYAML(y []byte) *PodFailurePolicyRuleDie { r := batchv1.PodFailurePolicyRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodFailurePolicyRuleDie) DieFeedYAMLFile(name string) *PodFailurePolicyRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodFailurePolicyRuleDie) DieRelease() batchv1.PodFailurePolicyRule { if d.mutable { @@ -958,12 +1288,33 @@ func (d *PodFailurePolicyRuleDie) DieReleasePtr() *batchv1.PodFailurePolicyRule return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodFailurePolicyRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodFailurePolicyRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1041,14 +1392,42 @@ func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedPtr(r *batchv1.PodFai return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyOnExitCodesRequirementDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedJSON(j []byte) *PodFailurePolicyOnExitCodesRequirementDie { r := batchv1.PodFailurePolicyOnExitCodesRequirement{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedYAML(y []byte) *PodFailurePolicyOnExitCodesRequirementDie { + r := batchv1.PodFailurePolicyOnExitCodesRequirement{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedYAMLFile(name string) *PodFailurePolicyOnExitCodesRequirementDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyOnExitCodesRequirementDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodFailurePolicyOnExitCodesRequirementDie) DieRelease() batchv1.PodFailurePolicyOnExitCodesRequirement { if d.mutable { @@ -1063,12 +1442,33 @@ func (d *PodFailurePolicyOnExitCodesRequirementDie) DieReleasePtr() *batchv1.Pod return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyOnExitCodesRequirementDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyOnExitCodesRequirementDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1146,14 +1546,42 @@ func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedPtr(r *batchv1.PodFai return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyOnPodConditionsPatternDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedJSON(j []byte) *PodFailurePolicyOnPodConditionsPatternDie { r := batchv1.PodFailurePolicyOnPodConditionsPattern{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedYAML(y []byte) *PodFailurePolicyOnPodConditionsPatternDie { + r := batchv1.PodFailurePolicyOnPodConditionsPattern{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedYAMLFile(name string) *PodFailurePolicyOnPodConditionsPatternDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieFeedRawExtension(raw runtime.RawExtension) *PodFailurePolicyOnPodConditionsPatternDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodFailurePolicyOnPodConditionsPatternDie) DieRelease() batchv1.PodFailurePolicyOnPodConditionsPattern { if d.mutable { @@ -1168,12 +1596,33 @@ func (d *PodFailurePolicyOnPodConditionsPatternDie) DieReleasePtr() *batchv1.Pod return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodFailurePolicyOnPodConditionsPatternDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodFailurePolicyOnPodConditionsPatternDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1244,14 +1693,42 @@ func (d *JobStatusDie) DieFeedPtr(r *batchv1.JobStatus) *JobStatusDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *JobStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *JobStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *JobStatusDie) DieFeedJSON(j []byte) *JobStatusDie { + r := batchv1.JobStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *JobStatusDie) DieFeedYAML(y []byte) *JobStatusDie { r := batchv1.JobStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *JobStatusDie) DieFeedYAMLFile(name string) *JobStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *JobStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *JobStatusDie) DieRelease() batchv1.JobStatus { if d.mutable { @@ -1266,12 +1743,33 @@ func (d *JobStatusDie) DieReleasePtr() *batchv1.JobStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *JobStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *JobStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *JobStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *JobStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1397,14 +1895,42 @@ func (d *UncountedTerminatedPodsDie) DieFeedPtr(r *batchv1.UncountedTerminatedPo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *UncountedTerminatedPodsDie) DieFeedRawExtension(raw runtime.RawExtension) *UncountedTerminatedPodsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *UncountedTerminatedPodsDie) DieFeedJSON(j []byte) *UncountedTerminatedPodsDie { + r := batchv1.UncountedTerminatedPods{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *UncountedTerminatedPodsDie) DieFeedYAML(y []byte) *UncountedTerminatedPodsDie { r := batchv1.UncountedTerminatedPods{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *UncountedTerminatedPodsDie) DieFeedYAMLFile(name string) *UncountedTerminatedPodsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UncountedTerminatedPodsDie) DieFeedRawExtension(raw runtime.RawExtension) *UncountedTerminatedPodsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *UncountedTerminatedPodsDie) DieRelease() batchv1.UncountedTerminatedPods { if d.mutable { @@ -1419,12 +1945,33 @@ func (d *UncountedTerminatedPodsDie) DieReleasePtr() *batchv1.UncountedTerminate return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *UncountedTerminatedPodsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *UncountedTerminatedPodsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *UncountedTerminatedPodsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *UncountedTerminatedPodsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/certificates/v1/zz_generated.die.go b/apis/certificates/v1/zz_generated.die.go index e7817cd..7a1c92e 100644 --- a/apis/certificates/v1/zz_generated.die.go +++ b/apis/certificates/v1/zz_generated.die.go @@ -29,6 +29,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var CertificateSigningRequestBlank = (&CertificateSigningRequestDie{}).DieFeed(certificatesv1.CertificateSigningRequest{}) @@ -71,14 +73,42 @@ func (d *CertificateSigningRequestDie) DieFeedPtr(r *certificatesv1.CertificateS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CertificateSigningRequestDie) DieFeedJSON(j []byte) *CertificateSigningRequestDie { + r := certificatesv1.CertificateSigningRequest{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CertificateSigningRequestDie) DieFeedYAML(y []byte) *CertificateSigningRequestDie { r := certificatesv1.CertificateSigningRequest{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CertificateSigningRequestDie) DieFeedYAMLFile(name string) *CertificateSigningRequestDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CertificateSigningRequestDie) DieRelease() certificatesv1.CertificateSigningRequest { if d.mutable { @@ -93,21 +123,45 @@ func (d *CertificateSigningRequestDie) DieReleasePtr() *certificatesv1.Certifica return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CertificateSigningRequestDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CertificateSigningRequestDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CertificateSigningRequestDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -248,14 +302,42 @@ func (d *CertificateSigningRequestSpecDie) DieFeedPtr(r *certificatesv1.Certific return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieFeedJSON(j []byte) *CertificateSigningRequestSpecDie { + r := certificatesv1.CertificateSigningRequestSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieFeedYAML(y []byte) *CertificateSigningRequestSpecDie { r := certificatesv1.CertificateSigningRequestSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieFeedYAMLFile(name string) *CertificateSigningRequestSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CertificateSigningRequestSpecDie) DieRelease() certificatesv1.CertificateSigningRequestSpec { if d.mutable { @@ -270,12 +352,33 @@ func (d *CertificateSigningRequestSpecDie) DieReleasePtr() *certificatesv1.Certi return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -403,14 +506,42 @@ func (d *CertificateSigningRequestStatusDie) DieFeedPtr(r *certificatesv1.Certif return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieFeedJSON(j []byte) *CertificateSigningRequestStatusDie { + r := certificatesv1.CertificateSigningRequestStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieFeedYAML(y []byte) *CertificateSigningRequestStatusDie { r := certificatesv1.CertificateSigningRequestStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieFeedYAMLFile(name string) *CertificateSigningRequestStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *CertificateSigningRequestStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CertificateSigningRequestStatusDie) DieRelease() certificatesv1.CertificateSigningRequestStatus { if d.mutable { @@ -425,12 +556,33 @@ func (d *CertificateSigningRequestStatusDie) DieReleasePtr() *certificatesv1.Cer return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CertificateSigningRequestStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CertificateSigningRequestStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/coordination/v1/zz_generated.die.go b/apis/coordination/v1/zz_generated.die.go index eea9143..c9517f2 100644 --- a/apis/coordination/v1/zz_generated.die.go +++ b/apis/coordination/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var LeaseBlank = (&LeaseDie{}).DieFeed(coordinationv1.Lease{}) @@ -72,14 +74,42 @@ func (d *LeaseDie) DieFeedPtr(r *coordinationv1.Lease) *LeaseDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LeaseDie) DieFeedRawExtension(raw runtime.RawExtension) *LeaseDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LeaseDie) DieFeedJSON(j []byte) *LeaseDie { r := coordinationv1.Lease{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LeaseDie) DieFeedYAML(y []byte) *LeaseDie { + r := coordinationv1.Lease{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LeaseDie) DieFeedYAMLFile(name string) *LeaseDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LeaseDie) DieFeedRawExtension(raw runtime.RawExtension) *LeaseDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LeaseDie) DieRelease() coordinationv1.Lease { if d.mutable { @@ -94,21 +124,45 @@ func (d *LeaseDie) DieReleasePtr() *coordinationv1.Lease { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *LeaseDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LeaseDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LeaseDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LeaseDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LeaseDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -233,14 +287,42 @@ func (d *LeaseSpecDie) DieFeedPtr(r *coordinationv1.LeaseSpec) *LeaseSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LeaseSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *LeaseSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LeaseSpecDie) DieFeedJSON(j []byte) *LeaseSpecDie { + r := coordinationv1.LeaseSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LeaseSpecDie) DieFeedYAML(y []byte) *LeaseSpecDie { r := coordinationv1.LeaseSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LeaseSpecDie) DieFeedYAMLFile(name string) *LeaseSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LeaseSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *LeaseSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LeaseSpecDie) DieRelease() coordinationv1.LeaseSpec { if d.mutable { @@ -255,12 +337,33 @@ func (d *LeaseSpecDie) DieReleasePtr() *coordinationv1.LeaseSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LeaseSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LeaseSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LeaseSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LeaseSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/core/v1/pod_test.go b/apis/core/v1/pod_test.go index f3a9773..f5000dc 100644 --- a/apis/core/v1/pod_test.go +++ b/apis/core/v1/pod_test.go @@ -34,9 +34,10 @@ func TestPod(t *testing.T) { } tests := []struct { - name string - die *diecorev1.PodDie - expected corev1.Pod + name string + die *diecorev1.PodDie + yamlFilePath string + expected corev1.Pod }{ { name: "empty", @@ -326,10 +327,39 @@ func TestPod(t *testing.T) { }, }, }, + { + name: "load from yaml", + yamlFilePath: "testdata/pod.yaml", + expected: corev1.Pod{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Pod", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "nginx", + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "nginx", + Image: "nginx:1.14.2", + Ports: []corev1.ContainerPort{ + { + ContainerPort: 80, + }, + }, + }, + }, + }, + }, + }, } for _, c := range tests { t.Run(c.name, func(t *testing.T) { + if name := c.yamlFilePath; name != "" { + c.die = diecorev1.PodBlank.DieFeedYAMLFile(name) + } actual := c.die.DieRelease() if diff := cmp.Diff(c.expected, actual); diff != "" { t.Errorf("(-expected, +actual): %s", diff) diff --git a/apis/core/v1/testdata/pod.yaml b/apis/core/v1/testdata/pod.yaml new file mode 100644 index 0000000..0e79d8a --- /dev/null +++ b/apis/core/v1/testdata/pod.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx +spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 diff --git a/apis/core/v1/zz_generated.die.go b/apis/core/v1/zz_generated.die.go index 9096a52..1c37a93 100644 --- a/apis/core/v1/zz_generated.die.go +++ b/apis/core/v1/zz_generated.die.go @@ -33,6 +33,8 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" intstr "k8s.io/apimachinery/pkg/util/intstr" + osx "os" + yaml "sigs.k8s.io/yaml" ) var BindingBlank = (&BindingDie{}).DieFeed(corev1.Binding{}) @@ -75,14 +77,42 @@ func (d *BindingDie) DieFeedPtr(r *corev1.Binding) *BindingDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *BindingDie) DieFeedRawExtension(raw runtime.RawExtension) *BindingDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *BindingDie) DieFeedJSON(j []byte) *BindingDie { + r := corev1.Binding{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *BindingDie) DieFeedYAML(y []byte) *BindingDie { r := corev1.Binding{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *BindingDie) DieFeedYAMLFile(name string) *BindingDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *BindingDie) DieFeedRawExtension(raw runtime.RawExtension) *BindingDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *BindingDie) DieRelease() corev1.Binding { if d.mutable { @@ -97,21 +127,45 @@ func (d *BindingDie) DieReleasePtr() *corev1.Binding { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *BindingDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *BindingDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *BindingDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *BindingDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *BindingDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -227,14 +281,42 @@ func (d *ObjectReferenceDie) DieFeedPtr(r *corev1.ObjectReference) *ObjectRefere return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ObjectReferenceDie) DieFeedJSON(j []byte) *ObjectReferenceDie { + r := corev1.ObjectReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ObjectReferenceDie) DieFeedYAML(y []byte) *ObjectReferenceDie { r := corev1.ObjectReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ObjectReferenceDie) DieFeedYAMLFile(name string) *ObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ObjectReferenceDie) DieRelease() corev1.ObjectReference { if d.mutable { @@ -249,12 +331,33 @@ func (d *ObjectReferenceDie) DieReleasePtr() *corev1.ObjectReference { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ObjectReferenceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ObjectReferenceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -360,14 +463,42 @@ func (d *LocalObjectReferenceDie) DieFeedPtr(r *corev1.LocalObjectReference) *Lo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LocalObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *LocalObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LocalObjectReferenceDie) DieFeedJSON(j []byte) *LocalObjectReferenceDie { + r := corev1.LocalObjectReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LocalObjectReferenceDie) DieFeedYAML(y []byte) *LocalObjectReferenceDie { r := corev1.LocalObjectReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LocalObjectReferenceDie) DieFeedYAMLFile(name string) *LocalObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LocalObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *LocalObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LocalObjectReferenceDie) DieRelease() corev1.LocalObjectReference { if d.mutable { @@ -382,12 +513,33 @@ func (d *LocalObjectReferenceDie) DieReleasePtr() *corev1.LocalObjectReference { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LocalObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LocalObjectReferenceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LocalObjectReferenceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LocalObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -451,14 +603,42 @@ func (d *TypedLocalObjectReferenceDie) DieFeedPtr(r *corev1.TypedLocalObjectRefe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TypedLocalObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *TypedLocalObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieFeedJSON(j []byte) *TypedLocalObjectReferenceDie { + r := corev1.TypedLocalObjectReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieFeedYAML(y []byte) *TypedLocalObjectReferenceDie { r := corev1.TypedLocalObjectReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieFeedYAMLFile(name string) *TypedLocalObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *TypedLocalObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TypedLocalObjectReferenceDie) DieRelease() corev1.TypedLocalObjectReference { if d.mutable { @@ -473,12 +653,33 @@ func (d *TypedLocalObjectReferenceDie) DieReleasePtr() *corev1.TypedLocalObjectR return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TypedLocalObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TypedLocalObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -556,14 +757,42 @@ func (d *TypedObjectReferenceDie) DieFeedPtr(r *corev1.TypedObjectReference) *Ty return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TypedObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *TypedObjectReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TypedObjectReferenceDie) DieFeedJSON(j []byte) *TypedObjectReferenceDie { + r := corev1.TypedObjectReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TypedObjectReferenceDie) DieFeedYAML(y []byte) *TypedObjectReferenceDie { r := corev1.TypedObjectReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TypedObjectReferenceDie) DieFeedYAMLFile(name string) *TypedObjectReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TypedObjectReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *TypedObjectReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TypedObjectReferenceDie) DieRelease() corev1.TypedObjectReference { if d.mutable { @@ -578,12 +807,33 @@ func (d *TypedObjectReferenceDie) DieReleasePtr() *corev1.TypedObjectReference { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TypedObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TypedObjectReferenceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TypedObjectReferenceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TypedObjectReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -668,14 +918,42 @@ func (d *SecretReferenceDie) DieFeedPtr(r *corev1.SecretReference) *SecretRefere return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretReferenceDie) DieFeedJSON(j []byte) *SecretReferenceDie { + r := corev1.SecretReference{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretReferenceDie) DieFeedYAML(y []byte) *SecretReferenceDie { r := corev1.SecretReference{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretReferenceDie) DieFeedYAMLFile(name string) *SecretReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecretReferenceDie) DieRelease() corev1.SecretReference { if d.mutable { @@ -690,12 +968,33 @@ func (d *SecretReferenceDie) DieReleasePtr() *corev1.SecretReference { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretReferenceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretReferenceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -766,14 +1065,42 @@ func (d *TopologySelectorTermDie) DieFeedPtr(r *corev1.TopologySelectorTerm) *To return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySelectorTermDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySelectorTermDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TopologySelectorTermDie) DieFeedJSON(j []byte) *TopologySelectorTermDie { + r := corev1.TopologySelectorTerm{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TopologySelectorTermDie) DieFeedYAML(y []byte) *TopologySelectorTermDie { r := corev1.TopologySelectorTerm{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TopologySelectorTermDie) DieFeedYAMLFile(name string) *TopologySelectorTermDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySelectorTermDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySelectorTermDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TopologySelectorTermDie) DieRelease() corev1.TopologySelectorTerm { if d.mutable { @@ -788,12 +1115,33 @@ func (d *TopologySelectorTermDie) DieReleasePtr() *corev1.TopologySelectorTerm { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySelectorTermDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TopologySelectorTermDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TopologySelectorTermDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySelectorTermDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -857,14 +1205,42 @@ func (d *TopologySelectorLabelRequirementDie) DieFeedPtr(r *corev1.TopologySelec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySelectorLabelRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySelectorLabelRequirementDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieFeedJSON(j []byte) *TopologySelectorLabelRequirementDie { + r := corev1.TopologySelectorLabelRequirement{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieFeedYAML(y []byte) *TopologySelectorLabelRequirementDie { r := corev1.TopologySelectorLabelRequirement{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieFeedYAMLFile(name string) *TopologySelectorLabelRequirementDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySelectorLabelRequirementDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TopologySelectorLabelRequirementDie) DieRelease() corev1.TopologySelectorLabelRequirement { if d.mutable { @@ -879,12 +1255,33 @@ func (d *TopologySelectorLabelRequirementDie) DieReleasePtr() *corev1.TopologySe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySelectorLabelRequirementDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySelectorLabelRequirementDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -958,14 +1355,42 @@ func (d *ComponentStatusDie) DieFeedPtr(r *corev1.ComponentStatus) *ComponentSta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ComponentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ComponentStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ComponentStatusDie) DieFeedJSON(j []byte) *ComponentStatusDie { + r := corev1.ComponentStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ComponentStatusDie) DieFeedYAML(y []byte) *ComponentStatusDie { r := corev1.ComponentStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ComponentStatusDie) DieFeedYAMLFile(name string) *ComponentStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ComponentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ComponentStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ComponentStatusDie) DieRelease() corev1.ComponentStatus { if d.mutable { @@ -980,21 +1405,45 @@ func (d *ComponentStatusDie) DieReleasePtr() *corev1.ComponentStatus { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ComponentStatusDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ComponentStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ComponentStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ComponentStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ComponentStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1113,14 +1562,42 @@ func (d *ConfigMapDie) DieFeedPtr(r *corev1.ConfigMap) *ConfigMapDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapDie) DieFeedJSON(j []byte) *ConfigMapDie { + r := corev1.ConfigMap{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapDie) DieFeedYAML(y []byte) *ConfigMapDie { r := corev1.ConfigMap{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapDie) DieFeedYAMLFile(name string) *ConfigMapDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapDie) DieRelease() corev1.ConfigMap { if d.mutable { @@ -1135,21 +1612,45 @@ func (d *ConfigMapDie) DieReleasePtr() *corev1.ConfigMap { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ConfigMapDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1265,34 +1766,83 @@ func (d *ContainerDie) DieFeedPtr(r *corev1.Container) *ContainerDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerDie) DieFeedJSON(j []byte) *ContainerDie { r := corev1.Container{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } -// DieRelease returns the resource managed by the die. -func (d *ContainerDie) DieRelease() corev1.Container { - if d.mutable { - return d.r +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerDie) DieFeedYAML(y []byte) *ContainerDie { + r := corev1.Container{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) } - return *d.r.DeepCopy() + return d.DieFeed(r) } -// DieReleasePtr returns a pointer to the resource managed by the die. -func (d *ContainerDie) DieReleasePtr() *corev1.Container { - r := d.DieRelease() - return &r +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerDie) DieFeedYAMLFile(name string) *ContainerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + +// DieRelease returns the resource managed by the die. +func (d *ContainerDie) DieRelease() corev1.Container { + if d.mutable { + return d.r + } + return *d.r.DeepCopy() +} + +// DieReleasePtr returns a pointer to the resource managed by the die. +func (d *ContainerDie) DieReleasePtr() *corev1.Container { + r := d.DieRelease() + return &r +} + +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1503,14 +2053,42 @@ func (d *ContainerPortDie) DieFeedPtr(r *corev1.ContainerPort) *ContainerPortDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerPortDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerPortDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerPortDie) DieFeedJSON(j []byte) *ContainerPortDie { + r := corev1.ContainerPort{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerPortDie) DieFeedYAML(y []byte) *ContainerPortDie { r := corev1.ContainerPort{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerPortDie) DieFeedYAMLFile(name string) *ContainerPortDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerPortDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerPortDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerPortDie) DieRelease() corev1.ContainerPort { if d.mutable { @@ -1525,12 +2103,33 @@ func (d *ContainerPortDie) DieReleasePtr() *corev1.ContainerPort { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerPortDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerPortDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerPortDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerPortDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1622,14 +2221,42 @@ func (d *EnvFromSourceDie) DieFeedPtr(r *corev1.EnvFromSource) *EnvFromSourceDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvFromSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvFromSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EnvFromSourceDie) DieFeedJSON(j []byte) *EnvFromSourceDie { + r := corev1.EnvFromSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EnvFromSourceDie) DieFeedYAML(y []byte) *EnvFromSourceDie { r := corev1.EnvFromSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EnvFromSourceDie) DieFeedYAMLFile(name string) *EnvFromSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvFromSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvFromSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EnvFromSourceDie) DieRelease() corev1.EnvFromSource { if d.mutable { @@ -1644,12 +2271,33 @@ func (d *EnvFromSourceDie) DieReleasePtr() *corev1.EnvFromSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvFromSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EnvFromSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EnvFromSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvFromSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1727,14 +2375,42 @@ func (d *ConfigMapEnvSourceDie) DieFeedPtr(r *corev1.ConfigMapEnvSource) *Config return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapEnvSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapEnvSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapEnvSourceDie) DieFeedJSON(j []byte) *ConfigMapEnvSourceDie { + r := corev1.ConfigMapEnvSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapEnvSourceDie) DieFeedYAML(y []byte) *ConfigMapEnvSourceDie { r := corev1.ConfigMapEnvSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapEnvSourceDie) DieFeedYAMLFile(name string) *ConfigMapEnvSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapEnvSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapEnvSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapEnvSourceDie) DieRelease() corev1.ConfigMapEnvSource { if d.mutable { @@ -1749,12 +2425,33 @@ func (d *ConfigMapEnvSourceDie) DieReleasePtr() *corev1.ConfigMapEnvSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapEnvSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapEnvSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapEnvSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapEnvSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1825,14 +2522,42 @@ func (d *SecretEnvSourceDie) DieFeedPtr(r *corev1.SecretEnvSource) *SecretEnvSou return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretEnvSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretEnvSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretEnvSourceDie) DieFeedJSON(j []byte) *SecretEnvSourceDie { + r := corev1.SecretEnvSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretEnvSourceDie) DieFeedYAML(y []byte) *SecretEnvSourceDie { r := corev1.SecretEnvSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretEnvSourceDie) DieFeedYAMLFile(name string) *SecretEnvSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretEnvSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretEnvSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecretEnvSourceDie) DieRelease() corev1.SecretEnvSource { if d.mutable { @@ -1847,12 +2572,33 @@ func (d *SecretEnvSourceDie) DieReleasePtr() *corev1.SecretEnvSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretEnvSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretEnvSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretEnvSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretEnvSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1923,14 +2669,42 @@ func (d *EnvVarDie) DieFeedPtr(r *corev1.EnvVar) *EnvVarDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvVarDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvVarDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EnvVarDie) DieFeedJSON(j []byte) *EnvVarDie { + r := corev1.EnvVar{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EnvVarDie) DieFeedYAML(y []byte) *EnvVarDie { r := corev1.EnvVar{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EnvVarDie) DieFeedYAMLFile(name string) *EnvVarDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvVarDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvVarDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EnvVarDie) DieRelease() corev1.EnvVar { if d.mutable { @@ -1945,12 +2719,33 @@ func (d *EnvVarDie) DieReleasePtr() *corev1.EnvVar { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvVarDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EnvVarDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EnvVarDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvVarDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2028,14 +2823,42 @@ func (d *EnvVarSourceDie) DieFeedPtr(r *corev1.EnvVarSource) *EnvVarSourceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvVarSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvVarSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EnvVarSourceDie) DieFeedJSON(j []byte) *EnvVarSourceDie { + r := corev1.EnvVarSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EnvVarSourceDie) DieFeedYAML(y []byte) *EnvVarSourceDie { r := corev1.EnvVarSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EnvVarSourceDie) DieFeedYAMLFile(name string) *EnvVarSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvVarSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EnvVarSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EnvVarSourceDie) DieRelease() corev1.EnvVarSource { if d.mutable { @@ -2050,12 +2873,33 @@ func (d *EnvVarSourceDie) DieReleasePtr() *corev1.EnvVarSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EnvVarSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EnvVarSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EnvVarSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EnvVarSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2140,14 +2984,42 @@ func (d *ObjectFieldSelectorDie) DieFeedPtr(r *corev1.ObjectFieldSelector) *Obje return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectFieldSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectFieldSelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ObjectFieldSelectorDie) DieFeedJSON(j []byte) *ObjectFieldSelectorDie { + r := corev1.ObjectFieldSelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ObjectFieldSelectorDie) DieFeedYAML(y []byte) *ObjectFieldSelectorDie { r := corev1.ObjectFieldSelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ObjectFieldSelectorDie) DieFeedYAMLFile(name string) *ObjectFieldSelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectFieldSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectFieldSelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ObjectFieldSelectorDie) DieRelease() corev1.ObjectFieldSelector { if d.mutable { @@ -2162,12 +3034,33 @@ func (d *ObjectFieldSelectorDie) DieReleasePtr() *corev1.ObjectFieldSelector { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectFieldSelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ObjectFieldSelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ObjectFieldSelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectFieldSelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2238,14 +3131,42 @@ func (d *ResourceFieldSelectorDie) DieFeedPtr(r *corev1.ResourceFieldSelector) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceFieldSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceFieldSelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceFieldSelectorDie) DieFeedJSON(j []byte) *ResourceFieldSelectorDie { + r := corev1.ResourceFieldSelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceFieldSelectorDie) DieFeedYAML(y []byte) *ResourceFieldSelectorDie { r := corev1.ResourceFieldSelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceFieldSelectorDie) DieFeedYAMLFile(name string) *ResourceFieldSelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceFieldSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceFieldSelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceFieldSelectorDie) DieRelease() corev1.ResourceFieldSelector { if d.mutable { @@ -2260,12 +3181,33 @@ func (d *ResourceFieldSelectorDie) DieReleasePtr() *corev1.ResourceFieldSelector return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceFieldSelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceFieldSelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceFieldSelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceFieldSelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2343,14 +3285,42 @@ func (d *ConfigMapKeySelectorDie) DieFeedPtr(r *corev1.ConfigMapKeySelector) *Co return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapKeySelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapKeySelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapKeySelectorDie) DieFeedJSON(j []byte) *ConfigMapKeySelectorDie { + r := corev1.ConfigMapKeySelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapKeySelectorDie) DieFeedYAML(y []byte) *ConfigMapKeySelectorDie { r := corev1.ConfigMapKeySelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapKeySelectorDie) DieFeedYAMLFile(name string) *ConfigMapKeySelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapKeySelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapKeySelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapKeySelectorDie) DieRelease() corev1.ConfigMapKeySelector { if d.mutable { @@ -2365,12 +3335,33 @@ func (d *ConfigMapKeySelectorDie) DieReleasePtr() *corev1.ConfigMapKeySelector { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapKeySelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapKeySelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapKeySelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapKeySelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2448,34 +3439,83 @@ func (d *SecretKeySelectorDie) DieFeedPtr(r *corev1.SecretKeySelector) *SecretKe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretKeySelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretKeySelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretKeySelectorDie) DieFeedJSON(j []byte) *SecretKeySelectorDie { r := corev1.SecretKeySelector{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } -// DieRelease returns the resource managed by the die. -func (d *SecretKeySelectorDie) DieRelease() corev1.SecretKeySelector { - if d.mutable { - return d.r +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretKeySelectorDie) DieFeedYAML(y []byte) *SecretKeySelectorDie { + r := corev1.SecretKeySelector{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) } - return *d.r.DeepCopy() + return d.DieFeed(r) } -// DieReleasePtr returns a pointer to the resource managed by the die. -func (d *SecretKeySelectorDie) DieReleasePtr() *corev1.SecretKeySelector { +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretKeySelectorDie) DieFeedYAMLFile(name string) *SecretKeySelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretKeySelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretKeySelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + +// DieRelease returns the resource managed by the die. +func (d *SecretKeySelectorDie) DieRelease() corev1.SecretKeySelector { + if d.mutable { + return d.r + } + return *d.r.DeepCopy() +} + +// DieReleasePtr returns a pointer to the resource managed by the die. +func (d *SecretKeySelectorDie) DieReleasePtr() *corev1.SecretKeySelector { r := d.DieRelease() return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretKeySelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretKeySelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretKeySelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretKeySelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2553,14 +3593,42 @@ func (d *ResourceRequirementsDie) DieFeedPtr(r *corev1.ResourceRequirements) *Re return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceRequirementsDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceRequirementsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceRequirementsDie) DieFeedJSON(j []byte) *ResourceRequirementsDie { + r := corev1.ResourceRequirements{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceRequirementsDie) DieFeedYAML(y []byte) *ResourceRequirementsDie { r := corev1.ResourceRequirements{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceRequirementsDie) DieFeedYAMLFile(name string) *ResourceRequirementsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceRequirementsDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceRequirementsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceRequirementsDie) DieRelease() corev1.ResourceRequirements { if d.mutable { @@ -2575,12 +3643,33 @@ func (d *ResourceRequirementsDie) DieReleasePtr() *corev1.ResourceRequirements { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceRequirementsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceRequirementsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceRequirementsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceRequirementsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2662,14 +3751,42 @@ func (d *ResourceClaimDie) DieFeedPtr(r *corev1.ResourceClaim) *ResourceClaimDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceClaimDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceClaimDie) DieFeedJSON(j []byte) *ResourceClaimDie { r := corev1.ResourceClaim{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceClaimDie) DieFeedYAML(y []byte) *ResourceClaimDie { + r := corev1.ResourceClaim{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceClaimDie) DieFeedYAMLFile(name string) *ResourceClaimDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceClaimDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceClaimDie) DieRelease() corev1.ResourceClaim { if d.mutable { @@ -2684,12 +3801,33 @@ func (d *ResourceClaimDie) DieReleasePtr() *corev1.ResourceClaim { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceClaimDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceClaimDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceClaimDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceClaimDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2753,14 +3891,42 @@ func (d *VolumeMountDie) DieFeedPtr(r *corev1.VolumeMount) *VolumeMountDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeMountDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeMountDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeMountDie) DieFeedJSON(j []byte) *VolumeMountDie { + r := corev1.VolumeMount{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeMountDie) DieFeedYAML(y []byte) *VolumeMountDie { r := corev1.VolumeMount{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeMountDie) DieFeedYAMLFile(name string) *VolumeMountDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeMountDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeMountDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeMountDie) DieRelease() corev1.VolumeMount { if d.mutable { @@ -2775,12 +3941,33 @@ func (d *VolumeMountDie) DieReleasePtr() *corev1.VolumeMount { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeMountDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeMountDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeMountDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeMountDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2879,14 +4066,42 @@ func (d *VolumeDeviceDie) DieFeedPtr(r *corev1.VolumeDevice) *VolumeDeviceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeDeviceDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeDeviceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeDeviceDie) DieFeedJSON(j []byte) *VolumeDeviceDie { r := corev1.VolumeDevice{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeDeviceDie) DieFeedYAML(y []byte) *VolumeDeviceDie { + r := corev1.VolumeDevice{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeDeviceDie) DieFeedYAMLFile(name string) *VolumeDeviceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeDeviceDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeDeviceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeDeviceDie) DieRelease() corev1.VolumeDevice { if d.mutable { @@ -2901,12 +4116,33 @@ func (d *VolumeDeviceDie) DieReleasePtr() *corev1.VolumeDevice { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeDeviceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeDeviceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeDeviceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeDeviceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2977,14 +4213,42 @@ func (d *ProbeDie) DieFeedPtr(r *corev1.Probe) *ProbeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ProbeDie) DieFeedRawExtension(raw runtime.RawExtension) *ProbeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ProbeDie) DieFeedJSON(j []byte) *ProbeDie { r := corev1.Probe{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ProbeDie) DieFeedYAML(y []byte) *ProbeDie { + r := corev1.Probe{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ProbeDie) DieFeedYAMLFile(name string) *ProbeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProbeDie) DieFeedRawExtension(raw runtime.RawExtension) *ProbeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ProbeDie) DieRelease() corev1.Probe { if d.mutable { @@ -2999,12 +4263,33 @@ func (d *ProbeDie) DieReleasePtr() *corev1.Probe { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ProbeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ProbeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ProbeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProbeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3110,14 +4395,42 @@ func (d *LifecycleDie) DieFeedPtr(r *corev1.Lifecycle) *LifecycleDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LifecycleDie) DieFeedRawExtension(raw runtime.RawExtension) *LifecycleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LifecycleDie) DieFeedJSON(j []byte) *LifecycleDie { r := corev1.Lifecycle{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LifecycleDie) DieFeedYAML(y []byte) *LifecycleDie { + r := corev1.Lifecycle{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LifecycleDie) DieFeedYAMLFile(name string) *LifecycleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LifecycleDie) DieFeedRawExtension(raw runtime.RawExtension) *LifecycleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LifecycleDie) DieRelease() corev1.Lifecycle { if d.mutable { @@ -3132,12 +4445,33 @@ func (d *LifecycleDie) DieReleasePtr() *corev1.Lifecycle { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LifecycleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LifecycleDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LifecycleDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LifecycleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3208,14 +4542,42 @@ func (d *LifecycleHandlerDie) DieFeedPtr(r *corev1.LifecycleHandler) *LifecycleH return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LifecycleHandlerDie) DieFeedRawExtension(raw runtime.RawExtension) *LifecycleHandlerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LifecycleHandlerDie) DieFeedJSON(j []byte) *LifecycleHandlerDie { r := corev1.LifecycleHandler{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LifecycleHandlerDie) DieFeedYAML(y []byte) *LifecycleHandlerDie { + r := corev1.LifecycleHandler{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LifecycleHandlerDie) DieFeedYAMLFile(name string) *LifecycleHandlerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LifecycleHandlerDie) DieFeedRawExtension(raw runtime.RawExtension) *LifecycleHandlerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LifecycleHandlerDie) DieRelease() corev1.LifecycleHandler { if d.mutable { @@ -3230,12 +4592,33 @@ func (d *LifecycleHandlerDie) DieReleasePtr() *corev1.LifecycleHandler { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LifecycleHandlerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LifecycleHandlerDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LifecycleHandlerDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LifecycleHandlerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3313,14 +4696,42 @@ func (d *ProbeHandlerDie) DieFeedPtr(r *corev1.ProbeHandler) *ProbeHandlerDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ProbeHandlerDie) DieFeedRawExtension(raw runtime.RawExtension) *ProbeHandlerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ProbeHandlerDie) DieFeedJSON(j []byte) *ProbeHandlerDie { r := corev1.ProbeHandler{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ProbeHandlerDie) DieFeedYAML(y []byte) *ProbeHandlerDie { + r := corev1.ProbeHandler{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ProbeHandlerDie) DieFeedYAMLFile(name string) *ProbeHandlerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProbeHandlerDie) DieFeedRawExtension(raw runtime.RawExtension) *ProbeHandlerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ProbeHandlerDie) DieRelease() corev1.ProbeHandler { if d.mutable { @@ -3335,12 +4746,33 @@ func (d *ProbeHandlerDie) DieReleasePtr() *corev1.ProbeHandler { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ProbeHandlerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ProbeHandlerDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ProbeHandlerDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProbeHandlerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3425,14 +4857,42 @@ func (d *ExecActionDie) DieFeedPtr(r *corev1.ExecAction) *ExecActionDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ExecActionDie) DieFeedRawExtension(raw runtime.RawExtension) *ExecActionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ExecActionDie) DieFeedJSON(j []byte) *ExecActionDie { r := corev1.ExecAction{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ExecActionDie) DieFeedYAML(y []byte) *ExecActionDie { + r := corev1.ExecAction{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ExecActionDie) DieFeedYAMLFile(name string) *ExecActionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ExecActionDie) DieFeedRawExtension(raw runtime.RawExtension) *ExecActionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ExecActionDie) DieRelease() corev1.ExecAction { if d.mutable { @@ -3447,12 +4907,33 @@ func (d *ExecActionDie) DieReleasePtr() *corev1.ExecAction { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ExecActionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ExecActionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ExecActionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ExecActionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3516,14 +4997,42 @@ func (d *HTTPGetActionDie) DieFeedPtr(r *corev1.HTTPGetAction) *HTTPGetActionDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPGetActionDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPGetActionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HTTPGetActionDie) DieFeedJSON(j []byte) *HTTPGetActionDie { r := corev1.HTTPGetAction{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HTTPGetActionDie) DieFeedYAML(y []byte) *HTTPGetActionDie { + r := corev1.HTTPGetAction{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HTTPGetActionDie) DieFeedYAMLFile(name string) *HTTPGetActionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPGetActionDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPGetActionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HTTPGetActionDie) DieRelease() corev1.HTTPGetAction { if d.mutable { @@ -3538,12 +5047,33 @@ func (d *HTTPGetActionDie) DieReleasePtr() *corev1.HTTPGetAction { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPGetActionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HTTPGetActionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HTTPGetActionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPGetActionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3649,14 +5179,42 @@ func (d *HTTPHeaderDie) DieFeedPtr(r *corev1.HTTPHeader) *HTTPHeaderDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPHeaderDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPHeaderDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HTTPHeaderDie) DieFeedJSON(j []byte) *HTTPHeaderDie { + r := corev1.HTTPHeader{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HTTPHeaderDie) DieFeedYAML(y []byte) *HTTPHeaderDie { r := corev1.HTTPHeader{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HTTPHeaderDie) DieFeedYAMLFile(name string) *HTTPHeaderDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPHeaderDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPHeaderDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HTTPHeaderDie) DieRelease() corev1.HTTPHeader { if d.mutable { @@ -3671,12 +5229,33 @@ func (d *HTTPHeaderDie) DieReleasePtr() *corev1.HTTPHeader { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPHeaderDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HTTPHeaderDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HTTPHeaderDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPHeaderDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3747,14 +5326,42 @@ func (d *TCPSocketActionDie) DieFeedPtr(r *corev1.TCPSocketAction) *TCPSocketAct return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TCPSocketActionDie) DieFeedRawExtension(raw runtime.RawExtension) *TCPSocketActionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TCPSocketActionDie) DieFeedJSON(j []byte) *TCPSocketActionDie { + r := corev1.TCPSocketAction{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TCPSocketActionDie) DieFeedYAML(y []byte) *TCPSocketActionDie { r := corev1.TCPSocketAction{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TCPSocketActionDie) DieFeedYAMLFile(name string) *TCPSocketActionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TCPSocketActionDie) DieFeedRawExtension(raw runtime.RawExtension) *TCPSocketActionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TCPSocketActionDie) DieRelease() corev1.TCPSocketAction { if d.mutable { @@ -3769,12 +5376,33 @@ func (d *TCPSocketActionDie) DieReleasePtr() *corev1.TCPSocketAction { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TCPSocketActionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TCPSocketActionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TCPSocketActionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TCPSocketActionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3859,14 +5487,42 @@ func (d *GRPCActionDie) DieFeedPtr(r *corev1.GRPCAction) *GRPCActionDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GRPCActionDie) DieFeedRawExtension(raw runtime.RawExtension) *GRPCActionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GRPCActionDie) DieFeedJSON(j []byte) *GRPCActionDie { r := corev1.GRPCAction{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GRPCActionDie) DieFeedYAML(y []byte) *GRPCActionDie { + r := corev1.GRPCAction{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GRPCActionDie) DieFeedYAMLFile(name string) *GRPCActionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GRPCActionDie) DieFeedRawExtension(raw runtime.RawExtension) *GRPCActionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GRPCActionDie) DieRelease() corev1.GRPCAction { if d.mutable { @@ -3881,12 +5537,33 @@ func (d *GRPCActionDie) DieReleasePtr() *corev1.GRPCAction { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GRPCActionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GRPCActionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GRPCActionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GRPCActionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -3959,14 +5636,42 @@ func (d *SecurityContextDie) DieFeedPtr(r *corev1.SecurityContext) *SecurityCont return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecurityContextDie) DieFeedRawExtension(raw runtime.RawExtension) *SecurityContextDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecurityContextDie) DieFeedJSON(j []byte) *SecurityContextDie { r := corev1.SecurityContext{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecurityContextDie) DieFeedYAML(y []byte) *SecurityContextDie { + r := corev1.SecurityContext{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecurityContextDie) DieFeedYAMLFile(name string) *SecurityContextDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecurityContextDie) DieFeedRawExtension(raw runtime.RawExtension) *SecurityContextDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecurityContextDie) DieRelease() corev1.SecurityContext { if d.mutable { @@ -3981,12 +5686,33 @@ func (d *SecurityContextDie) DieReleasePtr() *corev1.SecurityContext { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecurityContextDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecurityContextDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecurityContextDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecurityContextDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4120,14 +5846,42 @@ func (d *CapabilitiesDie) DieFeedPtr(r *corev1.Capabilities) *CapabilitiesDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CapabilitiesDie) DieFeedRawExtension(raw runtime.RawExtension) *CapabilitiesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CapabilitiesDie) DieFeedJSON(j []byte) *CapabilitiesDie { r := corev1.Capabilities{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CapabilitiesDie) DieFeedYAML(y []byte) *CapabilitiesDie { + r := corev1.Capabilities{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CapabilitiesDie) DieFeedYAMLFile(name string) *CapabilitiesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CapabilitiesDie) DieFeedRawExtension(raw runtime.RawExtension) *CapabilitiesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CapabilitiesDie) DieRelease() corev1.Capabilities { if d.mutable { @@ -4142,12 +5896,33 @@ func (d *CapabilitiesDie) DieReleasePtr() *corev1.Capabilities { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CapabilitiesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CapabilitiesDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CapabilitiesDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CapabilitiesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4218,14 +5993,42 @@ func (d *SELinuxOptionsDie) DieFeedPtr(r *corev1.SELinuxOptions) *SELinuxOptions return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SELinuxOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SELinuxOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SELinuxOptionsDie) DieFeedJSON(j []byte) *SELinuxOptionsDie { r := corev1.SELinuxOptions{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SELinuxOptionsDie) DieFeedYAML(y []byte) *SELinuxOptionsDie { + r := corev1.SELinuxOptions{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SELinuxOptionsDie) DieFeedYAMLFile(name string) *SELinuxOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SELinuxOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SELinuxOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SELinuxOptionsDie) DieRelease() corev1.SELinuxOptions { if d.mutable { @@ -4240,12 +6043,33 @@ func (d *SELinuxOptionsDie) DieReleasePtr() *corev1.SELinuxOptions { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SELinuxOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SELinuxOptionsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SELinuxOptionsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SELinuxOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4330,14 +6154,42 @@ func (d *WindowsSecurityContextOptionsDie) DieFeedPtr(r *corev1.WindowsSecurityC return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *WindowsSecurityContextOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *WindowsSecurityContextOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieFeedJSON(j []byte) *WindowsSecurityContextOptionsDie { + r := corev1.WindowsSecurityContextOptions{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieFeedYAML(y []byte) *WindowsSecurityContextOptionsDie { r := corev1.WindowsSecurityContextOptions{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieFeedYAMLFile(name string) *WindowsSecurityContextOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *WindowsSecurityContextOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *WindowsSecurityContextOptionsDie) DieRelease() corev1.WindowsSecurityContextOptions { if d.mutable { @@ -4352,12 +6204,33 @@ func (d *WindowsSecurityContextOptionsDie) DieReleasePtr() *corev1.WindowsSecuri return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *WindowsSecurityContextOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *WindowsSecurityContextOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4442,14 +6315,42 @@ func (d *SeccompProfileDie) DieFeedPtr(r *corev1.SeccompProfile) *SeccompProfile return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SeccompProfileDie) DieFeedRawExtension(raw runtime.RawExtension) *SeccompProfileDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SeccompProfileDie) DieFeedJSON(j []byte) *SeccompProfileDie { r := corev1.SeccompProfile{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SeccompProfileDie) DieFeedYAML(y []byte) *SeccompProfileDie { + r := corev1.SeccompProfile{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SeccompProfileDie) DieFeedYAMLFile(name string) *SeccompProfileDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SeccompProfileDie) DieFeedRawExtension(raw runtime.RawExtension) *SeccompProfileDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SeccompProfileDie) DieRelease() corev1.SeccompProfile { if d.mutable { @@ -4464,12 +6365,33 @@ func (d *SeccompProfileDie) DieReleasePtr() *corev1.SeccompProfile { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SeccompProfileDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SeccompProfileDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SeccompProfileDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SeccompProfileDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4539,15 +6461,43 @@ func (d *ContainerStatusDie) DieFeedPtr(r *corev1.ContainerStatus) *ContainerSta if r == nil { r = &corev1.ContainerStatus{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerStatusDie) DieFeedJSON(j []byte) *ContainerStatusDie { + r := corev1.ContainerStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerStatusDie) DieFeedYAML(y []byte) *ContainerStatusDie { + r := corev1.ContainerStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerStatusDie) DieFeedYAMLFile(name string) *ContainerStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *ContainerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStatusDie { - b, _ := json.Marshal(raw) - r := corev1.ContainerStatus{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -4564,12 +6514,33 @@ func (d *ContainerStatusDie) DieReleasePtr() *corev1.ContainerStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4689,14 +6660,42 @@ func (d *ContainerStateDie) DieFeedPtr(r *corev1.ContainerState) *ContainerState return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerStateDie) DieFeedJSON(j []byte) *ContainerStateDie { + r := corev1.ContainerState{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerStateDie) DieFeedYAML(y []byte) *ContainerStateDie { r := corev1.ContainerState{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerStateDie) DieFeedYAMLFile(name string) *ContainerStateDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerStateDie) DieRelease() corev1.ContainerState { if d.mutable { @@ -4711,12 +6710,33 @@ func (d *ContainerStateDie) DieReleasePtr() *corev1.ContainerState { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerStateDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerStateDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4794,14 +6814,42 @@ func (d *ContainerStateWaitingDie) DieFeedPtr(r *corev1.ContainerStateWaiting) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateWaitingDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateWaitingDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerStateWaitingDie) DieFeedJSON(j []byte) *ContainerStateWaitingDie { + r := corev1.ContainerStateWaiting{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerStateWaitingDie) DieFeedYAML(y []byte) *ContainerStateWaitingDie { r := corev1.ContainerStateWaiting{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerStateWaitingDie) DieFeedYAMLFile(name string) *ContainerStateWaitingDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateWaitingDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateWaitingDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerStateWaitingDie) DieRelease() corev1.ContainerStateWaiting { if d.mutable { @@ -4816,12 +6864,33 @@ func (d *ContainerStateWaitingDie) DieReleasePtr() *corev1.ContainerStateWaiting return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateWaitingDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerStateWaitingDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerStateWaitingDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateWaitingDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4892,14 +6961,42 @@ func (d *ContainerStateRunningDie) DieFeedPtr(r *corev1.ContainerStateRunning) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateRunningDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateRunningDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerStateRunningDie) DieFeedJSON(j []byte) *ContainerStateRunningDie { + r := corev1.ContainerStateRunning{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerStateRunningDie) DieFeedYAML(y []byte) *ContainerStateRunningDie { r := corev1.ContainerStateRunning{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerStateRunningDie) DieFeedYAMLFile(name string) *ContainerStateRunningDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateRunningDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateRunningDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerStateRunningDie) DieRelease() corev1.ContainerStateRunning { if d.mutable { @@ -4914,12 +7011,33 @@ func (d *ContainerStateRunningDie) DieReleasePtr() *corev1.ContainerStateRunning return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateRunningDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerStateRunningDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerStateRunningDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateRunningDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -4983,14 +7101,42 @@ func (d *ContainerStateTerminatedDie) DieFeedPtr(r *corev1.ContainerStateTermina return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateTerminatedDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateTerminatedDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerStateTerminatedDie) DieFeedJSON(j []byte) *ContainerStateTerminatedDie { + r := corev1.ContainerStateTerminated{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerStateTerminatedDie) DieFeedYAML(y []byte) *ContainerStateTerminatedDie { r := corev1.ContainerStateTerminated{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerStateTerminatedDie) DieFeedYAMLFile(name string) *ContainerStateTerminatedDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateTerminatedDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerStateTerminatedDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerStateTerminatedDie) DieRelease() corev1.ContainerStateTerminated { if d.mutable { @@ -5005,12 +7151,33 @@ func (d *ContainerStateTerminatedDie) DieReleasePtr() *corev1.ContainerStateTerm return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerStateTerminatedDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerStateTerminatedDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerStateTerminatedDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerStateTerminatedDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5119,14 +7286,42 @@ func (d *EndpointsDie) DieFeedPtr(r *corev1.Endpoints) *EndpointsDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointsDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EndpointsDie) DieFeedJSON(j []byte) *EndpointsDie { + r := corev1.Endpoints{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EndpointsDie) DieFeedYAML(y []byte) *EndpointsDie { r := corev1.Endpoints{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EndpointsDie) DieFeedYAMLFile(name string) *EndpointsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointsDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EndpointsDie) DieRelease() corev1.Endpoints { if d.mutable { @@ -5141,21 +7336,45 @@ func (d *EndpointsDie) DieReleasePtr() *corev1.Endpoints { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *EndpointsDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EndpointsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EndpointsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5271,14 +7490,42 @@ func (d *EndpointSubsetDie) DieFeedPtr(r *corev1.EndpointSubset) *EndpointSubset return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointSubsetDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointSubsetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EndpointSubsetDie) DieFeedJSON(j []byte) *EndpointSubsetDie { r := corev1.EndpointSubset{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EndpointSubsetDie) DieFeedYAML(y []byte) *EndpointSubsetDie { + r := corev1.EndpointSubset{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EndpointSubsetDie) DieFeedYAMLFile(name string) *EndpointSubsetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointSubsetDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointSubsetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EndpointSubsetDie) DieRelease() corev1.EndpointSubset { if d.mutable { @@ -5293,12 +7540,33 @@ func (d *EndpointSubsetDie) DieReleasePtr() *corev1.EndpointSubset { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointSubsetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EndpointSubsetDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EndpointSubsetDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointSubsetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5376,14 +7644,42 @@ func (d *EndpointAddressDie) DieFeedPtr(r *corev1.EndpointAddress) *EndpointAddr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointAddressDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointAddressDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EndpointAddressDie) DieFeedJSON(j []byte) *EndpointAddressDie { r := corev1.EndpointAddress{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EndpointAddressDie) DieFeedYAML(y []byte) *EndpointAddressDie { + r := corev1.EndpointAddress{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EndpointAddressDie) DieFeedYAMLFile(name string) *EndpointAddressDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointAddressDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointAddressDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EndpointAddressDie) DieRelease() corev1.EndpointAddress { if d.mutable { @@ -5398,12 +7694,33 @@ func (d *EndpointAddressDie) DieReleasePtr() *corev1.EndpointAddress { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointAddressDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EndpointAddressDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EndpointAddressDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointAddressDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5488,14 +7805,42 @@ func (d *EndpointPortDie) DieFeedPtr(r *corev1.EndpointPort) *EndpointPortDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointPortDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointPortDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EndpointPortDie) DieFeedJSON(j []byte) *EndpointPortDie { r := corev1.EndpointPort{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EndpointPortDie) DieFeedYAML(y []byte) *EndpointPortDie { + r := corev1.EndpointPort{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EndpointPortDie) DieFeedYAMLFile(name string) *EndpointPortDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointPortDie) DieFeedRawExtension(raw runtime.RawExtension) *EndpointPortDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EndpointPortDie) DieRelease() corev1.EndpointPort { if d.mutable { @@ -5510,12 +7855,33 @@ func (d *EndpointPortDie) DieReleasePtr() *corev1.EndpointPort { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EndpointPortDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EndpointPortDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EndpointPortDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EndpointPortDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5603,14 +7969,42 @@ func (d *EventDie) DieFeedPtr(r *corev1.Event) *EventDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EventDie) DieFeedRawExtension(raw runtime.RawExtension) *EventDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EventDie) DieFeedJSON(j []byte) *EventDie { r := corev1.Event{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EventDie) DieFeedYAML(y []byte) *EventDie { + r := corev1.Event{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EventDie) DieFeedYAMLFile(name string) *EventDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventDie) DieFeedRawExtension(raw runtime.RawExtension) *EventDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EventDie) DieRelease() corev1.Event { if d.mutable { @@ -5625,21 +8019,45 @@ func (d *EventDie) DieReleasePtr() *corev1.Event { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *EventDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EventDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EventDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EventDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5846,14 +8264,42 @@ func (d *EventSourceDie) DieFeedPtr(r *corev1.EventSource) *EventSourceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EventSourceDie) DieFeedJSON(j []byte) *EventSourceDie { + r := corev1.EventSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EventSourceDie) DieFeedYAML(y []byte) *EventSourceDie { r := corev1.EventSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EventSourceDie) DieFeedYAMLFile(name string) *EventSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EventSourceDie) DieRelease() corev1.EventSource { if d.mutable { @@ -5868,12 +8314,33 @@ func (d *EventSourceDie) DieReleasePtr() *corev1.EventSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EventSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EventSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -5944,14 +8411,42 @@ func (d *EventSeriesDie) DieFeedPtr(r *corev1.EventSeries) *EventSeriesDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSeriesDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSeriesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EventSeriesDie) DieFeedJSON(j []byte) *EventSeriesDie { + r := corev1.EventSeries{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EventSeriesDie) DieFeedYAML(y []byte) *EventSeriesDie { r := corev1.EventSeries{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EventSeriesDie) DieFeedYAMLFile(name string) *EventSeriesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSeriesDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSeriesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EventSeriesDie) DieRelease() corev1.EventSeries { if d.mutable { @@ -5966,12 +8461,33 @@ func (d *EventSeriesDie) DieReleasePtr() *corev1.EventSeries { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSeriesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EventSeriesDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EventSeriesDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSeriesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6045,14 +8561,42 @@ func (d *LimitRangeDie) DieFeedPtr(r *corev1.LimitRange) *LimitRangeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LimitRangeDie) DieFeedJSON(j []byte) *LimitRangeDie { + r := corev1.LimitRange{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LimitRangeDie) DieFeedYAML(y []byte) *LimitRangeDie { r := corev1.LimitRange{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LimitRangeDie) DieFeedYAMLFile(name string) *LimitRangeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LimitRangeDie) DieRelease() corev1.LimitRange { if d.mutable { @@ -6067,21 +8611,45 @@ func (d *LimitRangeDie) DieReleasePtr() *corev1.LimitRange { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *LimitRangeDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LimitRangeDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LimitRangeDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6206,14 +8774,42 @@ func (d *LimitRangeSpecDie) DieFeedPtr(r *corev1.LimitRangeSpec) *LimitRangeSpec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LimitRangeSpecDie) DieFeedJSON(j []byte) *LimitRangeSpecDie { + r := corev1.LimitRangeSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LimitRangeSpecDie) DieFeedYAML(y []byte) *LimitRangeSpecDie { r := corev1.LimitRangeSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LimitRangeSpecDie) DieFeedYAMLFile(name string) *LimitRangeSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LimitRangeSpecDie) DieRelease() corev1.LimitRangeSpec { if d.mutable { @@ -6228,12 +8824,33 @@ func (d *LimitRangeSpecDie) DieReleasePtr() *corev1.LimitRangeSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LimitRangeSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LimitRangeSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6297,14 +8914,42 @@ func (d *LimitRangeItemDie) DieFeedPtr(r *corev1.LimitRangeItem) *LimitRangeItem return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeItemDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeItemDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LimitRangeItemDie) DieFeedJSON(j []byte) *LimitRangeItemDie { + r := corev1.LimitRangeItem{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LimitRangeItemDie) DieFeedYAML(y []byte) *LimitRangeItemDie { r := corev1.LimitRangeItem{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LimitRangeItemDie) DieFeedYAMLFile(name string) *LimitRangeItemDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeItemDie) DieFeedRawExtension(raw runtime.RawExtension) *LimitRangeItemDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LimitRangeItemDie) DieRelease() corev1.LimitRangeItem { if d.mutable { @@ -6319,12 +8964,33 @@ func (d *LimitRangeItemDie) DieReleasePtr() *corev1.LimitRangeItem { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LimitRangeItemDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LimitRangeItemDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LimitRangeItemDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LimitRangeItemDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6426,14 +9092,42 @@ func (d *NamespaceDie) DieFeedPtr(r *corev1.Namespace) *NamespaceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NamespaceDie) DieFeedJSON(j []byte) *NamespaceDie { + r := corev1.Namespace{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NamespaceDie) DieFeedYAML(y []byte) *NamespaceDie { r := corev1.Namespace{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NamespaceDie) DieFeedYAMLFile(name string) *NamespaceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NamespaceDie) DieRelease() corev1.Namespace { if d.mutable { @@ -6448,21 +9142,45 @@ func (d *NamespaceDie) DieReleasePtr() *corev1.Namespace { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *NamespaceDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NamespaceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NamespaceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6603,14 +9321,42 @@ func (d *NamespaceSpecDie) DieFeedPtr(r *corev1.NamespaceSpec) *NamespaceSpecDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NamespaceSpecDie) DieFeedJSON(j []byte) *NamespaceSpecDie { + r := corev1.NamespaceSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NamespaceSpecDie) DieFeedYAML(y []byte) *NamespaceSpecDie { r := corev1.NamespaceSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NamespaceSpecDie) DieFeedYAMLFile(name string) *NamespaceSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NamespaceSpecDie) DieRelease() corev1.NamespaceSpec { if d.mutable { @@ -6625,12 +9371,33 @@ func (d *NamespaceSpecDie) DieReleasePtr() *corev1.NamespaceSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NamespaceSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NamespaceSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6694,14 +9461,42 @@ func (d *NamespaceStatusDie) DieFeedPtr(r *corev1.NamespaceStatus) *NamespaceSta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NamespaceStatusDie) DieFeedJSON(j []byte) *NamespaceStatusDie { + r := corev1.NamespaceStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NamespaceStatusDie) DieFeedYAML(y []byte) *NamespaceStatusDie { r := corev1.NamespaceStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NamespaceStatusDie) DieFeedYAMLFile(name string) *NamespaceStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NamespaceStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NamespaceStatusDie) DieRelease() corev1.NamespaceStatus { if d.mutable { @@ -6716,12 +9511,33 @@ func (d *NamespaceStatusDie) DieReleasePtr() *corev1.NamespaceStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NamespaceStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NamespaceStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NamespaceStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NamespaceStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6795,14 +9611,42 @@ func (d *NodeDie) DieFeedPtr(r *corev1.Node) *NodeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeDie) DieFeedJSON(j []byte) *NodeDie { + r := corev1.Node{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeDie) DieFeedYAML(y []byte) *NodeDie { r := corev1.Node{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeDie) DieFeedYAMLFile(name string) *NodeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeDie) DieRelease() corev1.Node { if d.mutable { @@ -6817,21 +9661,45 @@ func (d *NodeDie) DieReleasePtr() *corev1.Node { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *NodeDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -6972,14 +9840,42 @@ func (d *NodeSpecDie) DieFeedPtr(r *corev1.NodeSpec) *NodeSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeSpecDie) DieFeedJSON(j []byte) *NodeSpecDie { + r := corev1.NodeSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeSpecDie) DieFeedYAML(y []byte) *NodeSpecDie { r := corev1.NodeSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeSpecDie) DieFeedYAMLFile(name string) *NodeSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeSpecDie) DieRelease() corev1.NodeSpec { if d.mutable { @@ -6994,12 +9890,33 @@ func (d *NodeSpecDie) DieReleasePtr() *corev1.NodeSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7105,14 +10022,42 @@ func (d *TaintDie) DieFeedPtr(r *corev1.Taint) *TaintDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TaintDie) DieFeedRawExtension(raw runtime.RawExtension) *TaintDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TaintDie) DieFeedJSON(j []byte) *TaintDie { + r := corev1.Taint{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TaintDie) DieFeedYAML(y []byte) *TaintDie { r := corev1.Taint{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TaintDie) DieFeedYAMLFile(name string) *TaintDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TaintDie) DieFeedRawExtension(raw runtime.RawExtension) *TaintDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TaintDie) DieRelease() corev1.Taint { if d.mutable { @@ -7127,12 +10072,33 @@ func (d *TaintDie) DieReleasePtr() *corev1.Taint { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TaintDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TaintDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TaintDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TaintDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7214,15 +10180,43 @@ func (d *NodeConfigSourceDie) DieFeedPtr(r *corev1.NodeConfigSource) *NodeConfig if r == nil { r = &corev1.NodeConfigSource{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeConfigSourceDie) DieFeedJSON(j []byte) *NodeConfigSourceDie { + r := corev1.NodeConfigSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeConfigSourceDie) DieFeedYAML(y []byte) *NodeConfigSourceDie { + r := corev1.NodeConfigSource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeConfigSourceDie) DieFeedYAMLFile(name string) *NodeConfigSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *NodeConfigSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeConfigSourceDie { - b, _ := json.Marshal(raw) - r := corev1.NodeConfigSource{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -7239,12 +10233,33 @@ func (d *NodeConfigSourceDie) DieReleasePtr() *corev1.NodeConfigSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeConfigSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeConfigSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeConfigSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeConfigSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7308,14 +10323,42 @@ func (d *ConfigMapNodeConfigSourceDie) DieFeedPtr(r *corev1.ConfigMapNodeConfigS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapNodeConfigSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapNodeConfigSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieFeedJSON(j []byte) *ConfigMapNodeConfigSourceDie { r := corev1.ConfigMapNodeConfigSource{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieFeedYAML(y []byte) *ConfigMapNodeConfigSourceDie { + r := corev1.ConfigMapNodeConfigSource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieFeedYAMLFile(name string) *ConfigMapNodeConfigSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapNodeConfigSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapNodeConfigSourceDie) DieRelease() corev1.ConfigMapNodeConfigSource { if d.mutable { @@ -7330,12 +10373,33 @@ func (d *ConfigMapNodeConfigSourceDie) DieReleasePtr() *corev1.ConfigMapNodeConf return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapNodeConfigSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapNodeConfigSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7427,14 +10491,42 @@ func (d *NodeStatusDie) DieFeedPtr(r *corev1.NodeStatus) *NodeStatusDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeStatusDie) DieFeedJSON(j []byte) *NodeStatusDie { r := corev1.NodeStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeStatusDie) DieFeedYAML(y []byte) *NodeStatusDie { + r := corev1.NodeStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeStatusDie) DieFeedYAMLFile(name string) *NodeStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeStatusDie) DieRelease() corev1.NodeStatus { if d.mutable { @@ -7449,12 +10541,33 @@ func (d *NodeStatusDie) DieReleasePtr() *corev1.NodeStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7588,14 +10701,42 @@ func (d *NodeAddressDie) DieFeedPtr(r *corev1.NodeAddress) *NodeAddressDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeAddressDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeAddressDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeAddressDie) DieFeedJSON(j []byte) *NodeAddressDie { r := corev1.NodeAddress{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeAddressDie) DieFeedYAML(y []byte) *NodeAddressDie { + r := corev1.NodeAddress{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeAddressDie) DieFeedYAMLFile(name string) *NodeAddressDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeAddressDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeAddressDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeAddressDie) DieRelease() corev1.NodeAddress { if d.mutable { @@ -7610,12 +10751,33 @@ func (d *NodeAddressDie) DieReleasePtr() *corev1.NodeAddress { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeAddressDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeAddressDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeAddressDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeAddressDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7686,14 +10848,42 @@ func (d *NodeDaemonEndpointsDie) DieFeedPtr(r *corev1.NodeDaemonEndpoints) *Node return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeDaemonEndpointsDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeDaemonEndpointsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeDaemonEndpointsDie) DieFeedJSON(j []byte) *NodeDaemonEndpointsDie { r := corev1.NodeDaemonEndpoints{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeDaemonEndpointsDie) DieFeedYAML(y []byte) *NodeDaemonEndpointsDie { + r := corev1.NodeDaemonEndpoints{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeDaemonEndpointsDie) DieFeedYAMLFile(name string) *NodeDaemonEndpointsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeDaemonEndpointsDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeDaemonEndpointsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeDaemonEndpointsDie) DieRelease() corev1.NodeDaemonEndpoints { if d.mutable { @@ -7708,12 +10898,33 @@ func (d *NodeDaemonEndpointsDie) DieReleasePtr() *corev1.NodeDaemonEndpoints { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeDaemonEndpointsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeDaemonEndpointsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeDaemonEndpointsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeDaemonEndpointsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7777,14 +10988,42 @@ func (d *DaemonEndpointDie) DieFeedPtr(r *corev1.DaemonEndpoint) *DaemonEndpoint return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonEndpointDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonEndpointDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DaemonEndpointDie) DieFeedJSON(j []byte) *DaemonEndpointDie { r := corev1.DaemonEndpoint{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DaemonEndpointDie) DieFeedYAML(y []byte) *DaemonEndpointDie { + r := corev1.DaemonEndpoint{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DaemonEndpointDie) DieFeedYAMLFile(name string) *DaemonEndpointDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonEndpointDie) DieFeedRawExtension(raw runtime.RawExtension) *DaemonEndpointDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DaemonEndpointDie) DieRelease() corev1.DaemonEndpoint { if d.mutable { @@ -7799,12 +11038,33 @@ func (d *DaemonEndpointDie) DieReleasePtr() *corev1.DaemonEndpoint { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DaemonEndpointDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DaemonEndpointDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DaemonEndpointDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DaemonEndpointDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -7868,14 +11128,42 @@ func (d *NodeSystemInfoDie) DieFeedPtr(r *corev1.NodeSystemInfo) *NodeSystemInfo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSystemInfoDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSystemInfoDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeSystemInfoDie) DieFeedJSON(j []byte) *NodeSystemInfoDie { r := corev1.NodeSystemInfo{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeSystemInfoDie) DieFeedYAML(y []byte) *NodeSystemInfoDie { + r := corev1.NodeSystemInfo{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeSystemInfoDie) DieFeedYAMLFile(name string) *NodeSystemInfoDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSystemInfoDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSystemInfoDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeSystemInfoDie) DieRelease() corev1.NodeSystemInfo { if d.mutable { @@ -7890,12 +11178,33 @@ func (d *NodeSystemInfoDie) DieReleasePtr() *corev1.NodeSystemInfo { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSystemInfoDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeSystemInfoDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeSystemInfoDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSystemInfoDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8022,14 +11331,42 @@ func (d *ContainerImageDie) DieFeedPtr(r *corev1.ContainerImage) *ContainerImage return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerImageDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerImageDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ContainerImageDie) DieFeedJSON(j []byte) *ContainerImageDie { r := corev1.ContainerImage{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ContainerImageDie) DieFeedYAML(y []byte) *ContainerImageDie { + r := corev1.ContainerImage{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ContainerImageDie) DieFeedYAMLFile(name string) *ContainerImageDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerImageDie) DieFeedRawExtension(raw runtime.RawExtension) *ContainerImageDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ContainerImageDie) DieRelease() corev1.ContainerImage { if d.mutable { @@ -8044,12 +11381,33 @@ func (d *ContainerImageDie) DieReleasePtr() *corev1.ContainerImage { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ContainerImageDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ContainerImageDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ContainerImageDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ContainerImageDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8120,14 +11478,42 @@ func (d *AttachedVolumeDie) DieFeedPtr(r *corev1.AttachedVolume) *AttachedVolume return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AttachedVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *AttachedVolumeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AttachedVolumeDie) DieFeedJSON(j []byte) *AttachedVolumeDie { r := corev1.AttachedVolume{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AttachedVolumeDie) DieFeedYAML(y []byte) *AttachedVolumeDie { + r := corev1.AttachedVolume{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AttachedVolumeDie) DieFeedYAMLFile(name string) *AttachedVolumeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AttachedVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *AttachedVolumeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AttachedVolumeDie) DieRelease() corev1.AttachedVolume { if d.mutable { @@ -8142,12 +11528,33 @@ func (d *AttachedVolumeDie) DieReleasePtr() *corev1.AttachedVolume { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AttachedVolumeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AttachedVolumeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AttachedVolumeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AttachedVolumeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8218,14 +11625,42 @@ func (d *NodeConfigStatusDie) DieFeedPtr(r *corev1.NodeConfigStatus) *NodeConfig return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeConfigStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeConfigStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeConfigStatusDie) DieFeedJSON(j []byte) *NodeConfigStatusDie { r := corev1.NodeConfigStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeConfigStatusDie) DieFeedYAML(y []byte) *NodeConfigStatusDie { + r := corev1.NodeConfigStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeConfigStatusDie) DieFeedYAMLFile(name string) *NodeConfigStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeConfigStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeConfigStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeConfigStatusDie) DieRelease() corev1.NodeConfigStatus { if d.mutable { @@ -8240,12 +11675,33 @@ func (d *NodeConfigStatusDie) DieReleasePtr() *corev1.NodeConfigStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeConfigStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeConfigStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeConfigStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeConfigStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8333,14 +11789,42 @@ func (d *PersistentVolumeDie) DieFeedPtr(r *corev1.PersistentVolume) *Persistent return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeDie) DieFeedJSON(j []byte) *PersistentVolumeDie { r := corev1.PersistentVolume{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeDie) DieFeedYAML(y []byte) *PersistentVolumeDie { + r := corev1.PersistentVolume{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeDie) DieFeedYAMLFile(name string) *PersistentVolumeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeDie) DieRelease() corev1.PersistentVolume { if d.mutable { @@ -8355,21 +11839,45 @@ func (d *PersistentVolumeDie) DieReleasePtr() *corev1.PersistentVolume { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PersistentVolumeDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) - return &unstructured.Unstructured{ - Object: u, + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } + return &unstructured.Unstructured{ + Object: u, + } +} + +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) } + return y } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *PersistentVolumeDie) DieReleaseRawExtension() runtime.RawExtension { - r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8510,14 +12018,42 @@ func (d *PersistentVolumeSpecDie) DieFeedPtr(r *corev1.PersistentVolumeSpec) *Pe return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeSpecDie) DieFeedJSON(j []byte) *PersistentVolumeSpecDie { + r := corev1.PersistentVolumeSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeSpecDie) DieFeedYAML(y []byte) *PersistentVolumeSpecDie { r := corev1.PersistentVolumeSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeSpecDie) DieFeedYAMLFile(name string) *PersistentVolumeSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeSpecDie) DieRelease() corev1.PersistentVolumeSpec { if d.mutable { @@ -8532,12 +12068,33 @@ func (d *PersistentVolumeSpecDie) DieReleasePtr() *corev1.PersistentVolumeSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8657,14 +12214,42 @@ func (d *PersistentVolumeStatusDie) DieFeedPtr(r *corev1.PersistentVolumeStatus) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeStatusDie) DieFeedJSON(j []byte) *PersistentVolumeStatusDie { + r := corev1.PersistentVolumeStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeStatusDie) DieFeedYAML(y []byte) *PersistentVolumeStatusDie { r := corev1.PersistentVolumeStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeStatusDie) DieFeedYAMLFile(name string) *PersistentVolumeStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeStatusDie) DieRelease() corev1.PersistentVolumeStatus { if d.mutable { @@ -8679,12 +12264,33 @@ func (d *PersistentVolumeStatusDie) DieReleasePtr() *corev1.PersistentVolumeStat return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8762,14 +12368,42 @@ func (d *GlusterfsPersistentVolumeSourceDie) DieFeedPtr(r *corev1.GlusterfsPersi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GlusterfsPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GlusterfsPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieFeedJSON(j []byte) *GlusterfsPersistentVolumeSourceDie { + r := corev1.GlusterfsPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieFeedYAML(y []byte) *GlusterfsPersistentVolumeSourceDie { r := corev1.GlusterfsPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *GlusterfsPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GlusterfsPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GlusterfsPersistentVolumeSourceDie) DieRelease() corev1.GlusterfsPersistentVolumeSource { if d.mutable { @@ -8784,12 +12418,33 @@ func (d *GlusterfsPersistentVolumeSourceDie) DieReleasePtr() *corev1.GlusterfsPe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GlusterfsPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GlusterfsPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -8874,14 +12529,42 @@ func (d *RBDPersistentVolumeSourceDie) DieFeedPtr(r *corev1.RBDPersistentVolumeS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RBDPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *RBDPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieFeedJSON(j []byte) *RBDPersistentVolumeSourceDie { + r := corev1.RBDPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieFeedYAML(y []byte) *RBDPersistentVolumeSourceDie { r := corev1.RBDPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *RBDPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *RBDPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RBDPersistentVolumeSourceDie) DieRelease() corev1.RBDPersistentVolumeSource { if d.mutable { @@ -8896,12 +12579,33 @@ func (d *RBDPersistentVolumeSourceDie) DieReleasePtr() *corev1.RBDPersistentVolu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RBDPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RBDPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9014,14 +12718,42 @@ func (d *ISCSIPersistentVolumeSourceDie) DieFeedPtr(r *corev1.ISCSIPersistentVol return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ISCSIPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ISCSIPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieFeedJSON(j []byte) *ISCSIPersistentVolumeSourceDie { + r := corev1.ISCSIPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieFeedYAML(y []byte) *ISCSIPersistentVolumeSourceDie { r := corev1.ISCSIPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *ISCSIPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ISCSIPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ISCSIPersistentVolumeSourceDie) DieRelease() corev1.ISCSIPersistentVolumeSource { if d.mutable { @@ -9036,12 +12768,33 @@ func (d *ISCSIPersistentVolumeSourceDie) DieReleasePtr() *corev1.ISCSIPersistent return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ISCSIPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ISCSIPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9175,14 +12928,42 @@ func (d *CinderPersistentVolumeSourceDie) DieFeedPtr(r *corev1.CinderPersistentV return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CinderPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CinderPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieFeedJSON(j []byte) *CinderPersistentVolumeSourceDie { + r := corev1.CinderPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieFeedYAML(y []byte) *CinderPersistentVolumeSourceDie { r := corev1.CinderPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *CinderPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CinderPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CinderPersistentVolumeSourceDie) DieRelease() corev1.CinderPersistentVolumeSource { if d.mutable { @@ -9197,12 +12978,33 @@ func (d *CinderPersistentVolumeSourceDie) DieReleasePtr() *corev1.CinderPersiste return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CinderPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CinderPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9287,14 +13089,42 @@ func (d *CephFSPersistentVolumeSourceDie) DieFeedPtr(r *corev1.CephFSPersistentV return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CephFSPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CephFSPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieFeedJSON(j []byte) *CephFSPersistentVolumeSourceDie { + r := corev1.CephFSPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieFeedYAML(y []byte) *CephFSPersistentVolumeSourceDie { r := corev1.CephFSPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *CephFSPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CephFSPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CephFSPersistentVolumeSourceDie) DieRelease() corev1.CephFSPersistentVolumeSource { if d.mutable { @@ -9309,12 +13139,33 @@ func (d *CephFSPersistentVolumeSourceDie) DieReleasePtr() *corev1.CephFSPersiste return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CephFSPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CephFSPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9413,14 +13264,42 @@ func (d *FlexPersistentVolumeSourceDie) DieFeedPtr(r *corev1.FlexPersistentVolum return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlexPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlexPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieFeedJSON(j []byte) *FlexPersistentVolumeSourceDie { + r := corev1.FlexPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieFeedYAML(y []byte) *FlexPersistentVolumeSourceDie { r := corev1.FlexPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *FlexPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlexPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlexPersistentVolumeSourceDie) DieRelease() corev1.FlexPersistentVolumeSource { if d.mutable { @@ -9435,12 +13314,33 @@ func (d *FlexPersistentVolumeSourceDie) DieReleasePtr() *corev1.FlexPersistentVo return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlexPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlexPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9532,14 +13432,42 @@ func (d *AzureFilePersistentVolumeSourceDie) DieFeedPtr(r *corev1.AzureFilePersi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureFilePersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureFilePersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieFeedJSON(j []byte) *AzureFilePersistentVolumeSourceDie { + r := corev1.AzureFilePersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieFeedYAML(y []byte) *AzureFilePersistentVolumeSourceDie { r := corev1.AzureFilePersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieFeedYAMLFile(name string) *AzureFilePersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureFilePersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AzureFilePersistentVolumeSourceDie) DieRelease() corev1.AzureFilePersistentVolumeSource { if d.mutable { @@ -9554,12 +13482,33 @@ func (d *AzureFilePersistentVolumeSourceDie) DieReleasePtr() *corev1.AzureFilePe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureFilePersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureFilePersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9644,14 +13593,42 @@ func (d *ScaleIOPersistentVolumeSourceDie) DieFeedPtr(r *corev1.ScaleIOPersisten return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ScaleIOPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ScaleIOPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieFeedJSON(j []byte) *ScaleIOPersistentVolumeSourceDie { + r := corev1.ScaleIOPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieFeedYAML(y []byte) *ScaleIOPersistentVolumeSourceDie { r := corev1.ScaleIOPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *ScaleIOPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ScaleIOPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ScaleIOPersistentVolumeSourceDie) DieRelease() corev1.ScaleIOPersistentVolumeSource { if d.mutable { @@ -9666,12 +13643,33 @@ func (d *ScaleIOPersistentVolumeSourceDie) DieReleasePtr() *corev1.ScaleIOPersis return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ScaleIOPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScaleIOPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9795,15 +13793,43 @@ func (d *LocalVolumeSourceDie) DieFeedPtr(r *corev1.LocalVolumeSource) *LocalVol if r == nil { r = &corev1.LocalVolumeSource{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LocalVolumeSourceDie) DieFeedJSON(j []byte) *LocalVolumeSourceDie { + r := corev1.LocalVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LocalVolumeSourceDie) DieFeedYAML(y []byte) *LocalVolumeSourceDie { + r := corev1.LocalVolumeSource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LocalVolumeSourceDie) DieFeedYAMLFile(name string) *LocalVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *LocalVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *LocalVolumeSourceDie { - b, _ := json.Marshal(raw) - r := corev1.LocalVolumeSource{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -9820,12 +13846,33 @@ func (d *LocalVolumeSourceDie) DieReleasePtr() *corev1.LocalVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LocalVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LocalVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LocalVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LocalVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -9896,14 +13943,42 @@ func (d *StorageOSPersistentVolumeSourceDie) DieFeedPtr(r *corev1.StorageOSPersi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageOSPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageOSPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieFeedJSON(j []byte) *StorageOSPersistentVolumeSourceDie { + r := corev1.StorageOSPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieFeedYAML(y []byte) *StorageOSPersistentVolumeSourceDie { r := corev1.StorageOSPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *StorageOSPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageOSPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StorageOSPersistentVolumeSourceDie) DieRelease() corev1.StorageOSPersistentVolumeSource { if d.mutable { @@ -9918,12 +13993,33 @@ func (d *StorageOSPersistentVolumeSourceDie) DieReleasePtr() *corev1.StorageOSPe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageOSPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageOSPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10015,14 +14111,42 @@ func (d *CSIPersistentVolumeSourceDie) DieFeedPtr(r *corev1.CSIPersistentVolumeS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIPersistentVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieFeedJSON(j []byte) *CSIPersistentVolumeSourceDie { + r := corev1.CSIPersistentVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieFeedYAML(y []byte) *CSIPersistentVolumeSourceDie { r := corev1.CSIPersistentVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieFeedYAMLFile(name string) *CSIPersistentVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIPersistentVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSIPersistentVolumeSourceDie) DieRelease() corev1.CSIPersistentVolumeSource { if d.mutable { @@ -10037,12 +14161,33 @@ func (d *CSIPersistentVolumeSourceDie) DieReleasePtr() *corev1.CSIPersistentVolu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIPersistentVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10169,14 +14314,42 @@ func (d *VolumeNodeAffinityDie) DieFeedPtr(r *corev1.VolumeNodeAffinity) *Volume return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeNodeAffinityDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeNodeAffinityDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeNodeAffinityDie) DieFeedJSON(j []byte) *VolumeNodeAffinityDie { + r := corev1.VolumeNodeAffinity{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeNodeAffinityDie) DieFeedYAML(y []byte) *VolumeNodeAffinityDie { r := corev1.VolumeNodeAffinity{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeNodeAffinityDie) DieFeedYAMLFile(name string) *VolumeNodeAffinityDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeNodeAffinityDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeNodeAffinityDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeNodeAffinityDie) DieRelease() corev1.VolumeNodeAffinity { if d.mutable { @@ -10191,12 +14364,33 @@ func (d *VolumeNodeAffinityDie) DieReleasePtr() *corev1.VolumeNodeAffinity { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeNodeAffinityDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeNodeAffinityDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeNodeAffinityDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeNodeAffinityDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10260,14 +14454,42 @@ func (d *NodeSelectorDie) DieFeedPtr(r *corev1.NodeSelector) *NodeSelectorDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeSelectorDie) DieFeedJSON(j []byte) *NodeSelectorDie { + r := corev1.NodeSelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeSelectorDie) DieFeedYAML(y []byte) *NodeSelectorDie { r := corev1.NodeSelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeSelectorDie) DieFeedYAMLFile(name string) *NodeSelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeSelectorDie) DieRelease() corev1.NodeSelector { if d.mutable { @@ -10282,12 +14504,33 @@ func (d *NodeSelectorDie) DieReleasePtr() *corev1.NodeSelector { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeSelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeSelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10351,14 +14594,42 @@ func (d *NodeSelectorTermDie) DieFeedPtr(r *corev1.NodeSelectorTerm) *NodeSelect return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorTermDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorTermDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeSelectorTermDie) DieFeedJSON(j []byte) *NodeSelectorTermDie { + r := corev1.NodeSelectorTerm{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeSelectorTermDie) DieFeedYAML(y []byte) *NodeSelectorTermDie { r := corev1.NodeSelectorTerm{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeSelectorTermDie) DieFeedYAMLFile(name string) *NodeSelectorTermDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorTermDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorTermDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeSelectorTermDie) DieRelease() corev1.NodeSelectorTerm { if d.mutable { @@ -10373,12 +14644,33 @@ func (d *NodeSelectorTermDie) DieReleasePtr() *corev1.NodeSelectorTerm { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorTermDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeSelectorTermDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeSelectorTermDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorTermDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10449,14 +14741,42 @@ func (d *NodeSelectorRequirementDie) DieFeedPtr(r *corev1.NodeSelectorRequiremen return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorRequirementDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NodeSelectorRequirementDie) DieFeedJSON(j []byte) *NodeSelectorRequirementDie { + r := corev1.NodeSelectorRequirement{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NodeSelectorRequirementDie) DieFeedYAML(y []byte) *NodeSelectorRequirementDie { r := corev1.NodeSelectorRequirement{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NodeSelectorRequirementDie) DieFeedYAMLFile(name string) *NodeSelectorRequirementDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *NodeSelectorRequirementDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NodeSelectorRequirementDie) DieRelease() corev1.NodeSelectorRequirement { if d.mutable { @@ -10471,12 +14791,33 @@ func (d *NodeSelectorRequirementDie) DieReleasePtr() *corev1.NodeSelectorRequire return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NodeSelectorRequirementDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NodeSelectorRequirementDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NodeSelectorRequirementDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NodeSelectorRequirementDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10557,14 +14898,42 @@ func (d *PersistentVolumeClaimDie) DieFeedPtr(r *corev1.PersistentVolumeClaim) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeClaimDie) DieFeedJSON(j []byte) *PersistentVolumeClaimDie { + r := corev1.PersistentVolumeClaim{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeClaimDie) DieFeedYAML(y []byte) *PersistentVolumeClaimDie { r := corev1.PersistentVolumeClaim{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeClaimDie) DieFeedYAMLFile(name string) *PersistentVolumeClaimDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeClaimDie) DieRelease() corev1.PersistentVolumeClaim { if d.mutable { @@ -10579,21 +14948,45 @@ func (d *PersistentVolumeClaimDie) DieReleasePtr() *corev1.PersistentVolumeClaim return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PersistentVolumeClaimDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeClaimDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeClaimDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10734,14 +15127,42 @@ func (d *PersistentVolumeClaimSpecDie) DieFeedPtr(r *corev1.PersistentVolumeClai return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieFeedJSON(j []byte) *PersistentVolumeClaimSpecDie { + r := corev1.PersistentVolumeClaimSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieFeedYAML(y []byte) *PersistentVolumeClaimSpecDie { r := corev1.PersistentVolumeClaimSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieFeedYAMLFile(name string) *PersistentVolumeClaimSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeClaimSpecDie) DieRelease() corev1.PersistentVolumeClaimSpec { if d.mutable { @@ -10756,12 +15177,33 @@ func (d *PersistentVolumeClaimSpecDie) DieReleasePtr() *corev1.PersistentVolumeC return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -10874,14 +15316,42 @@ func (d *PersistentVolumeClaimStatusDie) DieFeedPtr(r *corev1.PersistentVolumeCl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieFeedJSON(j []byte) *PersistentVolumeClaimStatusDie { + r := corev1.PersistentVolumeClaimStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieFeedYAML(y []byte) *PersistentVolumeClaimStatusDie { r := corev1.PersistentVolumeClaimStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieFeedYAMLFile(name string) *PersistentVolumeClaimStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeClaimStatusDie) DieRelease() corev1.PersistentVolumeClaimStatus { if d.mutable { @@ -10896,12 +15366,33 @@ func (d *PersistentVolumeClaimStatusDie) DieReleasePtr() *corev1.PersistentVolum return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11000,14 +15491,42 @@ func (d *PersistentVolumeClaimTemplateDie) DieFeedPtr(r *corev1.PersistentVolume return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimTemplateDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimTemplateDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieFeedJSON(j []byte) *PersistentVolumeClaimTemplateDie { + r := corev1.PersistentVolumeClaimTemplate{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieFeedYAML(y []byte) *PersistentVolumeClaimTemplateDie { r := corev1.PersistentVolumeClaimTemplate{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieFeedYAMLFile(name string) *PersistentVolumeClaimTemplateDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimTemplateDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeClaimTemplateDie) DieRelease() corev1.PersistentVolumeClaimTemplate { if d.mutable { @@ -11022,12 +15541,33 @@ func (d *PersistentVolumeClaimTemplateDie) DieReleasePtr() *corev1.PersistentVol return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimTemplateDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimTemplateDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11101,14 +15641,42 @@ func (d *PodDie) DieFeedPtr(r *corev1.Pod) *PodDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDie) DieFeedJSON(j []byte) *PodDie { + r := corev1.Pod{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDie) DieFeedYAML(y []byte) *PodDie { r := corev1.Pod{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDie) DieFeedYAMLFile(name string) *PodDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodDie) DieRelease() corev1.Pod { if d.mutable { @@ -11123,21 +15691,45 @@ func (d *PodDie) DieReleasePtr() *corev1.Pod { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PodDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11278,14 +15870,42 @@ func (d *PodSpecDie) DieFeedPtr(r *corev1.PodSpec) *PodSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodSpecDie) DieFeedJSON(j []byte) *PodSpecDie { + r := corev1.PodSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodSpecDie) DieFeedYAML(y []byte) *PodSpecDie { r := corev1.PodSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodSpecDie) DieFeedYAMLFile(name string) *PodSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodSpecDie) DieRelease() corev1.PodSpec { if d.mutable { @@ -11300,12 +15920,33 @@ func (d *PodSpecDie) DieReleasePtr() *corev1.PodSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11645,14 +16286,42 @@ func (d *PodSchedulingGateDie) DieFeedPtr(r *corev1.PodSchedulingGate) *PodSched return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSchedulingGateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSchedulingGateDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodSchedulingGateDie) DieFeedJSON(j []byte) *PodSchedulingGateDie { + r := corev1.PodSchedulingGate{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodSchedulingGateDie) DieFeedYAML(y []byte) *PodSchedulingGateDie { r := corev1.PodSchedulingGate{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodSchedulingGateDie) DieFeedYAMLFile(name string) *PodSchedulingGateDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSchedulingGateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSchedulingGateDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodSchedulingGateDie) DieRelease() corev1.PodSchedulingGate { if d.mutable { @@ -11667,12 +16336,33 @@ func (d *PodSchedulingGateDie) DieReleasePtr() *corev1.PodSchedulingGate { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSchedulingGateDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodSchedulingGateDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodSchedulingGateDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSchedulingGateDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11736,14 +16426,42 @@ func (d *PodResourceClaimDie) DieFeedPtr(r *corev1.PodResourceClaim) *PodResourc return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodResourceClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *PodResourceClaimDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodResourceClaimDie) DieFeedJSON(j []byte) *PodResourceClaimDie { + r := corev1.PodResourceClaim{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodResourceClaimDie) DieFeedYAML(y []byte) *PodResourceClaimDie { r := corev1.PodResourceClaim{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodResourceClaimDie) DieFeedYAMLFile(name string) *PodResourceClaimDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodResourceClaimDie) DieFeedRawExtension(raw runtime.RawExtension) *PodResourceClaimDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodResourceClaimDie) DieRelease() corev1.PodResourceClaim { if d.mutable { @@ -11758,12 +16476,33 @@ func (d *PodResourceClaimDie) DieReleasePtr() *corev1.PodResourceClaim { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodResourceClaimDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodResourceClaimDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodResourceClaimDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodResourceClaimDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11834,14 +16573,42 @@ func (d *ClaimSourceDie) DieFeedPtr(r *corev1.ClaimSource) *ClaimSourceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ClaimSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ClaimSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ClaimSourceDie) DieFeedJSON(j []byte) *ClaimSourceDie { + r := corev1.ClaimSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ClaimSourceDie) DieFeedYAML(y []byte) *ClaimSourceDie { r := corev1.ClaimSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ClaimSourceDie) DieFeedYAMLFile(name string) *ClaimSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClaimSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ClaimSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ClaimSourceDie) DieRelease() corev1.ClaimSource { if d.mutable { @@ -11856,12 +16623,33 @@ func (d *ClaimSourceDie) DieReleasePtr() *corev1.ClaimSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ClaimSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ClaimSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ClaimSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClaimSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -11938,14 +16726,42 @@ func (d *PodSecurityContextDie) DieFeedPtr(r *corev1.PodSecurityContext) *PodSec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityContextDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityContextDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodSecurityContextDie) DieFeedJSON(j []byte) *PodSecurityContextDie { + r := corev1.PodSecurityContext{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodSecurityContextDie) DieFeedYAML(y []byte) *PodSecurityContextDie { r := corev1.PodSecurityContext{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodSecurityContextDie) DieFeedYAMLFile(name string) *PodSecurityContextDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityContextDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityContextDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodSecurityContextDie) DieRelease() corev1.PodSecurityContext { if d.mutable { @@ -11960,12 +16776,33 @@ func (d *PodSecurityContextDie) DieReleasePtr() *corev1.PodSecurityContext { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityContextDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodSecurityContextDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodSecurityContextDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityContextDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12096,14 +16933,42 @@ func (d *SysctlDie) DieFeedPtr(r *corev1.Sysctl) *SysctlDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SysctlDie) DieFeedRawExtension(raw runtime.RawExtension) *SysctlDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SysctlDie) DieFeedJSON(j []byte) *SysctlDie { + r := corev1.Sysctl{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SysctlDie) DieFeedYAML(y []byte) *SysctlDie { r := corev1.Sysctl{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SysctlDie) DieFeedYAMLFile(name string) *SysctlDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SysctlDie) DieFeedRawExtension(raw runtime.RawExtension) *SysctlDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SysctlDie) DieRelease() corev1.Sysctl { if d.mutable { @@ -12118,12 +16983,33 @@ func (d *SysctlDie) DieReleasePtr() *corev1.Sysctl { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SysctlDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SysctlDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SysctlDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SysctlDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12194,14 +17080,42 @@ func (d *TolerationDie) DieFeedPtr(r *corev1.Toleration) *TolerationDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TolerationDie) DieFeedRawExtension(raw runtime.RawExtension) *TolerationDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TolerationDie) DieFeedJSON(j []byte) *TolerationDie { + r := corev1.Toleration{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TolerationDie) DieFeedYAML(y []byte) *TolerationDie { r := corev1.Toleration{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TolerationDie) DieFeedYAMLFile(name string) *TolerationDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TolerationDie) DieFeedRawExtension(raw runtime.RawExtension) *TolerationDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TolerationDie) DieRelease() corev1.Toleration { if d.mutable { @@ -12216,12 +17130,33 @@ func (d *TolerationDie) DieReleasePtr() *corev1.Toleration { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TolerationDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TolerationDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TolerationDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TolerationDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12313,14 +17248,42 @@ func (d *HostAliasDie) DieFeedPtr(r *corev1.HostAlias) *HostAliasDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HostAliasDie) DieFeedRawExtension(raw runtime.RawExtension) *HostAliasDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HostAliasDie) DieFeedJSON(j []byte) *HostAliasDie { + r := corev1.HostAlias{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HostAliasDie) DieFeedYAML(y []byte) *HostAliasDie { r := corev1.HostAlias{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HostAliasDie) DieFeedYAMLFile(name string) *HostAliasDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostAliasDie) DieFeedRawExtension(raw runtime.RawExtension) *HostAliasDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HostAliasDie) DieRelease() corev1.HostAlias { if d.mutable { @@ -12335,12 +17298,33 @@ func (d *HostAliasDie) DieReleasePtr() *corev1.HostAlias { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HostAliasDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HostAliasDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HostAliasDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostAliasDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12411,14 +17395,42 @@ func (d *PodDNSConfigDie) DieFeedPtr(r *corev1.PodDNSConfig) *PodDNSConfigDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDNSConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDNSConfigDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDNSConfigDie) DieFeedJSON(j []byte) *PodDNSConfigDie { + r := corev1.PodDNSConfig{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDNSConfigDie) DieFeedYAML(y []byte) *PodDNSConfigDie { r := corev1.PodDNSConfig{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDNSConfigDie) DieFeedYAMLFile(name string) *PodDNSConfigDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDNSConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDNSConfigDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodDNSConfigDie) DieRelease() corev1.PodDNSConfig { if d.mutable { @@ -12433,12 +17445,33 @@ func (d *PodDNSConfigDie) DieReleasePtr() *corev1.PodDNSConfig { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDNSConfigDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDNSConfigDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDNSConfigDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDNSConfigDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12513,15 +17546,43 @@ func (d *PodDNSConfigOptionDie) DieFeedPtr(r *corev1.PodDNSConfigOption) *PodDNS if r == nil { r = &corev1.PodDNSConfigOption{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDNSConfigOptionDie) DieFeedJSON(j []byte) *PodDNSConfigOptionDie { + r := corev1.PodDNSConfigOption{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDNSConfigOptionDie) DieFeedYAML(y []byte) *PodDNSConfigOptionDie { + r := corev1.PodDNSConfigOption{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDNSConfigOptionDie) DieFeedYAMLFile(name string) *PodDNSConfigOptionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *PodDNSConfigOptionDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDNSConfigOptionDie { - b, _ := json.Marshal(raw) - r := corev1.PodDNSConfigOption{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -12538,12 +17599,33 @@ func (d *PodDNSConfigOptionDie) DieReleasePtr() *corev1.PodDNSConfigOption { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDNSConfigOptionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDNSConfigOptionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDNSConfigOptionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDNSConfigOptionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12613,14 +17695,42 @@ func (d *PodReadinessGateDie) DieFeedPtr(r *corev1.PodReadinessGate) *PodReadine return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodReadinessGateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodReadinessGateDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodReadinessGateDie) DieFeedJSON(j []byte) *PodReadinessGateDie { + r := corev1.PodReadinessGate{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodReadinessGateDie) DieFeedYAML(y []byte) *PodReadinessGateDie { r := corev1.PodReadinessGate{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodReadinessGateDie) DieFeedYAMLFile(name string) *PodReadinessGateDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodReadinessGateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodReadinessGateDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodReadinessGateDie) DieRelease() corev1.PodReadinessGate { if d.mutable { @@ -12635,12 +17745,33 @@ func (d *PodReadinessGateDie) DieReleasePtr() *corev1.PodReadinessGate { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodReadinessGateDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodReadinessGateDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodReadinessGateDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodReadinessGateDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12704,14 +17835,42 @@ func (d *TopologySpreadConstraintDie) DieFeedPtr(r *corev1.TopologySpreadConstra return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySpreadConstraintDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySpreadConstraintDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TopologySpreadConstraintDie) DieFeedJSON(j []byte) *TopologySpreadConstraintDie { + r := corev1.TopologySpreadConstraint{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TopologySpreadConstraintDie) DieFeedYAML(y []byte) *TopologySpreadConstraintDie { r := corev1.TopologySpreadConstraint{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TopologySpreadConstraintDie) DieFeedYAMLFile(name string) *TopologySpreadConstraintDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySpreadConstraintDie) DieFeedRawExtension(raw runtime.RawExtension) *TopologySpreadConstraintDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TopologySpreadConstraintDie) DieRelease() corev1.TopologySpreadConstraint { if d.mutable { @@ -12726,12 +17885,33 @@ func (d *TopologySpreadConstraintDie) DieReleasePtr() *corev1.TopologySpreadCons return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TopologySpreadConstraintDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TopologySpreadConstraintDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TopologySpreadConstraintDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TopologySpreadConstraintDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12852,14 +18032,42 @@ func (d *PodOSDie) DieFeedPtr(r *corev1.PodOS) *PodOSDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodOSDie) DieFeedRawExtension(raw runtime.RawExtension) *PodOSDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodOSDie) DieFeedJSON(j []byte) *PodOSDie { + r := corev1.PodOS{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodOSDie) DieFeedYAML(y []byte) *PodOSDie { r := corev1.PodOS{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodOSDie) DieFeedYAMLFile(name string) *PodOSDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodOSDie) DieFeedRawExtension(raw runtime.RawExtension) *PodOSDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodOSDie) DieRelease() corev1.PodOS { if d.mutable { @@ -12874,12 +18082,33 @@ func (d *PodOSDie) DieReleasePtr() *corev1.PodOS { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodOSDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodOSDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodOSDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodOSDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -12943,14 +18172,42 @@ func (d *PodStatusDie) DieFeedPtr(r *corev1.PodStatus) *PodStatusDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PodStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodStatusDie) DieFeedJSON(j []byte) *PodStatusDie { + r := corev1.PodStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodStatusDie) DieFeedYAML(y []byte) *PodStatusDie { r := corev1.PodStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodStatusDie) DieFeedYAMLFile(name string) *PodStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PodStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodStatusDie) DieRelease() corev1.PodStatus { if d.mutable { @@ -12965,12 +18222,33 @@ func (d *PodStatusDie) DieReleasePtr() *corev1.PodStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13125,14 +18403,42 @@ func (d *PodTemplateDie) DieFeedPtr(r *corev1.PodTemplate) *PodTemplateDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodTemplateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodTemplateDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodTemplateDie) DieFeedJSON(j []byte) *PodTemplateDie { + r := corev1.PodTemplate{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodTemplateDie) DieFeedYAML(y []byte) *PodTemplateDie { r := corev1.PodTemplate{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodTemplateDie) DieFeedYAMLFile(name string) *PodTemplateDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodTemplateDie) DieFeedRawExtension(raw runtime.RawExtension) *PodTemplateDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodTemplateDie) DieRelease() corev1.PodTemplate { if d.mutable { @@ -13147,21 +18453,45 @@ func (d *PodTemplateDie) DieReleasePtr() *corev1.PodTemplate { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PodTemplateDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodTemplateDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodTemplateDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodTemplateDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodTemplateDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13277,14 +18607,42 @@ func (d *PodTemplateSpecDie) DieFeedPtr(r *corev1.PodTemplateSpec) *PodTemplateS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodTemplateSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodTemplateSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodTemplateSpecDie) DieFeedJSON(j []byte) *PodTemplateSpecDie { r := corev1.PodTemplateSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodTemplateSpecDie) DieFeedYAML(y []byte) *PodTemplateSpecDie { + r := corev1.PodTemplateSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodTemplateSpecDie) DieFeedYAMLFile(name string) *PodTemplateSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodTemplateSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodTemplateSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodTemplateSpecDie) DieRelease() corev1.PodTemplateSpec { if d.mutable { @@ -13299,12 +18657,33 @@ func (d *PodTemplateSpecDie) DieReleasePtr() *corev1.PodTemplateSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodTemplateSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodTemplateSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodTemplateSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodTemplateSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13378,14 +18757,42 @@ func (d *ReplicationControllerDie) DieFeedPtr(r *corev1.ReplicationController) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicationControllerDie) DieFeedJSON(j []byte) *ReplicationControllerDie { r := corev1.ReplicationController{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicationControllerDie) DieFeedYAML(y []byte) *ReplicationControllerDie { + r := corev1.ReplicationController{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicationControllerDie) DieFeedYAMLFile(name string) *ReplicationControllerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicationControllerDie) DieRelease() corev1.ReplicationController { if d.mutable { @@ -13400,21 +18807,45 @@ func (d *ReplicationControllerDie) DieReleasePtr() *corev1.ReplicationController return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ReplicationControllerDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicationControllerDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicationControllerDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13555,14 +18986,42 @@ func (d *ReplicationControllerSpecDie) DieFeedPtr(r *corev1.ReplicationControlle return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicationControllerSpecDie) DieFeedJSON(j []byte) *ReplicationControllerSpecDie { + r := corev1.ReplicationControllerSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicationControllerSpecDie) DieFeedYAML(y []byte) *ReplicationControllerSpecDie { r := corev1.ReplicationControllerSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicationControllerSpecDie) DieFeedYAMLFile(name string) *ReplicationControllerSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicationControllerSpecDie) DieRelease() corev1.ReplicationControllerSpec { if d.mutable { @@ -13577,12 +19036,33 @@ func (d *ReplicationControllerSpecDie) DieReleasePtr() *corev1.ReplicationContro return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicationControllerSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicationControllerSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13667,14 +19147,42 @@ func (d *ReplicationControllerStatusDie) DieFeedPtr(r *corev1.ReplicationControl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ReplicationControllerStatusDie) DieFeedJSON(j []byte) *ReplicationControllerStatusDie { + r := corev1.ReplicationControllerStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ReplicationControllerStatusDie) DieFeedYAML(y []byte) *ReplicationControllerStatusDie { r := corev1.ReplicationControllerStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ReplicationControllerStatusDie) DieFeedYAMLFile(name string) *ReplicationControllerStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ReplicationControllerStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ReplicationControllerStatusDie) DieRelease() corev1.ReplicationControllerStatus { if d.mutable { @@ -13689,12 +19197,33 @@ func (d *ReplicationControllerStatusDie) DieReleasePtr() *corev1.ReplicationCont return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ReplicationControllerStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ReplicationControllerStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ReplicationControllerStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ReplicationControllerStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13796,14 +19325,42 @@ func (d *ResourceQuotaDie) DieFeedPtr(r *corev1.ResourceQuota) *ResourceQuotaDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceQuotaDie) DieFeedJSON(j []byte) *ResourceQuotaDie { + r := corev1.ResourceQuota{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceQuotaDie) DieFeedYAML(y []byte) *ResourceQuotaDie { r := corev1.ResourceQuota{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceQuotaDie) DieFeedYAMLFile(name string) *ResourceQuotaDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceQuotaDie) DieRelease() corev1.ResourceQuota { if d.mutable { @@ -13818,21 +19375,45 @@ func (d *ResourceQuotaDie) DieReleasePtr() *corev1.ResourceQuota { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ResourceQuotaDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceQuotaDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceQuotaDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -13973,14 +19554,42 @@ func (d *ResourceQuotaSpecDie) DieFeedPtr(r *corev1.ResourceQuotaSpec) *Resource return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceQuotaSpecDie) DieFeedJSON(j []byte) *ResourceQuotaSpecDie { + r := corev1.ResourceQuotaSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceQuotaSpecDie) DieFeedYAML(y []byte) *ResourceQuotaSpecDie { r := corev1.ResourceQuotaSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceQuotaSpecDie) DieFeedYAMLFile(name string) *ResourceQuotaSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceQuotaSpecDie) DieRelease() corev1.ResourceQuotaSpec { if d.mutable { @@ -13995,12 +19604,33 @@ func (d *ResourceQuotaSpecDie) DieReleasePtr() *corev1.ResourceQuotaSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceQuotaSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceQuotaSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14078,14 +19708,42 @@ func (d *ScopeSelectorDie) DieFeedPtr(r *corev1.ScopeSelector) *ScopeSelectorDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ScopeSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ScopeSelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ScopeSelectorDie) DieFeedJSON(j []byte) *ScopeSelectorDie { + r := corev1.ScopeSelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ScopeSelectorDie) DieFeedYAML(y []byte) *ScopeSelectorDie { r := corev1.ScopeSelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ScopeSelectorDie) DieFeedYAMLFile(name string) *ScopeSelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScopeSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *ScopeSelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ScopeSelectorDie) DieRelease() corev1.ScopeSelector { if d.mutable { @@ -14100,12 +19758,33 @@ func (d *ScopeSelectorDie) DieReleasePtr() *corev1.ScopeSelector { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ScopeSelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ScopeSelectorDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ScopeSelectorDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScopeSelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14169,14 +19848,42 @@ func (d *ScopedResourceSelectorRequirementDie) DieFeedPtr(r *corev1.ScopedResour return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ScopedResourceSelectorRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *ScopedResourceSelectorRequirementDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieFeedJSON(j []byte) *ScopedResourceSelectorRequirementDie { + r := corev1.ScopedResourceSelectorRequirement{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieFeedYAML(y []byte) *ScopedResourceSelectorRequirementDie { r := corev1.ScopedResourceSelectorRequirement{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieFeedYAMLFile(name string) *ScopedResourceSelectorRequirementDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieFeedRawExtension(raw runtime.RawExtension) *ScopedResourceSelectorRequirementDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ScopedResourceSelectorRequirementDie) DieRelease() corev1.ScopedResourceSelectorRequirement { if d.mutable { @@ -14191,12 +19898,33 @@ func (d *ScopedResourceSelectorRequirementDie) DieReleasePtr() *corev1.ScopedRes return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ScopedResourceSelectorRequirementDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScopedResourceSelectorRequirementDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14274,14 +20002,42 @@ func (d *ResourceQuotaStatusDie) DieFeedPtr(r *corev1.ResourceQuotaStatus) *Reso return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ResourceQuotaStatusDie) DieFeedJSON(j []byte) *ResourceQuotaStatusDie { + r := corev1.ResourceQuotaStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ResourceQuotaStatusDie) DieFeedYAML(y []byte) *ResourceQuotaStatusDie { r := corev1.ResourceQuotaStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ResourceQuotaStatusDie) DieFeedYAMLFile(name string) *ResourceQuotaStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ResourceQuotaStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ResourceQuotaStatusDie) DieRelease() corev1.ResourceQuotaStatus { if d.mutable { @@ -14296,12 +20052,33 @@ func (d *ResourceQuotaStatusDie) DieReleasePtr() *corev1.ResourceQuotaStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ResourceQuotaStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ResourceQuotaStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ResourceQuotaStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ResourceQuotaStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14375,14 +20152,42 @@ func (d *SecretDie) DieFeedPtr(r *corev1.Secret) *SecretDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretDie) DieFeedJSON(j []byte) *SecretDie { + r := corev1.Secret{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretDie) DieFeedYAML(y []byte) *SecretDie { r := corev1.Secret{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretDie) DieFeedYAMLFile(name string) *SecretDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecretDie) DieRelease() corev1.Secret { if d.mutable { @@ -14397,21 +20202,45 @@ func (d *SecretDie) DieReleasePtr() *corev1.Secret { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *SecretDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14537,14 +20366,42 @@ func (d *ServiceDie) DieFeedPtr(r *corev1.Service) *ServiceDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceDie) DieFeedJSON(j []byte) *ServiceDie { + r := corev1.Service{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceDie) DieFeedYAML(y []byte) *ServiceDie { r := corev1.Service{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceDie) DieFeedYAMLFile(name string) *ServiceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceDie) DieRelease() corev1.Service { if d.mutable { @@ -14559,21 +20416,45 @@ func (d *ServiceDie) DieReleasePtr() *corev1.Service { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ServiceDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14714,14 +20595,42 @@ func (d *ServiceSpecDie) DieFeedPtr(r *corev1.ServiceSpec) *ServiceSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceSpecDie) DieFeedJSON(j []byte) *ServiceSpecDie { + r := corev1.ServiceSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceSpecDie) DieFeedYAML(y []byte) *ServiceSpecDie { r := corev1.ServiceSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceSpecDie) DieFeedYAMLFile(name string) *ServiceSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceSpecDie) DieRelease() corev1.ServiceSpec { if d.mutable { @@ -14736,12 +20645,33 @@ func (d *ServiceSpecDie) DieReleasePtr() *corev1.ServiceSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -14935,14 +20865,42 @@ func (d *ServicePortDie) DieFeedPtr(r *corev1.ServicePort) *ServicePortDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServicePortDie) DieFeedRawExtension(raw runtime.RawExtension) *ServicePortDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServicePortDie) DieFeedJSON(j []byte) *ServicePortDie { + r := corev1.ServicePort{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServicePortDie) DieFeedYAML(y []byte) *ServicePortDie { r := corev1.ServicePort{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServicePortDie) DieFeedYAMLFile(name string) *ServicePortDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServicePortDie) DieFeedRawExtension(raw runtime.RawExtension) *ServicePortDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServicePortDie) DieRelease() corev1.ServicePort { if d.mutable { @@ -14957,12 +20915,33 @@ func (d *ServicePortDie) DieReleasePtr() *corev1.ServicePort { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServicePortDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServicePortDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServicePortDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServicePortDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15075,14 +21054,42 @@ func (d *SessionAffinityConfigDie) DieFeedPtr(r *corev1.SessionAffinityConfig) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SessionAffinityConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *SessionAffinityConfigDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SessionAffinityConfigDie) DieFeedJSON(j []byte) *SessionAffinityConfigDie { + r := corev1.SessionAffinityConfig{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SessionAffinityConfigDie) DieFeedYAML(y []byte) *SessionAffinityConfigDie { r := corev1.SessionAffinityConfig{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SessionAffinityConfigDie) DieFeedYAMLFile(name string) *SessionAffinityConfigDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SessionAffinityConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *SessionAffinityConfigDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SessionAffinityConfigDie) DieRelease() corev1.SessionAffinityConfig { if d.mutable { @@ -15097,12 +21104,33 @@ func (d *SessionAffinityConfigDie) DieReleasePtr() *corev1.SessionAffinityConfig return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SessionAffinityConfigDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SessionAffinityConfigDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SessionAffinityConfigDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SessionAffinityConfigDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15166,14 +21194,42 @@ func (d *ClientIPConfigDie) DieFeedPtr(r *corev1.ClientIPConfig) *ClientIPConfig return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ClientIPConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *ClientIPConfigDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ClientIPConfigDie) DieFeedJSON(j []byte) *ClientIPConfigDie { + r := corev1.ClientIPConfig{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ClientIPConfigDie) DieFeedYAML(y []byte) *ClientIPConfigDie { r := corev1.ClientIPConfig{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ClientIPConfigDie) DieFeedYAMLFile(name string) *ClientIPConfigDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClientIPConfigDie) DieFeedRawExtension(raw runtime.RawExtension) *ClientIPConfigDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ClientIPConfigDie) DieRelease() corev1.ClientIPConfig { if d.mutable { @@ -15188,12 +21244,33 @@ func (d *ClientIPConfigDie) DieReleasePtr() *corev1.ClientIPConfig { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ClientIPConfigDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ClientIPConfigDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ClientIPConfigDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ClientIPConfigDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15249,20 +21326,48 @@ func (d *ServiceStatusDie) DieFeed(r corev1.ServiceStatus) *ServiceStatusDie { } } -// DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead. -func (d *ServiceStatusDie) DieFeedPtr(r *corev1.ServiceStatus) *ServiceStatusDie { - if r == nil { - r = &corev1.ServiceStatus{} +// DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead. +func (d *ServiceStatusDie) DieFeedPtr(r *corev1.ServiceStatus) *ServiceStatusDie { + if r == nil { + r = &corev1.ServiceStatus{} + } + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceStatusDie) DieFeedJSON(j []byte) *ServiceStatusDie { + r := corev1.ServiceStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceStatusDie) DieFeedYAML(y []byte) *ServiceStatusDie { + r := corev1.ServiceStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceStatusDie) DieFeedYAMLFile(name string) *ServiceStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) } - return d.DieFeed(*r) + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *ServiceStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceStatusDie { - b, _ := json.Marshal(raw) - r := corev1.ServiceStatus{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -15279,12 +21384,33 @@ func (d *ServiceStatusDie) DieReleasePtr() *corev1.ServiceStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15355,14 +21481,42 @@ func (d *LoadBalancerStatusDie) DieFeedPtr(r *corev1.LoadBalancerStatus) *LoadBa return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LoadBalancerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *LoadBalancerStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LoadBalancerStatusDie) DieFeedJSON(j []byte) *LoadBalancerStatusDie { r := corev1.LoadBalancerStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LoadBalancerStatusDie) DieFeedYAML(y []byte) *LoadBalancerStatusDie { + r := corev1.LoadBalancerStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LoadBalancerStatusDie) DieFeedYAMLFile(name string) *LoadBalancerStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LoadBalancerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *LoadBalancerStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LoadBalancerStatusDie) DieRelease() corev1.LoadBalancerStatus { if d.mutable { @@ -15377,12 +21531,33 @@ func (d *LoadBalancerStatusDie) DieReleasePtr() *corev1.LoadBalancerStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LoadBalancerStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LoadBalancerStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LoadBalancerStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LoadBalancerStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15446,14 +21621,42 @@ func (d *LoadBalancerIngressDie) DieFeedPtr(r *corev1.LoadBalancerIngress) *Load return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LoadBalancerIngressDie) DieFeedRawExtension(raw runtime.RawExtension) *LoadBalancerIngressDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LoadBalancerIngressDie) DieFeedJSON(j []byte) *LoadBalancerIngressDie { r := corev1.LoadBalancerIngress{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LoadBalancerIngressDie) DieFeedYAML(y []byte) *LoadBalancerIngressDie { + r := corev1.LoadBalancerIngress{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LoadBalancerIngressDie) DieFeedYAMLFile(name string) *LoadBalancerIngressDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LoadBalancerIngressDie) DieFeedRawExtension(raw runtime.RawExtension) *LoadBalancerIngressDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LoadBalancerIngressDie) DieRelease() corev1.LoadBalancerIngress { if d.mutable { @@ -15468,12 +21671,33 @@ func (d *LoadBalancerIngressDie) DieReleasePtr() *corev1.LoadBalancerIngress { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LoadBalancerIngressDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LoadBalancerIngressDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LoadBalancerIngressDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LoadBalancerIngressDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15551,14 +21775,42 @@ func (d *PortStatusDie) DieFeedPtr(r *corev1.PortStatus) *PortStatusDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PortStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PortStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PortStatusDie) DieFeedJSON(j []byte) *PortStatusDie { r := corev1.PortStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PortStatusDie) DieFeedYAML(y []byte) *PortStatusDie { + r := corev1.PortStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PortStatusDie) DieFeedYAMLFile(name string) *PortStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PortStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PortStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PortStatusDie) DieRelease() corev1.PortStatus { if d.mutable { @@ -15573,12 +21825,33 @@ func (d *PortStatusDie) DieReleasePtr() *corev1.PortStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PortStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PortStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PortStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PortStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15659,14 +21932,42 @@ func (d *ServiceAccountDie) DieFeedPtr(r *corev1.ServiceAccount) *ServiceAccount return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceAccountDie) DieFeedJSON(j []byte) *ServiceAccountDie { r := corev1.ServiceAccount{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceAccountDie) DieFeedYAML(y []byte) *ServiceAccountDie { + r := corev1.ServiceAccount{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceAccountDie) DieFeedYAMLFile(name string) *ServiceAccountDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceAccountDie) DieRelease() corev1.ServiceAccount { if d.mutable { @@ -15681,21 +21982,45 @@ func (d *ServiceAccountDie) DieReleasePtr() *corev1.ServiceAccount { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *ServiceAccountDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceAccountDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceAccountDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15825,14 +22150,42 @@ func (d *VolumeDie) DieFeedPtr(r *corev1.Volume) *VolumeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeDie) DieFeedJSON(j []byte) *VolumeDie { + r := corev1.Volume{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeDie) DieFeedYAML(y []byte) *VolumeDie { r := corev1.Volume{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeDie) DieFeedYAMLFile(name string) *VolumeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeDie) DieRelease() corev1.Volume { if d.mutable { @@ -15847,12 +22200,33 @@ func (d *VolumeDie) DieReleasePtr() *corev1.Volume { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -15923,14 +22297,42 @@ func (d *HostPathVolumeSourceDie) DieFeedPtr(r *corev1.HostPathVolumeSource) *Ho return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HostPathVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *HostPathVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HostPathVolumeSourceDie) DieFeedJSON(j []byte) *HostPathVolumeSourceDie { + r := corev1.HostPathVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HostPathVolumeSourceDie) DieFeedYAML(y []byte) *HostPathVolumeSourceDie { r := corev1.HostPathVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HostPathVolumeSourceDie) DieFeedYAMLFile(name string) *HostPathVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostPathVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *HostPathVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HostPathVolumeSourceDie) DieRelease() corev1.HostPathVolumeSource { if d.mutable { @@ -15945,12 +22347,33 @@ func (d *HostPathVolumeSourceDie) DieReleasePtr() *corev1.HostPathVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HostPathVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HostPathVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HostPathVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostPathVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16021,14 +22444,42 @@ func (d *EmptyDirVolumeSourceDie) DieFeedPtr(r *corev1.EmptyDirVolumeSource) *Em return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EmptyDirVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EmptyDirVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieFeedJSON(j []byte) *EmptyDirVolumeSourceDie { + r := corev1.EmptyDirVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieFeedYAML(y []byte) *EmptyDirVolumeSourceDie { r := corev1.EmptyDirVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieFeedYAMLFile(name string) *EmptyDirVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EmptyDirVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EmptyDirVolumeSourceDie) DieRelease() corev1.EmptyDirVolumeSource { if d.mutable { @@ -16043,12 +22494,33 @@ func (d *EmptyDirVolumeSourceDie) DieReleasePtr() *corev1.EmptyDirVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EmptyDirVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EmptyDirVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16119,14 +22591,42 @@ func (d *GCEPersistentDiskVolumeSourceDie) DieFeedPtr(r *corev1.GCEPersistentDis return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GCEPersistentDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GCEPersistentDiskVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieFeedJSON(j []byte) *GCEPersistentDiskVolumeSourceDie { + r := corev1.GCEPersistentDiskVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieFeedYAML(y []byte) *GCEPersistentDiskVolumeSourceDie { r := corev1.GCEPersistentDiskVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieFeedYAMLFile(name string) *GCEPersistentDiskVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GCEPersistentDiskVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GCEPersistentDiskVolumeSourceDie) DieRelease() corev1.GCEPersistentDiskVolumeSource { if d.mutable { @@ -16141,12 +22641,33 @@ func (d *GCEPersistentDiskVolumeSourceDie) DieReleasePtr() *corev1.GCEPersistent return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GCEPersistentDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GCEPersistentDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16231,14 +22752,42 @@ func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedPtr(r *corev1.AWSElasticBlo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AWSElasticBlockStoreVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedJSON(j []byte) *AWSElasticBlockStoreVolumeSourceDie { + r := corev1.AWSElasticBlockStoreVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedYAML(y []byte) *AWSElasticBlockStoreVolumeSourceDie { r := corev1.AWSElasticBlockStoreVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedYAMLFile(name string) *AWSElasticBlockStoreVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AWSElasticBlockStoreVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AWSElasticBlockStoreVolumeSourceDie) DieRelease() corev1.AWSElasticBlockStoreVolumeSource { if d.mutable { @@ -16253,12 +22802,33 @@ func (d *AWSElasticBlockStoreVolumeSourceDie) DieReleasePtr() *corev1.AWSElastic return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AWSElasticBlockStoreVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AWSElasticBlockStoreVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16335,20 +22905,48 @@ func (d *GitRepoVolumeSourceDie) DieFeed(r corev1.GitRepoVolumeSource) *GitRepoV } } -// DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead. -func (d *GitRepoVolumeSourceDie) DieFeedPtr(r *corev1.GitRepoVolumeSource) *GitRepoVolumeSourceDie { - if r == nil { - r = &corev1.GitRepoVolumeSource{} +// DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead. +func (d *GitRepoVolumeSourceDie) DieFeedPtr(r *corev1.GitRepoVolumeSource) *GitRepoVolumeSourceDie { + if r == nil { + r = &corev1.GitRepoVolumeSource{} + } + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GitRepoVolumeSourceDie) DieFeedJSON(j []byte) *GitRepoVolumeSourceDie { + r := corev1.GitRepoVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GitRepoVolumeSourceDie) DieFeedYAML(y []byte) *GitRepoVolumeSourceDie { + r := corev1.GitRepoVolumeSource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GitRepoVolumeSourceDie) DieFeedYAMLFile(name string) *GitRepoVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) } - return d.DieFeed(*r) + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *GitRepoVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GitRepoVolumeSourceDie { - b, _ := json.Marshal(raw) - r := corev1.GitRepoVolumeSource{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -16365,12 +22963,33 @@ func (d *GitRepoVolumeSourceDie) DieReleasePtr() *corev1.GitRepoVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GitRepoVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GitRepoVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GitRepoVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GitRepoVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16448,14 +23067,42 @@ func (d *SecretVolumeSourceDie) DieFeedPtr(r *corev1.SecretVolumeSource) *Secret return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretVolumeSourceDie) DieFeedJSON(j []byte) *SecretVolumeSourceDie { + r := corev1.SecretVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretVolumeSourceDie) DieFeedYAML(y []byte) *SecretVolumeSourceDie { r := corev1.SecretVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretVolumeSourceDie) DieFeedYAMLFile(name string) *SecretVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecretVolumeSourceDie) DieRelease() corev1.SecretVolumeSource { if d.mutable { @@ -16470,12 +23117,33 @@ func (d *SecretVolumeSourceDie) DieReleasePtr() *corev1.SecretVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16560,14 +23228,42 @@ func (d *NFSVolumeSourceDie) DieFeedPtr(r *corev1.NFSVolumeSource) *NFSVolumeSou return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NFSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *NFSVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NFSVolumeSourceDie) DieFeedJSON(j []byte) *NFSVolumeSourceDie { + r := corev1.NFSVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NFSVolumeSourceDie) DieFeedYAML(y []byte) *NFSVolumeSourceDie { r := corev1.NFSVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NFSVolumeSourceDie) DieFeedYAMLFile(name string) *NFSVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NFSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *NFSVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NFSVolumeSourceDie) DieRelease() corev1.NFSVolumeSource { if d.mutable { @@ -16582,12 +23278,33 @@ func (d *NFSVolumeSourceDie) DieReleasePtr() *corev1.NFSVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NFSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NFSVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NFSVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NFSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16665,14 +23382,42 @@ func (d *ISCSIVolumeSourceDie) DieFeedPtr(r *corev1.ISCSIVolumeSource) *ISCSIVol return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ISCSIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ISCSIVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ISCSIVolumeSourceDie) DieFeedJSON(j []byte) *ISCSIVolumeSourceDie { + r := corev1.ISCSIVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ISCSIVolumeSourceDie) DieFeedYAML(y []byte) *ISCSIVolumeSourceDie { r := corev1.ISCSIVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ISCSIVolumeSourceDie) DieFeedYAMLFile(name string) *ISCSIVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ISCSIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ISCSIVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ISCSIVolumeSourceDie) DieRelease() corev1.ISCSIVolumeSource { if d.mutable { @@ -16687,12 +23432,33 @@ func (d *ISCSIVolumeSourceDie) DieReleasePtr() *corev1.ISCSIVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ISCSIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ISCSIVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ISCSIVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ISCSIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16826,14 +23592,42 @@ func (d *GlusterfsVolumeSourceDie) DieFeedPtr(r *corev1.GlusterfsVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GlusterfsVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GlusterfsVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieFeedJSON(j []byte) *GlusterfsVolumeSourceDie { + r := corev1.GlusterfsVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieFeedYAML(y []byte) *GlusterfsVolumeSourceDie { r := corev1.GlusterfsVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieFeedYAMLFile(name string) *GlusterfsVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GlusterfsVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GlusterfsVolumeSourceDie) DieRelease() corev1.GlusterfsVolumeSource { if d.mutable { @@ -16848,12 +23642,33 @@ func (d *GlusterfsVolumeSourceDie) DieReleasePtr() *corev1.GlusterfsVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GlusterfsVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GlusterfsVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -16931,14 +23746,42 @@ func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedPtr(r *corev1.PersistentVo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedJSON(j []byte) *PersistentVolumeClaimVolumeSourceDie { + r := corev1.PersistentVolumeClaimVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedYAML(y []byte) *PersistentVolumeClaimVolumeSourceDie { r := corev1.PersistentVolumeClaimVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedYAMLFile(name string) *PersistentVolumeClaimVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PersistentVolumeClaimVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PersistentVolumeClaimVolumeSourceDie) DieRelease() corev1.PersistentVolumeClaimVolumeSource { if d.mutable { @@ -16953,12 +23796,33 @@ func (d *PersistentVolumeClaimVolumeSourceDie) DieReleasePtr() *corev1.Persisten return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PersistentVolumeClaimVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PersistentVolumeClaimVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17029,14 +23893,42 @@ func (d *RBDVolumeSourceDie) DieFeedPtr(r *corev1.RBDVolumeSource) *RBDVolumeSou return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RBDVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *RBDVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RBDVolumeSourceDie) DieFeedJSON(j []byte) *RBDVolumeSourceDie { + r := corev1.RBDVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RBDVolumeSourceDie) DieFeedYAML(y []byte) *RBDVolumeSourceDie { r := corev1.RBDVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RBDVolumeSourceDie) DieFeedYAMLFile(name string) *RBDVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RBDVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *RBDVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RBDVolumeSourceDie) DieRelease() corev1.RBDVolumeSource { if d.mutable { @@ -17051,12 +23943,33 @@ func (d *RBDVolumeSourceDie) DieReleasePtr() *corev1.RBDVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RBDVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RBDVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RBDVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RBDVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17169,14 +24082,42 @@ func (d *FlexVolumeSourceDie) DieFeedPtr(r *corev1.FlexVolumeSource) *FlexVolume return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlexVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlexVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlexVolumeSourceDie) DieFeedJSON(j []byte) *FlexVolumeSourceDie { + r := corev1.FlexVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlexVolumeSourceDie) DieFeedYAML(y []byte) *FlexVolumeSourceDie { r := corev1.FlexVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlexVolumeSourceDie) DieFeedYAMLFile(name string) *FlexVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlexVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlexVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlexVolumeSourceDie) DieRelease() corev1.FlexVolumeSource { if d.mutable { @@ -17191,12 +24132,33 @@ func (d *FlexVolumeSourceDie) DieReleasePtr() *corev1.FlexVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FlexVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlexVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlexVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlexVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17288,14 +24250,42 @@ func (d *CinderVolumeSourceDie) DieFeedPtr(r *corev1.CinderVolumeSource) *Cinder return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CinderVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CinderVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CinderVolumeSourceDie) DieFeedJSON(j []byte) *CinderVolumeSourceDie { + r := corev1.CinderVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CinderVolumeSourceDie) DieFeedYAML(y []byte) *CinderVolumeSourceDie { r := corev1.CinderVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CinderVolumeSourceDie) DieFeedYAMLFile(name string) *CinderVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CinderVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CinderVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CinderVolumeSourceDie) DieRelease() corev1.CinderVolumeSource { if d.mutable { @@ -17310,12 +24300,33 @@ func (d *CinderVolumeSourceDie) DieReleasePtr() *corev1.CinderVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CinderVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CinderVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CinderVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CinderVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17400,14 +24411,42 @@ func (d *CephFSVolumeSourceDie) DieFeedPtr(r *corev1.CephFSVolumeSource) *CephFS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CephFSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CephFSVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CephFSVolumeSourceDie) DieFeedJSON(j []byte) *CephFSVolumeSourceDie { + r := corev1.CephFSVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CephFSVolumeSourceDie) DieFeedYAML(y []byte) *CephFSVolumeSourceDie { r := corev1.CephFSVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CephFSVolumeSourceDie) DieFeedYAMLFile(name string) *CephFSVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CephFSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CephFSVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CephFSVolumeSourceDie) DieRelease() corev1.CephFSVolumeSource { if d.mutable { @@ -17422,12 +24461,33 @@ func (d *CephFSVolumeSourceDie) DieReleasePtr() *corev1.CephFSVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CephFSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CephFSVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CephFSVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CephFSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17526,14 +24586,42 @@ func (d *FlockerVolumeSourceDie) DieFeedPtr(r *corev1.FlockerVolumeSource) *Floc return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FlockerVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlockerVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FlockerVolumeSourceDie) DieFeedJSON(j []byte) *FlockerVolumeSourceDie { + r := corev1.FlockerVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FlockerVolumeSourceDie) DieFeedYAML(y []byte) *FlockerVolumeSourceDie { r := corev1.FlockerVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FlockerVolumeSourceDie) DieFeedYAMLFile(name string) *FlockerVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FlockerVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FlockerVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FlockerVolumeSourceDie) DieRelease() corev1.FlockerVolumeSource { if d.mutable { @@ -17548,12 +24636,33 @@ func (d *FlockerVolumeSourceDie) DieReleasePtr() *corev1.FlockerVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FlockerVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FlockerVolumeSourceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *FlockerVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { - r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17624,14 +24733,42 @@ func (d *DownwardAPIVolumeSourceDie) DieFeedPtr(r *corev1.DownwardAPIVolumeSourc return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieFeedJSON(j []byte) *DownwardAPIVolumeSourceDie { + r := corev1.DownwardAPIVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieFeedYAML(y []byte) *DownwardAPIVolumeSourceDie { r := corev1.DownwardAPIVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieFeedYAMLFile(name string) *DownwardAPIVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DownwardAPIVolumeSourceDie) DieRelease() corev1.DownwardAPIVolumeSource { if d.mutable { @@ -17646,12 +24783,33 @@ func (d *DownwardAPIVolumeSourceDie) DieReleasePtr() *corev1.DownwardAPIVolumeSo return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17722,14 +24880,42 @@ func (d *DownwardAPIVolumeFileDie) DieFeedPtr(r *corev1.DownwardAPIVolumeFile) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIVolumeFileDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIVolumeFileDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieFeedJSON(j []byte) *DownwardAPIVolumeFileDie { + r := corev1.DownwardAPIVolumeFile{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieFeedYAML(y []byte) *DownwardAPIVolumeFileDie { r := corev1.DownwardAPIVolumeFile{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieFeedYAMLFile(name string) *DownwardAPIVolumeFileDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIVolumeFileDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DownwardAPIVolumeFileDie) DieRelease() corev1.DownwardAPIVolumeFile { if d.mutable { @@ -17744,12 +24930,33 @@ func (d *DownwardAPIVolumeFileDie) DieReleasePtr() *corev1.DownwardAPIVolumeFile return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIVolumeFileDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIVolumeFileDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17834,14 +25041,42 @@ func (d *FCVolumeSourceDie) DieFeedPtr(r *corev1.FCVolumeSource) *FCVolumeSource return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FCVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FCVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FCVolumeSourceDie) DieFeedJSON(j []byte) *FCVolumeSourceDie { + r := corev1.FCVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FCVolumeSourceDie) DieFeedYAML(y []byte) *FCVolumeSourceDie { r := corev1.FCVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FCVolumeSourceDie) DieFeedYAMLFile(name string) *FCVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FCVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *FCVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FCVolumeSourceDie) DieRelease() corev1.FCVolumeSource { if d.mutable { @@ -17856,12 +25091,33 @@ func (d *FCVolumeSourceDie) DieReleasePtr() *corev1.FCVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FCVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FCVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FCVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FCVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -17953,14 +25209,42 @@ func (d *AzureFileVolumeSourceDie) DieFeedPtr(r *corev1.AzureFileVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureFileVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureFileVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AzureFileVolumeSourceDie) DieFeedJSON(j []byte) *AzureFileVolumeSourceDie { + r := corev1.AzureFileVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AzureFileVolumeSourceDie) DieFeedYAML(y []byte) *AzureFileVolumeSourceDie { r := corev1.AzureFileVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AzureFileVolumeSourceDie) DieFeedYAMLFile(name string) *AzureFileVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureFileVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureFileVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AzureFileVolumeSourceDie) DieRelease() corev1.AzureFileVolumeSource { if d.mutable { @@ -17975,12 +25259,33 @@ func (d *AzureFileVolumeSourceDie) DieReleasePtr() *corev1.AzureFileVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureFileVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AzureFileVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AzureFileVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureFileVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18058,14 +25363,42 @@ func (d *ConfigMapVolumeSourceDie) DieFeedPtr(r *corev1.ConfigMapVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieFeedJSON(j []byte) *ConfigMapVolumeSourceDie { + r := corev1.ConfigMapVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieFeedYAML(y []byte) *ConfigMapVolumeSourceDie { r := corev1.ConfigMapVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieFeedYAMLFile(name string) *ConfigMapVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapVolumeSourceDie) DieRelease() corev1.ConfigMapVolumeSource { if d.mutable { @@ -18080,12 +25413,33 @@ func (d *ConfigMapVolumeSourceDie) DieReleasePtr() *corev1.ConfigMapVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18169,14 +25523,42 @@ func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedPtr(r *corev1.VsphereVirtualD return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *VsphereVirtualDiskVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedJSON(j []byte) *VsphereVirtualDiskVolumeSourceDie { + r := corev1.VsphereVirtualDiskVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedYAML(y []byte) *VsphereVirtualDiskVolumeSourceDie { r := corev1.VsphereVirtualDiskVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedYAMLFile(name string) *VsphereVirtualDiskVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *VsphereVirtualDiskVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VsphereVirtualDiskVolumeSourceDie) DieRelease() corev1.VsphereVirtualDiskVolumeSource { if d.mutable { @@ -18191,12 +25573,33 @@ func (d *VsphereVirtualDiskVolumeSourceDie) DieReleasePtr() *corev1.VsphereVirtu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VsphereVirtualDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VsphereVirtualDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18281,14 +25684,42 @@ func (d *QuobyteVolumeSourceDie) DieFeedPtr(r *corev1.QuobyteVolumeSource) *Quob return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *QuobyteVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *QuobyteVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *QuobyteVolumeSourceDie) DieFeedJSON(j []byte) *QuobyteVolumeSourceDie { + r := corev1.QuobyteVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *QuobyteVolumeSourceDie) DieFeedYAML(y []byte) *QuobyteVolumeSourceDie { r := corev1.QuobyteVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *QuobyteVolumeSourceDie) DieFeedYAMLFile(name string) *QuobyteVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *QuobyteVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *QuobyteVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *QuobyteVolumeSourceDie) DieRelease() corev1.QuobyteVolumeSource { if d.mutable { @@ -18303,12 +25734,33 @@ func (d *QuobyteVolumeSourceDie) DieReleasePtr() *corev1.QuobyteVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *QuobyteVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *QuobyteVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *QuobyteVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *QuobyteVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18407,14 +25859,42 @@ func (d *AzureDiskVolumeSourceDie) DieFeedPtr(r *corev1.AzureDiskVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureDiskVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieFeedJSON(j []byte) *AzureDiskVolumeSourceDie { + r := corev1.AzureDiskVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieFeedYAML(y []byte) *AzureDiskVolumeSourceDie { r := corev1.AzureDiskVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieFeedYAMLFile(name string) *AzureDiskVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *AzureDiskVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AzureDiskVolumeSourceDie) DieRelease() corev1.AzureDiskVolumeSource { if d.mutable { @@ -18429,12 +25909,33 @@ func (d *AzureDiskVolumeSourceDie) DieReleasePtr() *corev1.AzureDiskVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AzureDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AzureDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18533,14 +26034,42 @@ func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedPtr(r *corev1.PhotonPersist return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PhotonPersistentDiskVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedJSON(j []byte) *PhotonPersistentDiskVolumeSourceDie { + r := corev1.PhotonPersistentDiskVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedYAML(y []byte) *PhotonPersistentDiskVolumeSourceDie { r := corev1.PhotonPersistentDiskVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedYAMLFile(name string) *PhotonPersistentDiskVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PhotonPersistentDiskVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PhotonPersistentDiskVolumeSourceDie) DieRelease() corev1.PhotonPersistentDiskVolumeSource { if d.mutable { @@ -18555,12 +26084,33 @@ func (d *PhotonPersistentDiskVolumeSourceDie) DieReleasePtr() *corev1.PhotonPers return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PhotonPersistentDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PhotonPersistentDiskVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18631,14 +26181,42 @@ func (d *ProjectedVolumeSourceDie) DieFeedPtr(r *corev1.ProjectedVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ProjectedVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ProjectedVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ProjectedVolumeSourceDie) DieFeedJSON(j []byte) *ProjectedVolumeSourceDie { + r := corev1.ProjectedVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ProjectedVolumeSourceDie) DieFeedYAML(y []byte) *ProjectedVolumeSourceDie { r := corev1.ProjectedVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ProjectedVolumeSourceDie) DieFeedYAMLFile(name string) *ProjectedVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProjectedVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ProjectedVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ProjectedVolumeSourceDie) DieRelease() corev1.ProjectedVolumeSource { if d.mutable { @@ -18653,12 +26231,33 @@ func (d *ProjectedVolumeSourceDie) DieReleasePtr() *corev1.ProjectedVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ProjectedVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ProjectedVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ProjectedVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ProjectedVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18726,15 +26325,43 @@ func (d *VolumeProjectionDie) DieFeedPtr(r *corev1.VolumeProjection) *VolumeProj if r == nil { r = &corev1.VolumeProjection{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeProjectionDie) DieFeedJSON(j []byte) *VolumeProjectionDie { + r := corev1.VolumeProjection{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeProjectionDie) DieFeedYAML(y []byte) *VolumeProjectionDie { + r := corev1.VolumeProjection{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeProjectionDie) DieFeedYAMLFile(name string) *VolumeProjectionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *VolumeProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeProjectionDie { - b, _ := json.Marshal(raw) - r := corev1.VolumeProjection{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -18751,12 +26378,33 @@ func (d *VolumeProjectionDie) DieReleasePtr() *corev1.VolumeProjection { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeProjectionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeProjectionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeProjectionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeProjectionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18841,14 +26489,42 @@ func (d *SecretProjectionDie) DieFeedPtr(r *corev1.SecretProjection) *SecretProj return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretProjectionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SecretProjectionDie) DieFeedJSON(j []byte) *SecretProjectionDie { + r := corev1.SecretProjection{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SecretProjectionDie) DieFeedYAML(y []byte) *SecretProjectionDie { r := corev1.SecretProjection{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SecretProjectionDie) DieFeedYAMLFile(name string) *SecretProjectionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *SecretProjectionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SecretProjectionDie) DieRelease() corev1.SecretProjection { if d.mutable { @@ -18863,12 +26539,33 @@ func (d *SecretProjectionDie) DieReleasePtr() *corev1.SecretProjection { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SecretProjectionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SecretProjectionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SecretProjectionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SecretProjectionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -18945,14 +26642,42 @@ func (d *DownwardAPIProjectionDie) DieFeedPtr(r *corev1.DownwardAPIProjection) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIProjectionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DownwardAPIProjectionDie) DieFeedJSON(j []byte) *DownwardAPIProjectionDie { + r := corev1.DownwardAPIProjection{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DownwardAPIProjectionDie) DieFeedYAML(y []byte) *DownwardAPIProjectionDie { r := corev1.DownwardAPIProjection{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DownwardAPIProjectionDie) DieFeedYAMLFile(name string) *DownwardAPIProjectionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *DownwardAPIProjectionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DownwardAPIProjectionDie) DieRelease() corev1.DownwardAPIProjection { if d.mutable { @@ -18967,12 +26692,33 @@ func (d *DownwardAPIProjectionDie) DieReleasePtr() *corev1.DownwardAPIProjection return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DownwardAPIProjectionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DownwardAPIProjectionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DownwardAPIProjectionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DownwardAPIProjectionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19036,14 +26782,42 @@ func (d *ConfigMapProjectionDie) DieFeedPtr(r *corev1.ConfigMapProjection) *Conf return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapProjectionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConfigMapProjectionDie) DieFeedJSON(j []byte) *ConfigMapProjectionDie { + r := corev1.ConfigMapProjection{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConfigMapProjectionDie) DieFeedYAML(y []byte) *ConfigMapProjectionDie { r := corev1.ConfigMapProjection{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConfigMapProjectionDie) DieFeedYAMLFile(name string) *ConfigMapProjectionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *ConfigMapProjectionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConfigMapProjectionDie) DieRelease() corev1.ConfigMapProjection { if d.mutable { @@ -19058,12 +26832,33 @@ func (d *ConfigMapProjectionDie) DieReleasePtr() *corev1.ConfigMapProjection { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConfigMapProjectionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConfigMapProjectionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConfigMapProjectionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConfigMapProjectionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19140,14 +26935,42 @@ func (d *ServiceAccountTokenProjectionDie) DieFeedPtr(r *corev1.ServiceAccountTo return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountTokenProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountTokenProjectionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieFeedJSON(j []byte) *ServiceAccountTokenProjectionDie { + r := corev1.ServiceAccountTokenProjection{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieFeedYAML(y []byte) *ServiceAccountTokenProjectionDie { r := corev1.ServiceAccountTokenProjection{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieFeedYAMLFile(name string) *ServiceAccountTokenProjectionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceAccountTokenProjectionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceAccountTokenProjectionDie) DieRelease() corev1.ServiceAccountTokenProjection { if d.mutable { @@ -19162,12 +26985,33 @@ func (d *ServiceAccountTokenProjectionDie) DieReleasePtr() *corev1.ServiceAccoun return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceAccountTokenProjectionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceAccountTokenProjectionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19245,14 +27089,42 @@ func (d *PortworxVolumeSourceDie) DieFeedPtr(r *corev1.PortworxVolumeSource) *Po return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PortworxVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PortworxVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PortworxVolumeSourceDie) DieFeedJSON(j []byte) *PortworxVolumeSourceDie { + r := corev1.PortworxVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PortworxVolumeSourceDie) DieFeedYAML(y []byte) *PortworxVolumeSourceDie { r := corev1.PortworxVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PortworxVolumeSourceDie) DieFeedYAMLFile(name string) *PortworxVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PortworxVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *PortworxVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PortworxVolumeSourceDie) DieRelease() corev1.PortworxVolumeSource { if d.mutable { @@ -19267,12 +27139,33 @@ func (d *PortworxVolumeSourceDie) DieReleasePtr() *corev1.PortworxVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PortworxVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PortworxVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PortworxVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PortworxVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19350,14 +27243,42 @@ func (d *ScaleIOVolumeSourceDie) DieFeedPtr(r *corev1.ScaleIOVolumeSource) *Scal return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ScaleIOVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ScaleIOVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieFeedJSON(j []byte) *ScaleIOVolumeSourceDie { + r := corev1.ScaleIOVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieFeedYAML(y []byte) *ScaleIOVolumeSourceDie { r := corev1.ScaleIOVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieFeedYAMLFile(name string) *ScaleIOVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *ScaleIOVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ScaleIOVolumeSourceDie) DieRelease() corev1.ScaleIOVolumeSource { if d.mutable { @@ -19372,12 +27293,33 @@ func (d *ScaleIOVolumeSourceDie) DieReleasePtr() *corev1.ScaleIOVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ScaleIOVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ScaleIOVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19504,14 +27446,42 @@ func (d *StorageOSVolumeSourceDie) DieFeedPtr(r *corev1.StorageOSVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageOSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageOSVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StorageOSVolumeSourceDie) DieFeedJSON(j []byte) *StorageOSVolumeSourceDie { + r := corev1.StorageOSVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StorageOSVolumeSourceDie) DieFeedYAML(y []byte) *StorageOSVolumeSourceDie { r := corev1.StorageOSVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StorageOSVolumeSourceDie) DieFeedYAMLFile(name string) *StorageOSVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageOSVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageOSVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StorageOSVolumeSourceDie) DieRelease() corev1.StorageOSVolumeSource { if d.mutable { @@ -19526,12 +27496,33 @@ func (d *StorageOSVolumeSourceDie) DieReleasePtr() *corev1.StorageOSVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageOSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StorageOSVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StorageOSVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageOSVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19623,14 +27614,42 @@ func (d *CSIVolumeSourceDie) DieFeedPtr(r *corev1.CSIVolumeSource) *CSIVolumeSou return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSIVolumeSourceDie) DieFeedJSON(j []byte) *CSIVolumeSourceDie { + r := corev1.CSIVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSIVolumeSourceDie) DieFeedYAML(y []byte) *CSIVolumeSourceDie { r := corev1.CSIVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSIVolumeSourceDie) DieFeedYAMLFile(name string) *CSIVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSIVolumeSourceDie) DieRelease() corev1.CSIVolumeSource { if d.mutable { @@ -19645,12 +27664,33 @@ func (d *CSIVolumeSourceDie) DieReleasePtr() *corev1.CSIVolumeSource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSIVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSIVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19742,14 +27782,42 @@ func (d *EphemeralVolumeSourceDie) DieFeedPtr(r *corev1.EphemeralVolumeSource) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EphemeralVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EphemeralVolumeSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EphemeralVolumeSourceDie) DieFeedJSON(j []byte) *EphemeralVolumeSourceDie { + r := corev1.EphemeralVolumeSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EphemeralVolumeSourceDie) DieFeedYAML(y []byte) *EphemeralVolumeSourceDie { r := corev1.EphemeralVolumeSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EphemeralVolumeSourceDie) DieFeedYAMLFile(name string) *EphemeralVolumeSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EphemeralVolumeSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *EphemeralVolumeSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EphemeralVolumeSourceDie) DieRelease() corev1.EphemeralVolumeSource { if d.mutable { @@ -19764,12 +27832,33 @@ func (d *EphemeralVolumeSourceDie) DieReleasePtr() *corev1.EphemeralVolumeSource return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EphemeralVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EphemeralVolumeSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EphemeralVolumeSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EphemeralVolumeSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -19839,14 +27928,42 @@ func (d *KeyToPathDie) DieFeedPtr(r *corev1.KeyToPath) *KeyToPathDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *KeyToPathDie) DieFeedRawExtension(raw runtime.RawExtension) *KeyToPathDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *KeyToPathDie) DieFeedJSON(j []byte) *KeyToPathDie { + r := corev1.KeyToPath{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *KeyToPathDie) DieFeedYAML(y []byte) *KeyToPathDie { r := corev1.KeyToPath{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *KeyToPathDie) DieFeedYAMLFile(name string) *KeyToPathDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *KeyToPathDie) DieFeedRawExtension(raw runtime.RawExtension) *KeyToPathDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *KeyToPathDie) DieRelease() corev1.KeyToPath { if d.mutable { @@ -19861,12 +27978,33 @@ func (d *KeyToPathDie) DieReleasePtr() *corev1.KeyToPath { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *KeyToPathDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *KeyToPathDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *KeyToPathDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *KeyToPathDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/events/v1/zz_generated.die.go b/apis/events/v1/zz_generated.die.go index c64cb36..8229514 100644 --- a/apis/events/v1/zz_generated.die.go +++ b/apis/events/v1/zz_generated.die.go @@ -31,6 +31,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var EventBlank = (&EventDie{}).DieFeed(eventsv1.Event{}) @@ -73,14 +75,42 @@ func (d *EventDie) DieFeedPtr(r *eventsv1.Event) *EventDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EventDie) DieFeedRawExtension(raw runtime.RawExtension) *EventDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EventDie) DieFeedJSON(j []byte) *EventDie { r := eventsv1.Event{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EventDie) DieFeedYAML(y []byte) *EventDie { + r := eventsv1.Event{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EventDie) DieFeedYAMLFile(name string) *EventDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventDie) DieFeedRawExtension(raw runtime.RawExtension) *EventDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EventDie) DieRelease() eventsv1.Event { if d.mutable { @@ -95,21 +125,45 @@ func (d *EventDie) DieReleasePtr() *eventsv1.Event { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *EventDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EventDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EventDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EventDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -316,14 +370,42 @@ func (d *EventSeriesDie) DieFeedPtr(r *eventsv1.EventSeries) *EventSeriesDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSeriesDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSeriesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *EventSeriesDie) DieFeedJSON(j []byte) *EventSeriesDie { + r := eventsv1.EventSeries{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *EventSeriesDie) DieFeedYAML(y []byte) *EventSeriesDie { r := eventsv1.EventSeries{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *EventSeriesDie) DieFeedYAMLFile(name string) *EventSeriesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSeriesDie) DieFeedRawExtension(raw runtime.RawExtension) *EventSeriesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *EventSeriesDie) DieRelease() eventsv1.EventSeries { if d.mutable { @@ -338,12 +420,33 @@ func (d *EventSeriesDie) DieReleasePtr() *eventsv1.EventSeries { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *EventSeriesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *EventSeriesDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *EventSeriesDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *EventSeriesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/meta/v1/zz_generated.die.go b/apis/meta/v1/zz_generated.die.go index 14715ae..dbc3787 100644 --- a/apis/meta/v1/zz_generated.die.go +++ b/apis/meta/v1/zz_generated.die.go @@ -26,6 +26,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + osx "os" + yaml "sigs.k8s.io/yaml" ) var ConditionBlank = (&ConditionDie{}).DieFeed(metav1.Condition{}) @@ -65,14 +67,42 @@ func (d *ConditionDie) DieFeedPtr(r *metav1.Condition) *ConditionDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ConditionDie) DieFeedRawExtension(raw runtime.RawExtension) *ConditionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ConditionDie) DieFeedJSON(j []byte) *ConditionDie { + r := metav1.Condition{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ConditionDie) DieFeedYAML(y []byte) *ConditionDie { r := metav1.Condition{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ConditionDie) DieFeedYAMLFile(name string) *ConditionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConditionDie) DieFeedRawExtension(raw runtime.RawExtension) *ConditionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ConditionDie) DieRelease() metav1.Condition { if d.mutable { @@ -87,12 +117,33 @@ func (d *ConditionDie) DieReleasePtr() *metav1.Condition { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ConditionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ConditionDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ConditionDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ConditionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -191,14 +242,42 @@ func (d *GroupResourceDie) DieFeedPtr(r *metav1.GroupResource) *GroupResourceDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupResourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupResourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupResourceDie) DieFeedJSON(j []byte) *GroupResourceDie { r := metav1.GroupResource{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupResourceDie) DieFeedYAML(y []byte) *GroupResourceDie { + r := metav1.GroupResource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupResourceDie) DieFeedYAMLFile(name string) *GroupResourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupResourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupResourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupResourceDie) DieRelease() metav1.GroupResource { if d.mutable { @@ -213,12 +292,33 @@ func (d *GroupResourceDie) DieReleasePtr() *metav1.GroupResource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupResourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupResourceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupResourceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupResourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -287,14 +387,42 @@ func (d *GroupVersionDie) DieFeedPtr(r *metav1.GroupVersion) *GroupVersionDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupVersionDie) DieFeedJSON(j []byte) *GroupVersionDie { r := metav1.GroupVersion{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupVersionDie) DieFeedYAML(y []byte) *GroupVersionDie { + r := metav1.GroupVersion{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupVersionDie) DieFeedYAMLFile(name string) *GroupVersionDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupVersionDie) DieRelease() metav1.GroupVersion { if d.mutable { @@ -309,12 +437,33 @@ func (d *GroupVersionDie) DieReleasePtr() *metav1.GroupVersion { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupVersionDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupVersionDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -383,14 +532,42 @@ func (d *GroupVersionKindDie) DieFeedPtr(r *metav1.GroupVersionKind) *GroupVersi return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionKindDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionKindDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupVersionKindDie) DieFeedJSON(j []byte) *GroupVersionKindDie { + r := metav1.GroupVersionKind{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupVersionKindDie) DieFeedYAML(y []byte) *GroupVersionKindDie { r := metav1.GroupVersionKind{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupVersionKindDie) DieFeedYAMLFile(name string) *GroupVersionKindDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionKindDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionKindDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupVersionKindDie) DieRelease() metav1.GroupVersionKind { if d.mutable { @@ -405,12 +582,33 @@ func (d *GroupVersionKindDie) DieReleasePtr() *metav1.GroupVersionKind { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionKindDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupVersionKindDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupVersionKindDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionKindDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -485,14 +683,42 @@ func (d *GroupVersionResourceDie) DieFeedPtr(r *metav1.GroupVersionResource) *Gr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionResourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionResourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupVersionResourceDie) DieFeedJSON(j []byte) *GroupVersionResourceDie { r := metav1.GroupVersionResource{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupVersionResourceDie) DieFeedYAML(y []byte) *GroupVersionResourceDie { + r := metav1.GroupVersionResource{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupVersionResourceDie) DieFeedYAMLFile(name string) *GroupVersionResourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionResourceDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionResourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupVersionResourceDie) DieRelease() metav1.GroupVersionResource { if d.mutable { @@ -507,12 +733,33 @@ func (d *GroupVersionResourceDie) DieReleasePtr() *metav1.GroupVersionResource { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionResourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupVersionResourceDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupVersionResourceDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionResourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -587,14 +834,42 @@ func (d *GroupVersionForDiscoveryDie) DieFeedPtr(r *metav1.GroupVersionForDiscov return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionForDiscoveryDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionForDiscoveryDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieFeedJSON(j []byte) *GroupVersionForDiscoveryDie { + r := metav1.GroupVersionForDiscovery{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieFeedYAML(y []byte) *GroupVersionForDiscoveryDie { r := metav1.GroupVersionForDiscovery{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieFeedYAMLFile(name string) *GroupVersionForDiscoveryDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieFeedRawExtension(raw runtime.RawExtension) *GroupVersionForDiscoveryDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *GroupVersionForDiscoveryDie) DieRelease() metav1.GroupVersionForDiscovery { if d.mutable { @@ -609,12 +884,33 @@ func (d *GroupVersionForDiscoveryDie) DieReleasePtr() *metav1.GroupVersionForDis return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *GroupVersionForDiscoveryDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *GroupVersionForDiscoveryDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -685,14 +981,42 @@ func (d *ListMetaDie) DieFeedPtr(r *metav1.ListMeta) *ListMetaDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ListMetaDie) DieFeedRawExtension(raw runtime.RawExtension) *ListMetaDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ListMetaDie) DieFeedJSON(j []byte) *ListMetaDie { r := metav1.ListMeta{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ListMetaDie) DieFeedYAML(y []byte) *ListMetaDie { + r := metav1.ListMeta{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ListMetaDie) DieFeedYAMLFile(name string) *ListMetaDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ListMetaDie) DieFeedRawExtension(raw runtime.RawExtension) *ListMetaDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ListMetaDie) DieRelease() metav1.ListMeta { if d.mutable { @@ -707,12 +1031,33 @@ func (d *ListMetaDie) DieReleasePtr() *metav1.ListMeta { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ListMetaDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ListMetaDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ListMetaDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ListMetaDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -797,14 +1142,42 @@ func (d *ObjectMetaDie) DieFeedPtr(r *metav1.ObjectMeta) *ObjectMetaDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectMetaDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectMetaDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ObjectMetaDie) DieFeedJSON(j []byte) *ObjectMetaDie { + r := metav1.ObjectMeta{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ObjectMetaDie) DieFeedYAML(y []byte) *ObjectMetaDie { r := metav1.ObjectMeta{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ObjectMetaDie) DieFeedYAMLFile(name string) *ObjectMetaDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectMetaDie) DieFeedRawExtension(raw runtime.RawExtension) *ObjectMetaDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ObjectMetaDie) DieRelease() metav1.ObjectMeta { if d.mutable { @@ -819,12 +1192,33 @@ func (d *ObjectMetaDie) DieReleasePtr() *metav1.ObjectMeta { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ObjectMetaDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ObjectMetaDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ObjectMetaDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ObjectMetaDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1000,14 +1394,42 @@ func (d *ManagedFieldsEntryDie) DieFeedPtr(r *metav1.ManagedFieldsEntry) *Manage return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ManagedFieldsEntryDie) DieFeedRawExtension(raw runtime.RawExtension) *ManagedFieldsEntryDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ManagedFieldsEntryDie) DieFeedJSON(j []byte) *ManagedFieldsEntryDie { + r := metav1.ManagedFieldsEntry{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ManagedFieldsEntryDie) DieFeedYAML(y []byte) *ManagedFieldsEntryDie { r := metav1.ManagedFieldsEntry{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ManagedFieldsEntryDie) DieFeedYAMLFile(name string) *ManagedFieldsEntryDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ManagedFieldsEntryDie) DieFeedRawExtension(raw runtime.RawExtension) *ManagedFieldsEntryDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ManagedFieldsEntryDie) DieRelease() metav1.ManagedFieldsEntry { if d.mutable { @@ -1022,12 +1444,33 @@ func (d *ManagedFieldsEntryDie) DieReleasePtr() *metav1.ManagedFieldsEntry { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ManagedFieldsEntryDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ManagedFieldsEntryDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ManagedFieldsEntryDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ManagedFieldsEntryDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1133,14 +1576,42 @@ func (d *LabelSelectorDie) DieFeedPtr(r *metav1.LabelSelector) *LabelSelectorDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *LabelSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *LabelSelectorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *LabelSelectorDie) DieFeedJSON(j []byte) *LabelSelectorDie { + r := metav1.LabelSelector{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *LabelSelectorDie) DieFeedYAML(y []byte) *LabelSelectorDie { r := metav1.LabelSelector{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *LabelSelectorDie) DieFeedYAMLFile(name string) *LabelSelectorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LabelSelectorDie) DieFeedRawExtension(raw runtime.RawExtension) *LabelSelectorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *LabelSelectorDie) DieRelease() metav1.LabelSelector { if d.mutable { @@ -1155,12 +1626,33 @@ func (d *LabelSelectorDie) DieReleasePtr() *metav1.LabelSelector { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *LabelSelectorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *LabelSelectorDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *LabelSelectorDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *LabelSelectorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1231,14 +1723,42 @@ func (d *StatusDie) DieFeedPtr(r *metav1.Status) *StatusDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatusDie) DieFeedJSON(j []byte) *StatusDie { + r := metav1.Status{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatusDie) DieFeedYAML(y []byte) *StatusDie { r := metav1.Status{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatusDie) DieFeedYAMLFile(name string) *StatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatusDie) DieRelease() metav1.Status { if d.mutable { @@ -1253,12 +1773,33 @@ func (d *StatusDie) DieReleasePtr() *metav1.Status { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1363,14 +1904,42 @@ func (d *StatusDetailsDie) DieFeedPtr(r *metav1.StatusDetails) *StatusDetailsDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusDetailsDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusDetailsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatusDetailsDie) DieFeedJSON(j []byte) *StatusDetailsDie { r := metav1.StatusDetails{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatusDetailsDie) DieFeedYAML(y []byte) *StatusDetailsDie { + r := metav1.StatusDetails{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatusDetailsDie) DieFeedYAMLFile(name string) *StatusDetailsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusDetailsDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusDetailsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatusDetailsDie) DieRelease() metav1.StatusDetails { if d.mutable { @@ -1385,12 +1954,33 @@ func (d *StatusDetailsDie) DieReleasePtr() *metav1.StatusDetails { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusDetailsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatusDetailsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatusDetailsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusDetailsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1489,14 +2079,42 @@ func (d *StatusCauseDie) DieFeedPtr(r *metav1.StatusCause) *StatusCauseDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusCauseDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusCauseDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StatusCauseDie) DieFeedJSON(j []byte) *StatusCauseDie { r := metav1.StatusCause{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StatusCauseDie) DieFeedYAML(y []byte) *StatusCauseDie { + r := metav1.StatusCause{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StatusCauseDie) DieFeedYAMLFile(name string) *StatusCauseDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusCauseDie) DieFeedRawExtension(raw runtime.RawExtension) *StatusCauseDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StatusCauseDie) DieRelease() metav1.StatusCause { if d.mutable { @@ -1511,12 +2129,33 @@ func (d *StatusCauseDie) DieReleasePtr() *metav1.StatusCause { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StatusCauseDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StatusCauseDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StatusCauseDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StatusCauseDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/networking/v1/zz_generated.die.go b/apis/networking/v1/zz_generated.die.go index a0104ca..9b151d4 100644 --- a/apis/networking/v1/zz_generated.die.go +++ b/apis/networking/v1/zz_generated.die.go @@ -32,6 +32,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" intstr "k8s.io/apimachinery/pkg/util/intstr" + osx "os" + yaml "sigs.k8s.io/yaml" ) var IngressBlank = (&IngressDie{}).DieFeed(networkingv1.Ingress{}) @@ -74,14 +76,42 @@ func (d *IngressDie) DieFeedPtr(r *networkingv1.Ingress) *IngressDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressDie) DieFeedJSON(j []byte) *IngressDie { r := networkingv1.Ingress{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressDie) DieFeedYAML(y []byte) *IngressDie { + r := networkingv1.Ingress{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressDie) DieFeedYAMLFile(name string) *IngressDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressDie) DieRelease() networkingv1.Ingress { if d.mutable { @@ -96,21 +126,45 @@ func (d *IngressDie) DieReleasePtr() *networkingv1.Ingress { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *IngressDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -251,14 +305,42 @@ func (d *IngressSpecDie) DieFeedPtr(r *networkingv1.IngressSpec) *IngressSpecDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressSpecDie) DieFeedJSON(j []byte) *IngressSpecDie { + r := networkingv1.IngressSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressSpecDie) DieFeedYAML(y []byte) *IngressSpecDie { r := networkingv1.IngressSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressSpecDie) DieFeedYAMLFile(name string) *IngressSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressSpecDie) DieRelease() networkingv1.IngressSpec { if d.mutable { @@ -273,12 +355,33 @@ func (d *IngressSpecDie) DieReleasePtr() *networkingv1.IngressSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -363,14 +466,42 @@ func (d *IngressBackendDie) DieFeedPtr(r *networkingv1.IngressBackend) *IngressB return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressBackendDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressBackendDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressBackendDie) DieFeedJSON(j []byte) *IngressBackendDie { r := networkingv1.IngressBackend{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressBackendDie) DieFeedYAML(y []byte) *IngressBackendDie { + r := networkingv1.IngressBackend{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressBackendDie) DieFeedYAMLFile(name string) *IngressBackendDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressBackendDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressBackendDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressBackendDie) DieRelease() networkingv1.IngressBackend { if d.mutable { @@ -385,12 +516,33 @@ func (d *IngressBackendDie) DieReleasePtr() *networkingv1.IngressBackend { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressBackendDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressBackendDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressBackendDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressBackendDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -461,14 +613,42 @@ func (d *IngressServiceBackendDie) DieFeedPtr(r *networkingv1.IngressServiceBack return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressServiceBackendDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressServiceBackendDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressServiceBackendDie) DieFeedJSON(j []byte) *IngressServiceBackendDie { + r := networkingv1.IngressServiceBackend{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressServiceBackendDie) DieFeedYAML(y []byte) *IngressServiceBackendDie { r := networkingv1.IngressServiceBackend{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressServiceBackendDie) DieFeedYAMLFile(name string) *IngressServiceBackendDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressServiceBackendDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressServiceBackendDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressServiceBackendDie) DieRelease() networkingv1.IngressServiceBackend { if d.mutable { @@ -483,12 +663,33 @@ func (d *IngressServiceBackendDie) DieReleasePtr() *networkingv1.IngressServiceB return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressServiceBackendDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressServiceBackendDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressServiceBackendDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressServiceBackendDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -559,14 +760,42 @@ func (d *ServiceBackendPortDie) DieFeedPtr(r *networkingv1.ServiceBackendPort) * return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceBackendPortDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceBackendPortDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *ServiceBackendPortDie) DieFeedJSON(j []byte) *ServiceBackendPortDie { r := networkingv1.ServiceBackendPort{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *ServiceBackendPortDie) DieFeedYAML(y []byte) *ServiceBackendPortDie { + r := networkingv1.ServiceBackendPort{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *ServiceBackendPortDie) DieFeedYAMLFile(name string) *ServiceBackendPortDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceBackendPortDie) DieFeedRawExtension(raw runtime.RawExtension) *ServiceBackendPortDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *ServiceBackendPortDie) DieRelease() networkingv1.ServiceBackendPort { if d.mutable { @@ -581,12 +810,33 @@ func (d *ServiceBackendPortDie) DieReleasePtr() *networkingv1.ServiceBackendPort return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *ServiceBackendPortDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *ServiceBackendPortDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *ServiceBackendPortDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *ServiceBackendPortDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -657,14 +907,42 @@ func (d *IngressTLSDie) DieFeedPtr(r *networkingv1.IngressTLS) *IngressTLSDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressTLSDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressTLSDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressTLSDie) DieFeedJSON(j []byte) *IngressTLSDie { + r := networkingv1.IngressTLS{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressTLSDie) DieFeedYAML(y []byte) *IngressTLSDie { r := networkingv1.IngressTLS{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressTLSDie) DieFeedYAMLFile(name string) *IngressTLSDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressTLSDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressTLSDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressTLSDie) DieRelease() networkingv1.IngressTLS { if d.mutable { @@ -679,12 +957,33 @@ func (d *IngressTLSDie) DieReleasePtr() *networkingv1.IngressTLS { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressTLSDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressTLSDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressTLSDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressTLSDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -755,14 +1054,42 @@ func (d *IngressRuleDie) DieFeedPtr(r *networkingv1.IngressRule) *IngressRuleDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressRuleDie) DieFeedJSON(j []byte) *IngressRuleDie { + r := networkingv1.IngressRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressRuleDie) DieFeedYAML(y []byte) *IngressRuleDie { r := networkingv1.IngressRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressRuleDie) DieFeedYAMLFile(name string) *IngressRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressRuleDie) DieRelease() networkingv1.IngressRule { if d.mutable { @@ -777,12 +1104,33 @@ func (d *IngressRuleDie) DieReleasePtr() *networkingv1.IngressRule { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -855,14 +1203,42 @@ func (d *HTTPIngressRuleValueDie) DieFeedPtr(r *networkingv1.HTTPIngressRuleValu return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPIngressRuleValueDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPIngressRuleValueDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HTTPIngressRuleValueDie) DieFeedJSON(j []byte) *HTTPIngressRuleValueDie { r := networkingv1.HTTPIngressRuleValue{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HTTPIngressRuleValueDie) DieFeedYAML(y []byte) *HTTPIngressRuleValueDie { + r := networkingv1.HTTPIngressRuleValue{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HTTPIngressRuleValueDie) DieFeedYAMLFile(name string) *HTTPIngressRuleValueDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPIngressRuleValueDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPIngressRuleValueDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HTTPIngressRuleValueDie) DieRelease() networkingv1.HTTPIngressRuleValue { if d.mutable { @@ -877,12 +1253,33 @@ func (d *HTTPIngressRuleValueDie) DieReleasePtr() *networkingv1.HTTPIngressRuleV return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPIngressRuleValueDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HTTPIngressRuleValueDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HTTPIngressRuleValueDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPIngressRuleValueDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -946,14 +1343,42 @@ func (d *HTTPIngressPathDie) DieFeedPtr(r *networkingv1.HTTPIngressPath) *HTTPIn return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPIngressPathDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPIngressPathDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HTTPIngressPathDie) DieFeedJSON(j []byte) *HTTPIngressPathDie { + r := networkingv1.HTTPIngressPath{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HTTPIngressPathDie) DieFeedYAML(y []byte) *HTTPIngressPathDie { r := networkingv1.HTTPIngressPath{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HTTPIngressPathDie) DieFeedYAMLFile(name string) *HTTPIngressPathDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPIngressPathDie) DieFeedRawExtension(raw runtime.RawExtension) *HTTPIngressPathDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HTTPIngressPathDie) DieRelease() networkingv1.HTTPIngressPath { if d.mutable { @@ -968,12 +1393,33 @@ func (d *HTTPIngressPathDie) DieReleasePtr() *networkingv1.HTTPIngressPath { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HTTPIngressPathDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HTTPIngressPathDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HTTPIngressPathDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HTTPIngressPathDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1051,14 +1497,42 @@ func (d *IngressStatusDie) DieFeedPtr(r *networkingv1.IngressStatus) *IngressSta return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressStatusDie) DieFeedJSON(j []byte) *IngressStatusDie { + r := networkingv1.IngressStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressStatusDie) DieFeedYAML(y []byte) *IngressStatusDie { r := networkingv1.IngressStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressStatusDie) DieFeedYAMLFile(name string) *IngressStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressStatusDie) DieRelease() networkingv1.IngressStatus { if d.mutable { @@ -1073,12 +1547,33 @@ func (d *IngressStatusDie) DieReleasePtr() *networkingv1.IngressStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1142,14 +1637,42 @@ func (d *IngressLoadBalancerStatusDie) DieFeedPtr(r *networkingv1.IngressLoadBal return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressLoadBalancerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressLoadBalancerStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieFeedJSON(j []byte) *IngressLoadBalancerStatusDie { r := networkingv1.IngressLoadBalancerStatus{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieFeedYAML(y []byte) *IngressLoadBalancerStatusDie { + r := networkingv1.IngressLoadBalancerStatus{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieFeedYAMLFile(name string) *IngressLoadBalancerStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressLoadBalancerStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressLoadBalancerStatusDie) DieRelease() networkingv1.IngressLoadBalancerStatus { if d.mutable { @@ -1164,12 +1687,33 @@ func (d *IngressLoadBalancerStatusDie) DieReleasePtr() *networkingv1.IngressLoad return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressLoadBalancerStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressLoadBalancerStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1233,14 +1777,42 @@ func (d *IngressLoadBalancerIngressDie) DieFeedPtr(r *networkingv1.IngressLoadBa return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressLoadBalancerIngressDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressLoadBalancerIngressDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieFeedJSON(j []byte) *IngressLoadBalancerIngressDie { r := networkingv1.IngressLoadBalancerIngress{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieFeedYAML(y []byte) *IngressLoadBalancerIngressDie { + r := networkingv1.IngressLoadBalancerIngress{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieFeedYAMLFile(name string) *IngressLoadBalancerIngressDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressLoadBalancerIngressDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressLoadBalancerIngressDie) DieRelease() networkingv1.IngressLoadBalancerIngress { if d.mutable { @@ -1255,12 +1827,33 @@ func (d *IngressLoadBalancerIngressDie) DieReleasePtr() *networkingv1.IngressLoa return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressLoadBalancerIngressDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressLoadBalancerIngressDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1338,14 +1931,42 @@ func (d *IngressPortStatusDie) DieFeedPtr(r *networkingv1.IngressPortStatus) *In return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressPortStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressPortStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressPortStatusDie) DieFeedJSON(j []byte) *IngressPortStatusDie { + r := networkingv1.IngressPortStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressPortStatusDie) DieFeedYAML(y []byte) *IngressPortStatusDie { r := networkingv1.IngressPortStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressPortStatusDie) DieFeedYAMLFile(name string) *IngressPortStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressPortStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressPortStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressPortStatusDie) DieRelease() networkingv1.IngressPortStatus { if d.mutable { @@ -1360,12 +1981,33 @@ func (d *IngressPortStatusDie) DieReleasePtr() *networkingv1.IngressPortStatus { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressPortStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressPortStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressPortStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressPortStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1443,15 +2085,43 @@ func (d *IngressClassDie) DieFeedPtr(r *networkingv1.IngressClass) *IngressClass if r == nil { r = &networkingv1.IngressClass{} } - return d.DieFeed(*r) + return d.DieFeed(*r) +} + +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressClassDie) DieFeedJSON(j []byte) *IngressClassDie { + r := networkingv1.IngressClass{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressClassDie) DieFeedYAML(y []byte) *IngressClassDie { + r := networkingv1.IngressClass{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressClassDie) DieFeedYAMLFile(name string) *IngressClassDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. func (d *IngressClassDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressClassDie { - b, _ := json.Marshal(raw) - r := networkingv1.IngressClass{} - _ = json.Unmarshal(b, &r) - return d.DieFeed(r) + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) } // DieRelease returns the resource managed by the die. @@ -1468,21 +2138,45 @@ func (d *IngressClassDie) DieReleasePtr() *networkingv1.IngressClass { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *IngressClassDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressClassDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressClassDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressClassDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressClassDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1607,14 +2301,42 @@ func (d *IngressClassSpecDie) DieFeedPtr(r *networkingv1.IngressClassSpec) *Ingr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressClassSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressClassSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressClassSpecDie) DieFeedJSON(j []byte) *IngressClassSpecDie { r := networkingv1.IngressClassSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressClassSpecDie) DieFeedYAML(y []byte) *IngressClassSpecDie { + r := networkingv1.IngressClassSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressClassSpecDie) DieFeedYAMLFile(name string) *IngressClassSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressClassSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressClassSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressClassSpecDie) DieRelease() networkingv1.IngressClassSpec { if d.mutable { @@ -1629,12 +2351,33 @@ func (d *IngressClassSpecDie) DieReleasePtr() *networkingv1.IngressClassSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressClassSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressClassSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressClassSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressClassSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1705,14 +2448,42 @@ func (d *IngressClassParametersReferenceDie) DieFeedPtr(r *networkingv1.IngressC return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressClassParametersReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressClassParametersReferenceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IngressClassParametersReferenceDie) DieFeedJSON(j []byte) *IngressClassParametersReferenceDie { r := networkingv1.IngressClassParametersReference{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IngressClassParametersReferenceDie) DieFeedYAML(y []byte) *IngressClassParametersReferenceDie { + r := networkingv1.IngressClassParametersReference{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IngressClassParametersReferenceDie) DieFeedYAMLFile(name string) *IngressClassParametersReferenceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressClassParametersReferenceDie) DieFeedRawExtension(raw runtime.RawExtension) *IngressClassParametersReferenceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IngressClassParametersReferenceDie) DieRelease() networkingv1.IngressClassParametersReference { if d.mutable { @@ -1727,12 +2498,33 @@ func (d *IngressClassParametersReferenceDie) DieReleasePtr() *networkingv1.Ingre return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IngressClassParametersReferenceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IngressClassParametersReferenceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IngressClassParametersReferenceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IngressClassParametersReferenceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1827,14 +2619,42 @@ func (d *NetworkPolicyDie) DieFeedPtr(r *networkingv1.NetworkPolicy) *NetworkPol return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyDie) DieFeedJSON(j []byte) *NetworkPolicyDie { r := networkingv1.NetworkPolicy{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyDie) DieFeedYAML(y []byte) *NetworkPolicyDie { + r := networkingv1.NetworkPolicy{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyDie) DieFeedYAMLFile(name string) *NetworkPolicyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyDie) DieRelease() networkingv1.NetworkPolicy { if d.mutable { @@ -1849,21 +2669,45 @@ func (d *NetworkPolicyDie) DieReleasePtr() *networkingv1.NetworkPolicy { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *NetworkPolicyDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2004,14 +2848,42 @@ func (d *NetworkPolicySpecDie) DieFeedPtr(r *networkingv1.NetworkPolicySpec) *Ne return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicySpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicySpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicySpecDie) DieFeedJSON(j []byte) *NetworkPolicySpecDie { + r := networkingv1.NetworkPolicySpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicySpecDie) DieFeedYAML(y []byte) *NetworkPolicySpecDie { r := networkingv1.NetworkPolicySpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicySpecDie) DieFeedYAMLFile(name string) *NetworkPolicySpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicySpecDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicySpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicySpecDie) DieRelease() networkingv1.NetworkPolicySpec { if d.mutable { @@ -2026,12 +2898,33 @@ func (d *NetworkPolicySpecDie) DieReleasePtr() *networkingv1.NetworkPolicySpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicySpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicySpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicySpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicySpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2116,14 +3009,42 @@ func (d *NetworkPolicyIngressRuleDie) DieFeedPtr(r *networkingv1.NetworkPolicyIn return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyIngressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyIngressRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieFeedJSON(j []byte) *NetworkPolicyIngressRuleDie { + r := networkingv1.NetworkPolicyIngressRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieFeedYAML(y []byte) *NetworkPolicyIngressRuleDie { r := networkingv1.NetworkPolicyIngressRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieFeedYAMLFile(name string) *NetworkPolicyIngressRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyIngressRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyIngressRuleDie) DieRelease() networkingv1.NetworkPolicyIngressRule { if d.mutable { @@ -2138,12 +3059,33 @@ func (d *NetworkPolicyIngressRuleDie) DieReleasePtr() *networkingv1.NetworkPolic return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyIngressRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyIngressRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2214,14 +3156,42 @@ func (d *NetworkPolicyEgressRuleDie) DieFeedPtr(r *networkingv1.NetworkPolicyEgr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyEgressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyEgressRuleDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieFeedJSON(j []byte) *NetworkPolicyEgressRuleDie { + r := networkingv1.NetworkPolicyEgressRule{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieFeedYAML(y []byte) *NetworkPolicyEgressRuleDie { r := networkingv1.NetworkPolicyEgressRule{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieFeedYAMLFile(name string) *NetworkPolicyEgressRuleDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyEgressRuleDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyEgressRuleDie) DieRelease() networkingv1.NetworkPolicyEgressRule { if d.mutable { @@ -2236,12 +3206,33 @@ func (d *NetworkPolicyEgressRuleDie) DieReleasePtr() *networkingv1.NetworkPolicy return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyEgressRuleDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyEgressRuleDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2312,14 +3303,42 @@ func (d *NetworkPolicyPortDie) DieFeedPtr(r *networkingv1.NetworkPolicyPort) *Ne return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyPortDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyPortDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyPortDie) DieFeedJSON(j []byte) *NetworkPolicyPortDie { + r := networkingv1.NetworkPolicyPort{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyPortDie) DieFeedYAML(y []byte) *NetworkPolicyPortDie { r := networkingv1.NetworkPolicyPort{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyPortDie) DieFeedYAMLFile(name string) *NetworkPolicyPortDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyPortDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyPortDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyPortDie) DieRelease() networkingv1.NetworkPolicyPort { if d.mutable { @@ -2334,12 +3353,33 @@ func (d *NetworkPolicyPortDie) DieReleasePtr() *networkingv1.NetworkPolicyPort { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyPortDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyPortDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyPortDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyPortDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2431,14 +3471,42 @@ func (d *NetworkPolicyPeerDie) DieFeedPtr(r *networkingv1.NetworkPolicyPeer) *Ne return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyPeerDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyPeerDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyPeerDie) DieFeedJSON(j []byte) *NetworkPolicyPeerDie { + r := networkingv1.NetworkPolicyPeer{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyPeerDie) DieFeedYAML(y []byte) *NetworkPolicyPeerDie { r := networkingv1.NetworkPolicyPeer{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyPeerDie) DieFeedYAMLFile(name string) *NetworkPolicyPeerDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyPeerDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyPeerDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyPeerDie) DieRelease() networkingv1.NetworkPolicyPeer { if d.mutable { @@ -2453,12 +3521,33 @@ func (d *NetworkPolicyPeerDie) DieReleasePtr() *networkingv1.NetworkPolicyPeer { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyPeerDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyPeerDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyPeerDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyPeerDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2540,14 +3629,42 @@ func (d *IPBlockDie) DieFeedPtr(r *networkingv1.IPBlock) *IPBlockDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IPBlockDie) DieFeedRawExtension(raw runtime.RawExtension) *IPBlockDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IPBlockDie) DieFeedJSON(j []byte) *IPBlockDie { + r := networkingv1.IPBlock{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IPBlockDie) DieFeedYAML(y []byte) *IPBlockDie { r := networkingv1.IPBlock{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IPBlockDie) DieFeedYAMLFile(name string) *IPBlockDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IPBlockDie) DieFeedRawExtension(raw runtime.RawExtension) *IPBlockDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IPBlockDie) DieRelease() networkingv1.IPBlock { if d.mutable { @@ -2562,12 +3679,33 @@ func (d *IPBlockDie) DieReleasePtr() *networkingv1.IPBlock { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IPBlockDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IPBlockDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IPBlockDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IPBlockDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -2638,14 +3776,42 @@ func (d *NetworkPolicyStatusDie) DieFeedPtr(r *networkingv1.NetworkPolicyStatus) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *NetworkPolicyStatusDie) DieFeedJSON(j []byte) *NetworkPolicyStatusDie { + r := networkingv1.NetworkPolicyStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *NetworkPolicyStatusDie) DieFeedYAML(y []byte) *NetworkPolicyStatusDie { r := networkingv1.NetworkPolicyStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *NetworkPolicyStatusDie) DieFeedYAMLFile(name string) *NetworkPolicyStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *NetworkPolicyStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *NetworkPolicyStatusDie) DieRelease() networkingv1.NetworkPolicyStatus { if d.mutable { @@ -2660,12 +3826,33 @@ func (d *NetworkPolicyStatusDie) DieReleasePtr() *networkingv1.NetworkPolicyStat return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *NetworkPolicyStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *NetworkPolicyStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *NetworkPolicyStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *NetworkPolicyStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/node/v1/zz_generated.die.go b/apis/node/v1/zz_generated.die.go index fd39d9a..7c42f77 100644 --- a/apis/node/v1/zz_generated.die.go +++ b/apis/node/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var RuntimeClassBlank = (&RuntimeClassDie{}).DieFeed(nodev1.RuntimeClass{}) @@ -72,14 +74,42 @@ func (d *RuntimeClassDie) DieFeedPtr(r *nodev1.RuntimeClass) *RuntimeClassDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RuntimeClassDie) DieFeedRawExtension(raw runtime.RawExtension) *RuntimeClassDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RuntimeClassDie) DieFeedJSON(j []byte) *RuntimeClassDie { + r := nodev1.RuntimeClass{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RuntimeClassDie) DieFeedYAML(y []byte) *RuntimeClassDie { r := nodev1.RuntimeClass{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RuntimeClassDie) DieFeedYAMLFile(name string) *RuntimeClassDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuntimeClassDie) DieFeedRawExtension(raw runtime.RawExtension) *RuntimeClassDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RuntimeClassDie) DieRelease() nodev1.RuntimeClass { if d.mutable { @@ -94,21 +124,45 @@ func (d *RuntimeClassDie) DieReleasePtr() *nodev1.RuntimeClass { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *RuntimeClassDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RuntimeClassDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RuntimeClassDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RuntimeClassDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuntimeClassDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -238,14 +292,42 @@ func (d *OverheadDie) DieFeedPtr(r *nodev1.Overhead) *OverheadDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *OverheadDie) DieFeedRawExtension(raw runtime.RawExtension) *OverheadDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *OverheadDie) DieFeedJSON(j []byte) *OverheadDie { + r := nodev1.Overhead{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *OverheadDie) DieFeedYAML(y []byte) *OverheadDie { r := nodev1.Overhead{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *OverheadDie) DieFeedYAMLFile(name string) *OverheadDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *OverheadDie) DieFeedRawExtension(raw runtime.RawExtension) *OverheadDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *OverheadDie) DieRelease() nodev1.Overhead { if d.mutable { @@ -260,12 +342,33 @@ func (d *OverheadDie) DieReleasePtr() *nodev1.Overhead { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *OverheadDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *OverheadDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *OverheadDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *OverheadDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -329,14 +432,42 @@ func (d *SchedulingDie) DieFeedPtr(r *nodev1.Scheduling) *SchedulingDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SchedulingDie) DieFeedRawExtension(raw runtime.RawExtension) *SchedulingDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SchedulingDie) DieFeedJSON(j []byte) *SchedulingDie { + r := nodev1.Scheduling{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SchedulingDie) DieFeedYAML(y []byte) *SchedulingDie { r := nodev1.Scheduling{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SchedulingDie) DieFeedYAMLFile(name string) *SchedulingDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SchedulingDie) DieFeedRawExtension(raw runtime.RawExtension) *SchedulingDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SchedulingDie) DieRelease() nodev1.Scheduling { if d.mutable { @@ -351,12 +482,33 @@ func (d *SchedulingDie) DieReleasePtr() *nodev1.Scheduling { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SchedulingDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SchedulingDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SchedulingDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SchedulingDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/policy/v1/zz_generated.die.go b/apis/policy/v1/zz_generated.die.go index 4f00d85..b5c716d 100644 --- a/apis/policy/v1/zz_generated.die.go +++ b/apis/policy/v1/zz_generated.die.go @@ -31,6 +31,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" intstr "k8s.io/apimachinery/pkg/util/intstr" + osx "os" + yaml "sigs.k8s.io/yaml" ) var PodDisruptionBudgetBlank = (&PodDisruptionBudgetDie{}).DieFeed(policyv1.PodDisruptionBudget{}) @@ -73,14 +75,42 @@ func (d *PodDisruptionBudgetDie) DieFeedPtr(r *policyv1.PodDisruptionBudget) *Po return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDisruptionBudgetDie) DieFeedJSON(j []byte) *PodDisruptionBudgetDie { + r := policyv1.PodDisruptionBudget{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDisruptionBudgetDie) DieFeedYAML(y []byte) *PodDisruptionBudgetDie { r := policyv1.PodDisruptionBudget{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDisruptionBudgetDie) DieFeedYAMLFile(name string) *PodDisruptionBudgetDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodDisruptionBudgetDie) DieRelease() policyv1.PodDisruptionBudget { if d.mutable { @@ -95,21 +125,45 @@ func (d *PodDisruptionBudgetDie) DieReleasePtr() *policyv1.PodDisruptionBudget { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PodDisruptionBudgetDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDisruptionBudgetDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDisruptionBudgetDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -250,14 +304,42 @@ func (d *PodDisruptionBudgetSpecDie) DieFeedPtr(r *policyv1.PodDisruptionBudgetS return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieFeedJSON(j []byte) *PodDisruptionBudgetSpecDie { + r := policyv1.PodDisruptionBudgetSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieFeedYAML(y []byte) *PodDisruptionBudgetSpecDie { r := policyv1.PodDisruptionBudgetSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieFeedYAMLFile(name string) *PodDisruptionBudgetSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodDisruptionBudgetSpecDie) DieRelease() policyv1.PodDisruptionBudgetSpec { if d.mutable { @@ -272,12 +354,33 @@ func (d *PodDisruptionBudgetSpecDie) DieReleasePtr() *policyv1.PodDisruptionBudg return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -400,14 +503,42 @@ func (d *PodDisruptionBudgetStatusDie) DieFeedPtr(r *policyv1.PodDisruptionBudge return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieFeedJSON(j []byte) *PodDisruptionBudgetStatusDie { + r := policyv1.PodDisruptionBudgetStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieFeedYAML(y []byte) *PodDisruptionBudgetStatusDie { r := policyv1.PodDisruptionBudgetStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieFeedYAMLFile(name string) *PodDisruptionBudgetStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *PodDisruptionBudgetStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodDisruptionBudgetStatusDie) DieRelease() policyv1.PodDisruptionBudgetStatus { if d.mutable { @@ -422,12 +553,33 @@ func (d *PodDisruptionBudgetStatusDie) DieReleasePtr() *policyv1.PodDisruptionBu return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodDisruptionBudgetStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodDisruptionBudgetStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/policy/v1beta1/zz_generated.die.go b/apis/policy/v1beta1/zz_generated.die.go index d074785..d7407c5 100644 --- a/apis/policy/v1beta1/zz_generated.die.go +++ b/apis/policy/v1beta1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var PodSecurityPolicyBlank = (&PodSecurityPolicyDie{}).DieFeed(policyv1beta1.PodSecurityPolicy{}) @@ -72,14 +74,42 @@ func (d *PodSecurityPolicyDie) DieFeedPtr(r *policyv1beta1.PodSecurityPolicy) *P return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityPolicyDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodSecurityPolicyDie) DieFeedJSON(j []byte) *PodSecurityPolicyDie { + r := policyv1beta1.PodSecurityPolicy{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodSecurityPolicyDie) DieFeedYAML(y []byte) *PodSecurityPolicyDie { r := policyv1beta1.PodSecurityPolicy{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodSecurityPolicyDie) DieFeedYAMLFile(name string) *PodSecurityPolicyDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityPolicyDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityPolicyDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodSecurityPolicyDie) DieRelease() policyv1beta1.PodSecurityPolicy { if d.mutable { @@ -94,21 +124,45 @@ func (d *PodSecurityPolicyDie) DieReleasePtr() *policyv1beta1.PodSecurityPolicy return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PodSecurityPolicyDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityPolicyDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodSecurityPolicyDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodSecurityPolicyDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityPolicyDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -233,14 +287,42 @@ func (d *PodSecurityPolicySpecDie) DieFeedPtr(r *policyv1beta1.PodSecurityPolicy return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityPolicySpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityPolicySpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PodSecurityPolicySpecDie) DieFeedJSON(j []byte) *PodSecurityPolicySpecDie { + r := policyv1beta1.PodSecurityPolicySpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PodSecurityPolicySpecDie) DieFeedYAML(y []byte) *PodSecurityPolicySpecDie { r := policyv1beta1.PodSecurityPolicySpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PodSecurityPolicySpecDie) DieFeedYAMLFile(name string) *PodSecurityPolicySpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityPolicySpecDie) DieFeedRawExtension(raw runtime.RawExtension) *PodSecurityPolicySpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PodSecurityPolicySpecDie) DieRelease() policyv1beta1.PodSecurityPolicySpec { if d.mutable { @@ -255,12 +337,33 @@ func (d *PodSecurityPolicySpecDie) DieReleasePtr() *policyv1beta1.PodSecurityPol return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PodSecurityPolicySpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PodSecurityPolicySpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PodSecurityPolicySpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PodSecurityPolicySpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -489,14 +592,42 @@ func (d *HostPortRangeDie) DieFeedPtr(r *policyv1beta1.HostPortRange) *HostPortR return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *HostPortRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *HostPortRangeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *HostPortRangeDie) DieFeedJSON(j []byte) *HostPortRangeDie { r := policyv1beta1.HostPortRange{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *HostPortRangeDie) DieFeedYAML(y []byte) *HostPortRangeDie { + r := policyv1beta1.HostPortRange{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *HostPortRangeDie) DieFeedYAMLFile(name string) *HostPortRangeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostPortRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *HostPortRangeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *HostPortRangeDie) DieRelease() policyv1beta1.HostPortRange { if d.mutable { @@ -511,12 +642,33 @@ func (d *HostPortRangeDie) DieReleasePtr() *policyv1beta1.HostPortRange { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *HostPortRangeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *HostPortRangeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *HostPortRangeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *HostPortRangeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -587,14 +739,42 @@ func (d *SELinuxStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.SELinuxStrategyO return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SELinuxStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SELinuxStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieFeedJSON(j []byte) *SELinuxStrategyOptionsDie { r := policyv1beta1.SELinuxStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieFeedYAML(y []byte) *SELinuxStrategyOptionsDie { + r := policyv1beta1.SELinuxStrategyOptions{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieFeedYAMLFile(name string) *SELinuxStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SELinuxStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SELinuxStrategyOptionsDie) DieRelease() policyv1beta1.SELinuxStrategyOptions { if d.mutable { @@ -609,12 +789,33 @@ func (d *SELinuxStrategyOptionsDie) DieReleasePtr() *policyv1beta1.SELinuxStrate return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SELinuxStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SELinuxStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -685,14 +886,42 @@ func (d *RunAsUserStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.RunAsUserStrat return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RunAsUserStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RunAsUserStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieFeedJSON(j []byte) *RunAsUserStrategyOptionsDie { r := policyv1beta1.RunAsUserStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieFeedYAML(y []byte) *RunAsUserStrategyOptionsDie { + r := policyv1beta1.RunAsUserStrategyOptions{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieFeedYAMLFile(name string) *RunAsUserStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RunAsUserStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RunAsUserStrategyOptionsDie) DieRelease() policyv1beta1.RunAsUserStrategyOptions { if d.mutable { @@ -707,12 +936,33 @@ func (d *RunAsUserStrategyOptionsDie) DieReleasePtr() *policyv1beta1.RunAsUserSt return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RunAsUserStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RunAsUserStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -783,14 +1033,42 @@ func (d *RunAsGroupStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.RunAsGroupStr return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RunAsGroupStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RunAsGroupStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieFeedJSON(j []byte) *RunAsGroupStrategyOptionsDie { + r := policyv1beta1.RunAsGroupStrategyOptions{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieFeedYAML(y []byte) *RunAsGroupStrategyOptionsDie { r := policyv1beta1.RunAsGroupStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieFeedYAMLFile(name string) *RunAsGroupStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RunAsGroupStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RunAsGroupStrategyOptionsDie) DieRelease() policyv1beta1.RunAsGroupStrategyOptions { if d.mutable { @@ -805,12 +1083,33 @@ func (d *RunAsGroupStrategyOptionsDie) DieReleasePtr() *policyv1beta1.RunAsGroup return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RunAsGroupStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RunAsGroupStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -881,14 +1180,42 @@ func (d *SupplementalGroupsStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.Suppl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *SupplementalGroupsStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SupplementalGroupsStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieFeedJSON(j []byte) *SupplementalGroupsStrategyOptionsDie { r := policyv1beta1.SupplementalGroupsStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieFeedYAML(y []byte) *SupplementalGroupsStrategyOptionsDie { + r := policyv1beta1.SupplementalGroupsStrategyOptions{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieFeedYAMLFile(name string) *SupplementalGroupsStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *SupplementalGroupsStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *SupplementalGroupsStrategyOptionsDie) DieRelease() policyv1beta1.SupplementalGroupsStrategyOptions { if d.mutable { @@ -903,12 +1230,33 @@ func (d *SupplementalGroupsStrategyOptionsDie) DieReleasePtr() *policyv1beta1.Su return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *SupplementalGroupsStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *SupplementalGroupsStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -979,14 +1327,42 @@ func (d *FSGroupStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.FSGroupStrategyO return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *FSGroupStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *FSGroupStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieFeedJSON(j []byte) *FSGroupStrategyOptionsDie { + r := policyv1beta1.FSGroupStrategyOptions{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieFeedYAML(y []byte) *FSGroupStrategyOptionsDie { r := policyv1beta1.FSGroupStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieFeedYAMLFile(name string) *FSGroupStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *FSGroupStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *FSGroupStrategyOptionsDie) DieRelease() policyv1beta1.FSGroupStrategyOptions { if d.mutable { @@ -1001,12 +1377,33 @@ func (d *FSGroupStrategyOptionsDie) DieReleasePtr() *policyv1beta1.FSGroupStrate return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *FSGroupStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *FSGroupStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1077,14 +1474,42 @@ func (d *AllowedHostPathDie) DieFeedPtr(r *policyv1beta1.AllowedHostPath) *Allow return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedHostPathDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedHostPathDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AllowedHostPathDie) DieFeedJSON(j []byte) *AllowedHostPathDie { + r := policyv1beta1.AllowedHostPath{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AllowedHostPathDie) DieFeedYAML(y []byte) *AllowedHostPathDie { r := policyv1beta1.AllowedHostPath{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AllowedHostPathDie) DieFeedYAMLFile(name string) *AllowedHostPathDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedHostPathDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedHostPathDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AllowedHostPathDie) DieRelease() policyv1beta1.AllowedHostPath { if d.mutable { @@ -1099,12 +1524,33 @@ func (d *AllowedHostPathDie) DieReleasePtr() *policyv1beta1.AllowedHostPath { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedHostPathDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AllowedHostPathDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AllowedHostPathDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedHostPathDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1177,14 +1623,42 @@ func (d *AllowedFlexVolumeDie) DieFeedPtr(r *policyv1beta1.AllowedFlexVolume) *A return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedFlexVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedFlexVolumeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AllowedFlexVolumeDie) DieFeedJSON(j []byte) *AllowedFlexVolumeDie { + r := policyv1beta1.AllowedFlexVolume{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AllowedFlexVolumeDie) DieFeedYAML(y []byte) *AllowedFlexVolumeDie { r := policyv1beta1.AllowedFlexVolume{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AllowedFlexVolumeDie) DieFeedYAMLFile(name string) *AllowedFlexVolumeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedFlexVolumeDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedFlexVolumeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AllowedFlexVolumeDie) DieRelease() policyv1beta1.AllowedFlexVolume { if d.mutable { @@ -1199,12 +1673,33 @@ func (d *AllowedFlexVolumeDie) DieReleasePtr() *policyv1beta1.AllowedFlexVolume return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedFlexVolumeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AllowedFlexVolumeDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AllowedFlexVolumeDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedFlexVolumeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1268,14 +1763,42 @@ func (d *AllowedCSIDriverDie) DieFeedPtr(r *policyv1beta1.AllowedCSIDriver) *All return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedCSIDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedCSIDriverDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *AllowedCSIDriverDie) DieFeedJSON(j []byte) *AllowedCSIDriverDie { + r := policyv1beta1.AllowedCSIDriver{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *AllowedCSIDriverDie) DieFeedYAML(y []byte) *AllowedCSIDriverDie { r := policyv1beta1.AllowedCSIDriver{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *AllowedCSIDriverDie) DieFeedYAMLFile(name string) *AllowedCSIDriverDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedCSIDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *AllowedCSIDriverDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *AllowedCSIDriverDie) DieRelease() policyv1beta1.AllowedCSIDriver { if d.mutable { @@ -1290,12 +1813,33 @@ func (d *AllowedCSIDriverDie) DieReleasePtr() *policyv1beta1.AllowedCSIDriver { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *AllowedCSIDriverDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *AllowedCSIDriverDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *AllowedCSIDriverDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *AllowedCSIDriverDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1359,14 +1903,42 @@ func (d *RuntimeClassStrategyOptionsDie) DieFeedPtr(r *policyv1beta1.RuntimeClas return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *RuntimeClassStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RuntimeClassStrategyOptionsDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieFeedJSON(j []byte) *RuntimeClassStrategyOptionsDie { r := policyv1beta1.RuntimeClassStrategyOptions{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieFeedYAML(y []byte) *RuntimeClassStrategyOptionsDie { + r := policyv1beta1.RuntimeClassStrategyOptions{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieFeedYAMLFile(name string) *RuntimeClassStrategyOptionsDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieFeedRawExtension(raw runtime.RawExtension) *RuntimeClassStrategyOptionsDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *RuntimeClassStrategyOptionsDie) DieRelease() policyv1beta1.RuntimeClassStrategyOptions { if d.mutable { @@ -1381,12 +1953,33 @@ func (d *RuntimeClassStrategyOptionsDie) DieReleasePtr() *policyv1beta1.RuntimeC return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *RuntimeClassStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *RuntimeClassStrategyOptionsDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1457,14 +2050,42 @@ func (d *IDRangeDie) DieFeedPtr(r *policyv1beta1.IDRange) *IDRangeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *IDRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *IDRangeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *IDRangeDie) DieFeedJSON(j []byte) *IDRangeDie { r := policyv1beta1.IDRange{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *IDRangeDie) DieFeedYAML(y []byte) *IDRangeDie { + r := policyv1beta1.IDRange{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *IDRangeDie) DieFeedYAMLFile(name string) *IDRangeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IDRangeDie) DieFeedRawExtension(raw runtime.RawExtension) *IDRangeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *IDRangeDie) DieRelease() policyv1beta1.IDRange { if d.mutable { @@ -1479,12 +2100,33 @@ func (d *IDRangeDie) DieReleasePtr() *policyv1beta1.IDRange { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *IDRangeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *IDRangeDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *IDRangeDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *IDRangeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/scheduling/v1/zz_generated.die.go b/apis/scheduling/v1/zz_generated.die.go index 64fb51d..43583c5 100644 --- a/apis/scheduling/v1/zz_generated.die.go +++ b/apis/scheduling/v1/zz_generated.die.go @@ -30,6 +30,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var PriorityClassBlank = (&PriorityClassDie{}).DieFeed(schedulingv1.PriorityClass{}) @@ -72,14 +74,42 @@ func (d *PriorityClassDie) DieFeedPtr(r *schedulingv1.PriorityClass) *PriorityCl return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityClassDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityClassDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *PriorityClassDie) DieFeedJSON(j []byte) *PriorityClassDie { r := schedulingv1.PriorityClass{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *PriorityClassDie) DieFeedYAML(y []byte) *PriorityClassDie { + r := schedulingv1.PriorityClass{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *PriorityClassDie) DieFeedYAMLFile(name string) *PriorityClassDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityClassDie) DieFeedRawExtension(raw runtime.RawExtension) *PriorityClassDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *PriorityClassDie) DieRelease() schedulingv1.PriorityClass { if d.mutable { @@ -94,21 +124,45 @@ func (d *PriorityClassDie) DieReleasePtr() *schedulingv1.PriorityClass { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *PriorityClassDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *PriorityClassDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *PriorityClassDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *PriorityClassDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *PriorityClassDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/storage/v1/zz_generated.die.go b/apis/storage/v1/zz_generated.die.go index 347b680..a1f9211 100644 --- a/apis/storage/v1/zz_generated.die.go +++ b/apis/storage/v1/zz_generated.die.go @@ -31,6 +31,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var CSIDriverBlank = (&CSIDriverDie{}).DieFeed(storagev1.CSIDriver{}) @@ -73,14 +75,42 @@ func (d *CSIDriverDie) DieFeedPtr(r *storagev1.CSIDriver) *CSIDriverDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIDriverDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSIDriverDie) DieFeedJSON(j []byte) *CSIDriverDie { + r := storagev1.CSIDriver{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSIDriverDie) DieFeedYAML(y []byte) *CSIDriverDie { r := storagev1.CSIDriver{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSIDriverDie) DieFeedYAMLFile(name string) *CSIDriverDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIDriverDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSIDriverDie) DieRelease() storagev1.CSIDriver { if d.mutable { @@ -95,21 +125,45 @@ func (d *CSIDriverDie) DieReleasePtr() *storagev1.CSIDriver { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CSIDriverDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIDriverDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSIDriverDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSIDriverDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIDriverDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -234,14 +288,42 @@ func (d *CSIDriverSpecDie) DieFeedPtr(r *storagev1.CSIDriverSpec) *CSIDriverSpec return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIDriverSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIDriverSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSIDriverSpecDie) DieFeedJSON(j []byte) *CSIDriverSpecDie { + r := storagev1.CSIDriverSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSIDriverSpecDie) DieFeedYAML(y []byte) *CSIDriverSpecDie { r := storagev1.CSIDriverSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSIDriverSpecDie) DieFeedYAMLFile(name string) *CSIDriverSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIDriverSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIDriverSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSIDriverSpecDie) DieRelease() storagev1.CSIDriverSpec { if d.mutable { @@ -256,12 +338,33 @@ func (d *CSIDriverSpecDie) DieReleasePtr() *storagev1.CSIDriverSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIDriverSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSIDriverSpecDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSIDriverSpecDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIDriverSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -402,14 +505,42 @@ func (d *TokenRequestDie) DieFeedPtr(r *storagev1.TokenRequest) *TokenRequestDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *TokenRequestDie) DieFeedJSON(j []byte) *TokenRequestDie { r := storagev1.TokenRequest{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *TokenRequestDie) DieFeedYAML(y []byte) *TokenRequestDie { + r := storagev1.TokenRequest{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *TokenRequestDie) DieFeedYAMLFile(name string) *TokenRequestDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *TokenRequestDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *TokenRequestDie) DieRelease() storagev1.TokenRequest { if d.mutable { @@ -424,12 +555,33 @@ func (d *TokenRequestDie) DieReleasePtr() *storagev1.TokenRequest { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *TokenRequestDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *TokenRequestDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *TokenRequestDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *TokenRequestDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -503,14 +655,42 @@ func (d *CSINodeDie) DieFeedPtr(r *storagev1.CSINode) *CSINodeDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSINodeDie) DieFeedJSON(j []byte) *CSINodeDie { + r := storagev1.CSINode{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSINodeDie) DieFeedYAML(y []byte) *CSINodeDie { r := storagev1.CSINode{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSINodeDie) DieFeedYAMLFile(name string) *CSINodeDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSINodeDie) DieRelease() storagev1.CSINode { if d.mutable { @@ -525,21 +705,45 @@ func (d *CSINodeDie) DieReleasePtr() *storagev1.CSINode { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CSINodeDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSINodeDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSINodeDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -664,14 +868,42 @@ func (d *CSINodeSpecDie) DieFeedPtr(r *storagev1.CSINodeSpec) *CSINodeSpecDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSINodeSpecDie) DieFeedJSON(j []byte) *CSINodeSpecDie { r := storagev1.CSINodeSpec{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSINodeSpecDie) DieFeedYAML(y []byte) *CSINodeSpecDie { + r := storagev1.CSINodeSpec{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSINodeSpecDie) DieFeedYAMLFile(name string) *CSINodeSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSINodeSpecDie) DieRelease() storagev1.CSINodeSpec { if d.mutable { @@ -686,12 +918,33 @@ func (d *CSINodeSpecDie) DieReleasePtr() *storagev1.CSINodeSpec { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSINodeSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSINodeSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -755,14 +1008,42 @@ func (d *CSINodeDriverDie) DieFeedPtr(r *storagev1.CSINodeDriver) *CSINodeDriver return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeDriverDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSINodeDriverDie) DieFeedJSON(j []byte) *CSINodeDriverDie { + r := storagev1.CSINodeDriver{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSINodeDriverDie) DieFeedYAML(y []byte) *CSINodeDriverDie { r := storagev1.CSINodeDriver{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSINodeDriverDie) DieFeedYAMLFile(name string) *CSINodeDriverDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeDriverDie) DieFeedRawExtension(raw runtime.RawExtension) *CSINodeDriverDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSINodeDriverDie) DieRelease() storagev1.CSINodeDriver { if d.mutable { @@ -777,12 +1058,33 @@ func (d *CSINodeDriverDie) DieReleasePtr() *storagev1.CSINodeDriver { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSINodeDriverDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSINodeDriverDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSINodeDriverDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSINodeDriverDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -867,14 +1169,42 @@ func (d *VolumeNodeResourcesDie) DieFeedPtr(r *storagev1.VolumeNodeResources) *V return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeNodeResourcesDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeNodeResourcesDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeNodeResourcesDie) DieFeedJSON(j []byte) *VolumeNodeResourcesDie { r := storagev1.VolumeNodeResources{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeNodeResourcesDie) DieFeedYAML(y []byte) *VolumeNodeResourcesDie { + r := storagev1.VolumeNodeResources{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeNodeResourcesDie) DieFeedYAMLFile(name string) *VolumeNodeResourcesDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeNodeResourcesDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeNodeResourcesDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeNodeResourcesDie) DieRelease() storagev1.VolumeNodeResources { if d.mutable { @@ -889,12 +1219,33 @@ func (d *VolumeNodeResourcesDie) DieReleasePtr() *storagev1.VolumeNodeResources return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeNodeResourcesDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeNodeResourcesDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeNodeResourcesDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeNodeResourcesDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -961,14 +1312,42 @@ func (d *StorageClassDie) DieFeedPtr(r *storagev1.StorageClass) *StorageClassDie return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageClassDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageClassDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *StorageClassDie) DieFeedJSON(j []byte) *StorageClassDie { + r := storagev1.StorageClass{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *StorageClassDie) DieFeedYAML(y []byte) *StorageClassDie { r := storagev1.StorageClass{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *StorageClassDie) DieFeedYAMLFile(name string) *StorageClassDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageClassDie) DieFeedRawExtension(raw runtime.RawExtension) *StorageClassDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *StorageClassDie) DieRelease() storagev1.StorageClass { if d.mutable { @@ -983,21 +1362,45 @@ func (d *StorageClassDie) DieReleasePtr() *storagev1.StorageClass { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *StorageClassDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *StorageClassDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *StorageClassDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *StorageClassDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *StorageClassDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1158,14 +1561,42 @@ func (d *VolumeAttachmentDie) DieFeedPtr(r *storagev1.VolumeAttachment) *VolumeA return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeAttachmentDie) DieFeedJSON(j []byte) *VolumeAttachmentDie { r := storagev1.VolumeAttachment{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeAttachmentDie) DieFeedYAML(y []byte) *VolumeAttachmentDie { + r := storagev1.VolumeAttachment{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeAttachmentDie) DieFeedYAMLFile(name string) *VolumeAttachmentDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeAttachmentDie) DieRelease() storagev1.VolumeAttachment { if d.mutable { @@ -1180,21 +1611,45 @@ func (d *VolumeAttachmentDie) DieReleasePtr() *storagev1.VolumeAttachment { return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *VolumeAttachmentDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeAttachmentDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeAttachmentDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1335,14 +1790,42 @@ func (d *VolumeAttachmentSpecDie) DieFeedPtr(r *storagev1.VolumeAttachmentSpec) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentSpecDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeAttachmentSpecDie) DieFeedJSON(j []byte) *VolumeAttachmentSpecDie { + r := storagev1.VolumeAttachmentSpec{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeAttachmentSpecDie) DieFeedYAML(y []byte) *VolumeAttachmentSpecDie { r := storagev1.VolumeAttachmentSpec{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeAttachmentSpecDie) DieFeedYAMLFile(name string) *VolumeAttachmentSpecDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentSpecDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentSpecDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeAttachmentSpecDie) DieRelease() storagev1.VolumeAttachmentSpec { if d.mutable { @@ -1357,12 +1840,33 @@ func (d *VolumeAttachmentSpecDie) DieReleasePtr() *storagev1.VolumeAttachmentSpe return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentSpecDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeAttachmentSpecDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeAttachmentSpecDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentSpecDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1440,14 +1944,42 @@ func (d *VolumeAttachmentSourceDie) DieFeedPtr(r *storagev1.VolumeAttachmentSour return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentSourceDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeAttachmentSourceDie) DieFeedJSON(j []byte) *VolumeAttachmentSourceDie { + r := storagev1.VolumeAttachmentSource{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeAttachmentSourceDie) DieFeedYAML(y []byte) *VolumeAttachmentSourceDie { r := storagev1.VolumeAttachmentSource{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeAttachmentSourceDie) DieFeedYAMLFile(name string) *VolumeAttachmentSourceDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentSourceDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentSourceDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeAttachmentSourceDie) DieRelease() storagev1.VolumeAttachmentSource { if d.mutable { @@ -1462,12 +1994,33 @@ func (d *VolumeAttachmentSourceDie) DieReleasePtr() *storagev1.VolumeAttachmentS return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentSourceDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeAttachmentSourceDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeAttachmentSourceDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentSourceDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1538,14 +2091,42 @@ func (d *VolumeAttachmentStatusDie) DieFeedPtr(r *storagev1.VolumeAttachmentStat return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentStatusDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeAttachmentStatusDie) DieFeedJSON(j []byte) *VolumeAttachmentStatusDie { + r := storagev1.VolumeAttachmentStatus{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeAttachmentStatusDie) DieFeedYAML(y []byte) *VolumeAttachmentStatusDie { r := storagev1.VolumeAttachmentStatus{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeAttachmentStatusDie) DieFeedYAMLFile(name string) *VolumeAttachmentStatusDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentStatusDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeAttachmentStatusDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeAttachmentStatusDie) DieRelease() storagev1.VolumeAttachmentStatus { if d.mutable { @@ -1560,12 +2141,33 @@ func (d *VolumeAttachmentStatusDie) DieReleasePtr() *storagev1.VolumeAttachmentS return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeAttachmentStatusDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeAttachmentStatusDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeAttachmentStatusDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeAttachmentStatusDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } @@ -1650,14 +2252,42 @@ func (d *VolumeErrorDie) DieFeedPtr(r *storagev1.VolumeError) *VolumeErrorDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeErrorDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeErrorDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *VolumeErrorDie) DieFeedJSON(j []byte) *VolumeErrorDie { r := storagev1.VolumeError{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *VolumeErrorDie) DieFeedYAML(y []byte) *VolumeErrorDie { + r := storagev1.VolumeError{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *VolumeErrorDie) DieFeedYAMLFile(name string) *VolumeErrorDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeErrorDie) DieFeedRawExtension(raw runtime.RawExtension) *VolumeErrorDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *VolumeErrorDie) DieRelease() storagev1.VolumeError { if d.mutable { @@ -1672,12 +2302,33 @@ func (d *VolumeErrorDie) DieReleasePtr() *storagev1.VolumeError { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *VolumeErrorDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *VolumeErrorDie) DieReleaseJSON() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *VolumeErrorDie) DieReleaseYAML() []byte { + r := d.DieReleasePtr() + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *VolumeErrorDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/apis/storage/v1beta1/zz_generated.die.go b/apis/storage/v1beta1/zz_generated.die.go index 01a2a26..674ba6c 100644 --- a/apis/storage/v1beta1/zz_generated.die.go +++ b/apis/storage/v1beta1/zz_generated.die.go @@ -31,6 +31,8 @@ import ( unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + osx "os" + yaml "sigs.k8s.io/yaml" ) var CSIStorageCapacityBlank = (&CSIStorageCapacityDie{}).DieFeed(storagev1beta1.CSIStorageCapacity{}) @@ -73,14 +75,42 @@ func (d *CSIStorageCapacityDie) DieFeedPtr(r *storagev1beta1.CSIStorageCapacity) return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIStorageCapacityDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIStorageCapacityDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *CSIStorageCapacityDie) DieFeedJSON(j []byte) *CSIStorageCapacityDie { r := storagev1beta1.CSIStorageCapacity{} - _ = json.Unmarshal(b, &r) + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *CSIStorageCapacityDie) DieFeedYAML(y []byte) *CSIStorageCapacityDie { + r := storagev1beta1.CSIStorageCapacity{} + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *CSIStorageCapacityDie) DieFeedYAMLFile(name string) *CSIStorageCapacityDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIStorageCapacityDie) DieFeedRawExtension(raw runtime.RawExtension) *CSIStorageCapacityDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *CSIStorageCapacityDie) DieRelease() storagev1beta1.CSIStorageCapacity { if d.mutable { @@ -95,21 +125,45 @@ func (d *CSIStorageCapacityDie) DieReleasePtr() *storagev1beta1.CSIStorageCapaci return &r } -// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. +// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error. func (d *CSIStorageCapacityDie) DieReleaseUnstructured() *unstructured.Unstructured { r := d.DieReleasePtr() - u, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + panic(err) + } return &unstructured.Unstructured{ Object: u, } } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *CSIStorageCapacityDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *CSIStorageCapacityDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *CSIStorageCapacityDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *CSIStorageCapacityDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw } diff --git a/diegen/die/gen.go b/diegen/die/gen.go index 2b2c50b..7a6e6fe 100644 --- a/diegen/die/gen.go +++ b/diegen/die/gen.go @@ -237,7 +237,7 @@ func (ctx *ObjectGenCtx) generateForPackage(root *loader.Package) ([]byte, []byt testContent := new(bytes.Buffer) dies := []Die{} - dieSet := sets.NewString() + dieSet := sets.New[string]() fieldMap := map[string][]Field{} if err := markers.EachType(ctx.Collector, root, func(info *markers.TypeInfo) { diff --git a/diegen/die/traverse.go b/diegen/die/traverse.go index 3ecb522..3111386 100644 --- a/diegen/die/traverse.go +++ b/diegen/die/traverse.go @@ -141,7 +141,7 @@ type copyMethodMaker struct { *importsList *codeWriter test *copyMethodMaker - dies sets.String + dies sets.Set[string] } func (c *copyMethodMaker) GenerateMethodsFor(die Die, fields []Field) { @@ -253,14 +253,46 @@ func (c *copyMethodMaker) generateDieFeedMethodFor(die Die) { c.Linef(" }") c.Linef(" return d.DieFeed(*r)") c.Linef("}") + c.Linef("") - c.Linef("// DieFeedRawExtension returns the resource managed by the die as an raw extension.") - c.Linef("func (d *%s) DieFeedRawExtension(raw %s) *%s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "RawExtension"), die.Type) - c.Linef(" b, _ := %s(raw)", c.AliasedRef("encoding/json", "Marshal")) + c.Linef("// DieFeedJSON returns a new die with the provided JSON. Panics on error.") + c.Linef("func (d *%s) DieFeedJSON(j []byte) *%s {", die.Type, die.Type) c.Linef(" r := %s{}", c.AliasedRef(die.TargetPackage, die.TargetType)) - c.Linef(" _ = %s(b, &r)", c.AliasedRef("encoding/json", "Unmarshal")) + c.Linef(" if err := %s(j, &r); err != nil {", c.AliasedRef("encoding/json", "Unmarshal")) + c.Linef(" panic(err)") + c.Linef(" }") + c.Linef(" return d.DieFeed(r)") + c.Linef("}") + + c.Linef("") + c.Linef("// DieFeedYAML returns a new die with the provided YAML. Panics on error.") + c.Linef("func (d *%s) DieFeedYAML(y []byte) *%s {", die.Type, die.Type) + c.Linef(" r := %s{}", c.AliasedRef(die.TargetPackage, die.TargetType)) + c.Linef(" if err := %s(y, &r); err != nil {", c.AliasedRef("sigs.k8s.io/yaml", "Unmarshal")) + c.Linef(" panic(err)") + c.Linef(" }") c.Linef(" return d.DieFeed(r)") c.Linef("}") + + c.Linef("") + c.Linef("// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.") + c.Linef("func (d *%s) DieFeedYAMLFile(name string) *%s {", die.Type, die.Type) + c.Linef(" y, err := %s(name)", c.AliasedRef("os", "ReadFile")) + c.Linef(" if err != nil {") + c.Linef(" panic(err)") + c.Linef(" }") + c.Linef(" return d.DieFeedYAML(y)") + c.Linef("}") + + c.Linef("") + c.Linef("// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error.") + c.Linef("func (d *%s) DieFeedRawExtension(raw %s) *%s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "RawExtension"), die.Type) + c.Linef(" j, err := %s(raw)", c.AliasedRef("encoding/json", "Marshal")) + c.Linef(" if err != nil {") + c.Linef(" panic(err)") + c.Linef(" }") + c.Linef(" return d.DieFeedJSON(j)") + c.Linef("}") } func (c *copyMethodMaker) generateDieReleaseMethodFor(die Die) { @@ -272,6 +304,7 @@ func (c *copyMethodMaker) generateDieReleaseMethodFor(die Die) { c.Linef(" }") c.Linef(" return *d.r.DeepCopy()") c.Linef("}") + c.Linef("") c.Linef("// DieReleasePtr returns a pointer to the resource managed by the die.") c.Linef("func (d *%s) DieReleasePtr() *%s {", die.Type, c.AliasedRef(die.TargetPackage, die.TargetType)) @@ -280,22 +313,49 @@ func (c *copyMethodMaker) generateDieReleaseMethodFor(die Die) { c.Linef("}") if die.Object { c.Linef("") - c.Linef("// DieReleaseUnstructured returns the resource managed by the die as an unstructured object.") + c.Linef("// DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error.") c.Linef("func (d *%s) DieReleaseUnstructured() *%s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "Unstructured")) c.Linef(" r := d.DieReleasePtr()") - c.Linef(" u, _ := %s.ToUnstructured(r)", c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "DefaultUnstructuredConverter")) + c.Linef(" u, err := %s.ToUnstructured(r)", c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "DefaultUnstructuredConverter")) + c.Linef(" if err != nil {") + c.Linef(" panic(err)") + c.Linef(" }") c.Linef(" return &%s{", c.AliasedRef("k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "Unstructured")) c.Linef(" Object: u,") c.Linef(" }") c.Linef("}") } + c.Linef("") - c.Linef("// DieReleaseRawExtension returns the resource managed by the die as an raw extension.") - c.Linef("func (d *%s) DieReleaseRawExtension() %s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "RawExtension")) + c.Linef("// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.") + c.Linef("func (d *%s) DieReleaseJSON() []byte {", die.Type) + c.Linef(" r := d.DieReleasePtr()") + c.Linef(" j, err := %s(r)", c.AliasedRef("encoding/json", "Marshal")) + c.Linef(" if err != nil {") + c.Linef(" panic(err)") + c.Linef(" }") + c.Linef(" return j") + c.Linef("}") + + c.Linef("") + c.Linef("// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.") + c.Linef("func (d *%s) DieReleaseYAML() []byte {", die.Type) c.Linef(" r := d.DieReleasePtr()") - c.Linef(" b, _ := %s(r)", c.AliasedRef("encoding/json", "Marshal")) + c.Linef(" y, err := %s(r)", c.AliasedRef("sigs.k8s.io/yaml", "Marshal")) + c.Linef(" if err != nil {") + c.Linef(" panic(err)") + c.Linef(" }") + c.Linef(" return y") + c.Linef("}") + + c.Linef("") + c.Linef("// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error.") + c.Linef("func (d *%s) DieReleaseRawExtension() %s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "RawExtension")) + c.Linef(" j := d.DieReleaseJSON()") c.Linef(" raw := %s{}", c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "RawExtension")) - c.Linef(" _ = %s(b, &raw)", c.AliasedRef("encoding/json", "Unmarshal")) + c.Linef(" if err := %s(j, &raw); err != nil {", c.AliasedRef("encoding/json", "Unmarshal")) + c.Linef(" panic(err)") + c.Linef(" }") c.Linef(" return raw") c.Linef("}") } @@ -347,6 +407,7 @@ func (c *copyMethodMaker) generateRuntimeObjectMethodsFor(die Die) { c.Linef("func (d *%s) DeepCopyObject() %s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime", "Object")) c.Linef(" return d.r.DeepCopy()") c.Linef("}") + c.Linef("") c.Linef("func (d *%s) GetObjectKind() %s {", die.Type, c.AliasedRef("k8s.io/apimachinery/pkg/runtime/schema", "ObjectKind")) c.Linef(" r := d.DieRelease()") @@ -359,6 +420,7 @@ func (c *copyMethodMaker) generateJSONMethodsFor(die Die) { c.Linef("func (d *%s) MarshalJSON() ([]byte, error) {", die.Type) c.Linef(" return %s(d.r)", c.AliasedRef("encoding/json", "Marshal")) c.Linef("}") + c.Linef("") c.Linef("func (d *%s) UnmarshalJSON(b []byte) error {", die.Type) c.Linef(" if d == %s {", die.Blank) diff --git a/go.mod b/go.mod index 2d0941a..bcab6af 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( k8s.io/apimachinery v0.26.2 k8s.io/kube-aggregator v0.26.2 k8s.io/utils v0.0.0-20221107191617-1a15be271d1d + sigs.k8s.io/yaml v1.3.0 ) require ( diff --git a/go.sum b/go.sum index b2d3f75..12e2692 100644 --- a/go.sum +++ b/go.sum @@ -84,3 +84,4 @@ sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h6 sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/testing/sandbox/zz_generated.die.go b/testing/sandbox/zz_generated.die.go index 5b461be..3821deb 100644 --- a/testing/sandbox/zz_generated.die.go +++ b/testing/sandbox/zz_generated.die.go @@ -24,6 +24,8 @@ package sandbox import ( json "encoding/json" runtime "k8s.io/apimachinery/pkg/runtime" + osx "os" + yaml "sigs.k8s.io/yaml" ) var DirectBlank = (&DirectDie{}).DieFeed(Direct{}) @@ -63,14 +65,42 @@ func (d *DirectDie) DieFeedPtr(r *Direct) *DirectDie { return d.DieFeed(*r) } -// DieFeedRawExtension returns the resource managed by the die as an raw extension. -func (d *DirectDie) DieFeedRawExtension(raw runtime.RawExtension) *DirectDie { - b, _ := json.Marshal(raw) +// DieFeedJSON returns a new die with the provided JSON. Panics on error. +func (d *DirectDie) DieFeedJSON(j []byte) *DirectDie { + r := Direct{} + if err := json.Unmarshal(j, &r); err != nil { + panic(err) + } + return d.DieFeed(r) +} + +// DieFeedYAML returns a new die with the provided YAML. Panics on error. +func (d *DirectDie) DieFeedYAML(y []byte) *DirectDie { r := Direct{} - _ = json.Unmarshal(b, &r) + if err := yaml.Unmarshal(y, &r); err != nil { + panic(err) + } return d.DieFeed(r) } +// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error. +func (d *DirectDie) DieFeedYAMLFile(name string) *DirectDie { + y, err := osx.ReadFile(name) + if err != nil { + panic(err) + } + return d.DieFeedYAML(y) +} + +// DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DirectDie) DieFeedRawExtension(raw runtime.RawExtension) *DirectDie { + j, err := json.Marshal(raw) + if err != nil { + panic(err) + } + return d.DieFeedJSON(j) +} + // DieRelease returns the resource managed by the die. func (d *DirectDie) DieRelease() Direct { if d.mutable { @@ -85,12 +115,33 @@ func (d *DirectDie) DieReleasePtr() *Direct { return &r } -// DieReleaseRawExtension returns the resource managed by the die as an raw extension. -func (d *DirectDie) DieReleaseRawExtension() runtime.RawExtension { +// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error. +func (d *DirectDie) DieReleaseJSON() []byte { + r := d.DieReleasePtr() + j, err := json.Marshal(r) + if err != nil { + panic(err) + } + return j +} + +// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error. +func (d *DirectDie) DieReleaseYAML() []byte { r := d.DieReleasePtr() - b, _ := json.Marshal(r) + y, err := yaml.Marshal(r) + if err != nil { + panic(err) + } + return y +} + +// DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error. +func (d *DirectDie) DieReleaseRawExtension() runtime.RawExtension { + j := d.DieReleaseJSON() raw := runtime.RawExtension{} - _ = json.Unmarshal(b, &raw) + if err := json.Unmarshal(j, &raw); err != nil { + panic(err) + } return raw }