Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pkg/apis): registry credentials in manifest #235

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/apis/akash.network/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 24 additions & 6 deletions pkg/apis/akash.network/v2beta2/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"`
}

Expand Down Expand Up @@ -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
}

Expand Down
Loading