From 3383def19a9e3c19bdc02315d7501fc00861b8e8 Mon Sep 17 00:00:00 2001 From: Adam Bozanich Date: Mon, 29 Apr 2024 15:28:43 -0700 Subject: [PATCH 1/2] feat(pkg/apis): registry credentials in manifest (#235) Signed-off-by: Adam Bozanich --- pkg/apis/akash.network/crd.yaml | 14 ++++++++++ pkg/apis/akash.network/v2beta2/manifest.go | 30 +++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) 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 } From cf1e3bd80242e99fbf1b1fa030364f5d29a17e83 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Tue, 30 Apr 2024 12:00:58 -0400 Subject: [PATCH 2/2] fix(k8s/codegen): codegen for manifest credentials (#236) Signed-off-by: Artur Troian --- .../v2beta2/zz_generated.deepcopy.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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