diff --git a/pkg/apis/akash.network/crd.yaml b/pkg/apis/akash.network/crd.yaml index 2bde5868..5aa7a467 100644 --- a/pkg/apis/akash.network/crd.yaml +++ b/pkg/apis/akash.network/crd.yaml @@ -218,6 +218,20 @@ spec: type: string model: type: string + credentials: + type: object + nullable: true + properties: + host: + type: string + email: + type: string + email: + type: string + username: + type: string + password: + type: string - name: v2beta1 served: false storage: false diff --git a/pkg/apis/akash.network/v2beta2/manifest.go b/pkg/apis/akash.network/v2beta2/manifest.go index bed429e5..d1b5681f 100644 --- a/pkg/apis/akash.network/v2beta2/manifest.go +++ b/pkg/apis/akash.network/v2beta2/manifest.go @@ -26,11 +26,19 @@ type Manifest struct { // ManifestList stores metadata and items list of manifest // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ManifestList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` + metav1.TypeMeta ` json:",inline"` + metav1.ListMeta ` json:"metadata"` Items []Manifest `json:"items"` } +// ManifestServiceCredentials stores docker registry credentials +type ManifestServiceCredentials struct { + Host string `json:"host"` + Email string `json:"email"` + Username string `json:"username"` + Password string `json:"password"` +} + // ManifestService stores name, image, args, env, unit, count and expose list of service type ManifestService struct { // Service name @@ -46,8 +54,9 @@ type ManifestService struct { // Overlay Network Links Expose []ManifestServiceExpose `json:"expose,omitempty"` // Miscellaneous service parameters - Params *ManifestServiceParams `json:"params,omitempty"` - SchedulerParams *SchedulerParams `json:"scheduler_params,omitempty"` + Params *ManifestServiceParams `json:"params,omitempty"` + SchedulerParams *SchedulerParams `json:"scheduler_params,omitempty"` + Credentials *ManifestServiceCredentials `json:"credentials,omitempty"` } // ManifestGroup stores metadata, name and list of SDL manifest services @@ -71,8 +80,8 @@ type ManifestStatus struct { } type ManifestStorageParams struct { - Name string `json:"name" yaml:"name"` - Mount string `json:"mount" yaml:"mount"` + Name string `json:"name" yaml:"name"` + Mount string `json:"mount" yaml:"mount"` ReadOnly bool `json:"readOnly" yaml:"readOnly"` } @@ -302,6 +311,15 @@ func manifestServiceFromProvider(ams mani.Service, schedulerParams *SchedulerPar } } + if ams.Credentials != nil { + ms.Credentials = &ManifestServiceCredentials{ + Host: ams.Credentials.Host, + Email: ams.Credentials.Email, + Username: ams.Credentials.Username, + Password: ams.Credentials.Password, + } + } + return ms, nil } diff --git a/pkg/apis/akash.network/v2beta2/zz_generated.deepcopy.go b/pkg/apis/akash.network/v2beta2/zz_generated.deepcopy.go index ace644d5..c458d0e2 100644 --- a/pkg/apis/akash.network/v2beta2/zz_generated.deepcopy.go +++ b/pkg/apis/akash.network/v2beta2/zz_generated.deepcopy.go @@ -417,6 +417,11 @@ func (in *ManifestService) DeepCopyInto(out *ManifestService) { *out = new(SchedulerParams) (*in).DeepCopyInto(*out) } + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = new(ManifestServiceCredentials) + **out = **in + } return } @@ -430,6 +435,22 @@ func (in *ManifestService) DeepCopy() *ManifestService { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManifestServiceCredentials) DeepCopyInto(out *ManifestServiceCredentials) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestServiceCredentials. +func (in *ManifestServiceCredentials) DeepCopy() *ManifestServiceCredentials { + if in == nil { + return nil + } + out := new(ManifestServiceCredentials) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManifestServiceExpose) DeepCopyInto(out *ManifestServiceExpose) { *out = *in