[WIP] AWS S3 backup
- add backup type to API - add AWS S3 backup configuration to API
This commit is contained in:
parent
ca2817ad1d
commit
e507d23b0e
|
|
@ -12,10 +12,32 @@ import (
|
||||||
type JenkinsSpec struct {
|
type JenkinsSpec struct {
|
||||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||||
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
|
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
|
||||||
|
Backup JenkinsBackup `json:"backup,omitempty"`
|
||||||
|
BackupAmazonS3 JenkinsBackupAmazonS3 `json:"backupAmazonS3,omitempty"`
|
||||||
Master JenkinsMaster `json:"master,omitempty"`
|
Master JenkinsMaster `json:"master,omitempty"`
|
||||||
SeedJobs []SeedJob `json:"seedJobs,omitempty"`
|
SeedJobs []SeedJob `json:"seedJobs,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JenkinsBackup defines type of Jenkins backup
|
||||||
|
type JenkinsBackup string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// JenkinsBackupTypeNoBackup tells that Jenkins won't backup jobs
|
||||||
|
JenkinsBackupTypeNoBackup = "NoBackup"
|
||||||
|
// JenkinsBackupTypeAmazonS3 tells that Jenkins will backup jobs into AWS S3 bucket
|
||||||
|
JenkinsBackupTypeAmazonS3 = "AmazonS3"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AllowedJenkinsBackups consists allowed Jenkins backup types
|
||||||
|
var AllowedJenkinsBackups = []JenkinsBackup{JenkinsBackupTypeNoBackup, JenkinsBackupTypeAmazonS3}
|
||||||
|
|
||||||
|
// JenkinsBackupAmazonS3 defines backup configuration to AWS S3 bucket
|
||||||
|
type JenkinsBackupAmazonS3 struct {
|
||||||
|
BucketName string `json:"bucketName,omitempty"`
|
||||||
|
BucketPath string `json:"bucketPath,omitempty"`
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// JenkinsMaster defines the Jenkins master pod attributes and plugins,
|
// JenkinsMaster defines the Jenkins master pod attributes and plugins,
|
||||||
// every single change requires Jenkins master pod restart
|
// every single change requires Jenkins master pod restart
|
||||||
type JenkinsMaster struct {
|
type JenkinsMaster struct {
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,22 @@ func (in *Jenkins) DeepCopyObject() runtime.Object {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *JenkinsBackupAmazonS3) DeepCopyInto(out *JenkinsBackupAmazonS3) {
|
||||||
|
*out = *in
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsBackupAmazonS3.
|
||||||
|
func (in *JenkinsBackupAmazonS3) DeepCopy() *JenkinsBackupAmazonS3 {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(JenkinsBackupAmazonS3)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *JenkinsList) DeepCopyInto(out *JenkinsList) {
|
func (in *JenkinsList) DeepCopyInto(out *JenkinsList) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|
@ -152,6 +168,7 @@ func (in *JenkinsMaster) DeepCopy() *JenkinsMaster {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec) {
|
func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
out.BackupAmazonS3 = in.BackupAmazonS3
|
||||||
in.Master.DeepCopyInto(&out.Master)
|
in.Master.DeepCopyInto(&out.Master)
|
||||||
if in.SeedJobs != nil {
|
if in.SeedJobs != nil {
|
||||||
in, out := &in.SeedJobs, &out.SeedJobs
|
in, out := &in.SeedJobs, &out.SeedJobs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue