Provisioning: Add pure git repository type (#106815)
* Add repository type git to spec * Register git type * Update test checks
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// GitRepositoryConfigApplyConfiguration represents a declarative configuration of the GitRepositoryConfig type for use
|
||||
// with apply.
|
||||
type GitRepositoryConfigApplyConfiguration struct {
|
||||
URL *string `json:"url,omitempty"`
|
||||
Branch *string `json:"branch,omitempty"`
|
||||
Token *string `json:"token,omitempty"`
|
||||
EncryptedToken []byte `json:"encryptedToken,omitempty"`
|
||||
Path *string `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
// GitRepositoryConfigApplyConfiguration constructs a declarative configuration of the GitRepositoryConfig type for use with
|
||||
// apply.
|
||||
func GitRepositoryConfig() *GitRepositoryConfigApplyConfiguration {
|
||||
return &GitRepositoryConfigApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithURL sets the URL field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the URL field is set to the value of the last call.
|
||||
func (b *GitRepositoryConfigApplyConfiguration) WithURL(value string) *GitRepositoryConfigApplyConfiguration {
|
||||
b.URL = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBranch sets the Branch field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Branch field is set to the value of the last call.
|
||||
func (b *GitRepositoryConfigApplyConfiguration) WithBranch(value string) *GitRepositoryConfigApplyConfiguration {
|
||||
b.Branch = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithToken sets the Token field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Token field is set to the value of the last call.
|
||||
func (b *GitRepositoryConfigApplyConfiguration) WithToken(value string) *GitRepositoryConfigApplyConfiguration {
|
||||
b.Token = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithEncryptedToken adds the given value to the EncryptedToken field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the EncryptedToken field.
|
||||
func (b *GitRepositoryConfigApplyConfiguration) WithEncryptedToken(values ...byte) *GitRepositoryConfigApplyConfiguration {
|
||||
for i := range values {
|
||||
b.EncryptedToken = append(b.EncryptedToken, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPath sets the Path field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Path field is set to the value of the last call.
|
||||
func (b *GitRepositoryConfigApplyConfiguration) WithPath(value string) *GitRepositoryConfigApplyConfiguration {
|
||||
b.Path = &value
|
||||
return b
|
||||
}
|
||||
@@ -18,6 +18,7 @@ type RepositorySpecApplyConfiguration struct {
|
||||
Type *provisioningv0alpha1.RepositoryType `json:"type,omitempty"`
|
||||
Local *LocalRepositoryConfigApplyConfiguration `json:"local,omitempty"`
|
||||
GitHub *GitHubRepositoryConfigApplyConfiguration `json:"github,omitempty"`
|
||||
Git *GitRepositoryConfigApplyConfiguration `json:"git,omitempty"`
|
||||
}
|
||||
|
||||
// RepositorySpecApplyConfiguration constructs a declarative configuration of the RepositorySpec type for use with
|
||||
@@ -83,3 +84,11 @@ func (b *RepositorySpecApplyConfiguration) WithGitHub(value *GitHubRepositoryCon
|
||||
b.GitHub = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGit sets the Git field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Git field is set to the value of the last call.
|
||||
func (b *RepositorySpecApplyConfiguration) WithGit(value *GitRepositoryConfigApplyConfiguration) *RepositorySpecApplyConfiguration {
|
||||
b.Git = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
// Group=provisioning.grafana.app, Version=v0alpha1
|
||||
case v0alpha1.SchemeGroupVersion.WithKind("GitHubRepositoryConfig"):
|
||||
return &provisioningv0alpha1.GitHubRepositoryConfigApplyConfiguration{}
|
||||
case v0alpha1.SchemeGroupVersion.WithKind("GitRepositoryConfig"):
|
||||
return &provisioningv0alpha1.GitRepositoryConfigApplyConfiguration{}
|
||||
case v0alpha1.SchemeGroupVersion.WithKind("HealthStatus"):
|
||||
return &provisioningv0alpha1.HealthStatusApplyConfiguration{}
|
||||
case v0alpha1.SchemeGroupVersion.WithKind("LocalRepositoryConfig"):
|
||||
|
||||
Reference in New Issue
Block a user