@@ -17,7 +17,10 @@ limitations under the License.
1717package v1
1818
1919import (
20+ "encoding/json"
21+
2022 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+ runtime "k8s.io/apimachinery/pkg/runtime"
2124)
2225
2326// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! NOTE: json tags are
@@ -32,9 +35,41 @@ type WeightsAndBiasesSpec struct {
3235 // The specification of Weights & Biases Chart that is used to deploy the
3336 // instance.
3437
35- Cdk8sVersion string `json:"version,omitempty"`
36- ReleasePath string `json:"releasePath,omitempty"`
37- License string `json:"license,omitempty"`
38+ Version string `json:"version,omitempty"`
39+ License string `json:"license,omitempty"`
40+ Config ConfigValues `json:"config,omitempty"`
41+ }
42+
43+ // Unstructured values for rendering GitLab Chart.
44+ // +k8s:deepcopy-gen=false
45+ type ConfigValues struct {
46+ // Object is a JSON compatible map with string, float, int, bool, []interface{}, or
47+ // map[string]interface{} children.
48+ Object map [string ]interface {} `json:"-"`
49+ }
50+
51+ // MarshalJSON ensures that the unstructured object produces proper
52+ // JSON when passed to Go's standard JSON library.
53+ func (u * ConfigValues ) MarshalJSON () ([]byte , error ) {
54+ return json .Marshal (u .Object )
55+ }
56+
57+ // UnmarshalJSON ensures that the unstructured object properly decodes
58+ // JSON when passed to Go's standard JSON library.
59+ func (u * ConfigValues ) UnmarshalJSON (data []byte ) error {
60+ m := make (map [string ]interface {})
61+ if err := json .Unmarshal (data , & m ); err != nil {
62+ return err
63+ }
64+
65+ u .Object = m
66+
67+ return nil
68+ }
69+
70+ // Declaring this here prevents it from being generated.
71+ func (u * ConfigValues ) DeepCopyInto (out * ConfigValues ) {
72+ out .Object = runtime .DeepCopyJSON (u .Object )
3873}
3974
4075// WeightsAndBiasesStatus defines the observed state of WeightsAndBiases
0 commit comments