forked from VirtusLab/jenkins-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add backup validation in base configuration phase - add backup validation in user configuration phase - add tests
- Loading branch information
Showing
9 changed files
with
457 additions
and
49 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
pkg/controller/jenkins/configuration/base/resources/backup_secret.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package resources | ||
|
||
import ( | ||
"fmt" | ||
|
||
virtuslabv1alpha1 "github.com/VirtusLab/jenkins-operator/pkg/apis/virtuslab/v1alpha1" | ||
"github.com/VirtusLab/jenkins-operator/pkg/controller/jenkins/constants" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// GetBackupCredentialsSecretName returns name of Kubernetes secret used to store backup credentials | ||
func GetBackupCredentialsSecretName(jenkins *virtuslabv1alpha1.Jenkins) string { | ||
return fmt.Sprintf("%s-backup-credentials-%s", constants.OperatorName, jenkins.Name) | ||
} | ||
|
||
// NewBackupCredentialsSecret builds the Kubernetes secret used to store backup credentials | ||
func NewBackupCredentialsSecret(meta metav1.ObjectMeta, jenkins *virtuslabv1alpha1.Jenkins) *corev1.Secret { | ||
meta.Name = GetBackupCredentialsSecretName(jenkins) | ||
return &corev1.Secret{ | ||
TypeMeta: buildSecretTypeMeta(), | ||
ObjectMeta: meta, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.