Skip to content

Commit

Permalink
Make RepositoryServer struct consistent with RepositoryServer CRD (#2122
Browse files Browse the repository at this point in the history
)

* Remove optional Markers, Add omitempty to fields in RepositoryServer struct as specified in repositoryserver.yaml

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

* Fix the indentation of repositoryserver CRD(repositoryserver.yaml)

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>

---------

Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
  • Loading branch information
akankshakumari393 committed Jun 20, 2023
1 parent c2dc9d9 commit ac3723d
Show file tree
Hide file tree
Showing 2 changed files with 295 additions and 305 deletions.
12 changes: 4 additions & 8 deletions pkg/apis/cr/v1alpha1/repositoryserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type RepositoryServer struct {
// It has all the details required to start the kopia repository server
Spec RepositoryServerSpec `json:"spec"`
// Status refers to the current status of the repository server.
Status RepositoryServerStatus `json:"status"`
Status RepositoryServerStatus `json:"status,omitempty"`
}

// RepositoryServerSpec is the specification for the RepositoryServer
Expand All @@ -55,7 +55,6 @@ type RepositoryServerSpec struct {
type Storage struct {
// SecretRef has the details of the object storage (location)
// where the kopia would backup the data
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
SecretRef corev1.SecretReference `json:"secretRef"`
// CredentialSecretRef stores the credentials required
Expand All @@ -69,17 +68,16 @@ type Repository struct {
// Path for the repository, it will be a relative sub path
// within the path prefix specified in the location
// More info: https://kopia.io/docs/reference/command-line/common/#commands-to-manipulate-repository
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
RootPath string `json:"rootPath"`
// If specified, these values will be used by the controller to
// override default username when connecting to the
// repository from the server.
Username string `json:"username"`
Username string `json:"username,omitempty"`
// If specified, these values will be used by the controller to
// override default hostname when connecting to the
// repository from the server.
Hostname string `json:"hostname"`
Hostname string `json:"hostname,omitempty"`
// PasswordSecretRef has the password required to connect to kopia repository
PasswordSecretRef corev1.SecretReference `json:"passwordSecretRef"`
CacheSizeSettings CacheSizeSettings `json:"cacheSizeSettings,omitempty"`
Expand All @@ -99,12 +97,10 @@ type Server struct {
UserAccess UserAccess `json:"userAccess"`
// AdminSecretRef has the username and password required to start the
// kopia repository server
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
AdminSecretRef corev1.SecretReference `json:"adminSecretRef"`
// TLSSecretRef has the certificates required for kopia repository
// client server connection
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
TLSSecretRef corev1.SecretReference `json:"tlsSecretRef"`
}
Expand All @@ -123,7 +119,7 @@ type UserAccess struct {
type RepositoryServerStatus struct {
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
ServerInfo ServerInfo `json:"serverInfo,omitempty"`
Progress RepositoryServerProgress `json:"progress"`
Progress RepositoryServerProgress `json:"progress,omitempty"`
}

// Condition contains details of the current state of the RepositoryServer resource
Expand Down
Loading

0 comments on commit ac3723d

Please sign in to comment.