remove vault server tls
This commit is contained in:
parent
610071e0d5
commit
b308691b50
|
|
@ -75,7 +75,7 @@ func FromSecret(secret *corev1.Secret) (*AppConfig, error) {
|
||||||
return cfg.tidy(), nil
|
return cfg.tidy(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func FromString(v string) (*AppConfig, error) {
|
func FromJSONString(v string) (*AppConfig, error) {
|
||||||
var appConfig AppConfig
|
var appConfig AppConfig
|
||||||
if err := json.NewDecoder(bytes.NewBufferString(v)).Decode(&appConfig); err != nil {
|
if err := json.NewDecoder(bytes.NewBufferString(v)).Decode(&appConfig); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ func TestAppConfigFromString_valid(t *testing.T) {
|
||||||
bytes, err := json.Marshal(cfg)
|
bytes, err := json.Marshal(cfg)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
got, err := FromString(string(bytes))
|
got, err := FromJSONString(string(bytes))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
want := cfg.tidy()
|
want := cfg.tidy()
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,6 @@ type AutoscalingRunnerSetSpec struct {
|
||||||
// +optional
|
// +optional
|
||||||
GitHubServerTLS *TLSConfig `json:"githubServerTLS,omitempty"`
|
GitHubServerTLS *TLSConfig `json:"githubServerTLS,omitempty"`
|
||||||
|
|
||||||
// +optional
|
|
||||||
VaultServerTLS *TLSConfig `json:"vaultServerTLS,omitempty"`
|
|
||||||
|
|
||||||
// +optional
|
// +optional
|
||||||
VaultConfig *VaultConfig `json:"vaultConfig,omitempty"`
|
VaultConfig *VaultConfig `json:"vaultConfig,omitempty"`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,9 @@ type EphemeralRunnerSpec struct {
|
||||||
// +required
|
// +required
|
||||||
GitHubConfigSecret string `json:"githubConfigSecret,omitempty"`
|
GitHubConfigSecret string `json:"githubConfigSecret,omitempty"`
|
||||||
|
|
||||||
|
// +optional
|
||||||
|
GitHubServerTLS *TLSConfig `json:"githubServerTLS,omitempty"`
|
||||||
|
|
||||||
// +required
|
// +required
|
||||||
RunnerScaleSetId int `json:"runnerScaleSetId,omitempty"`
|
RunnerScaleSetId int `json:"runnerScaleSetId,omitempty"`
|
||||||
|
|
||||||
|
|
@ -111,9 +114,6 @@ type EphemeralRunnerSpec struct {
|
||||||
// +optional
|
// +optional
|
||||||
ProxySecretRef string `json:"proxySecretRef,omitempty"`
|
ProxySecretRef string `json:"proxySecretRef,omitempty"`
|
||||||
|
|
||||||
// +optional
|
|
||||||
GitHubServerTLS *TLSConfig `json:"githubServerTLS,omitempty"`
|
|
||||||
|
|
||||||
// +optional
|
// +optional
|
||||||
VaultConfig *VaultConfig `json:"vaultConfig,omitempty"`
|
VaultConfig *VaultConfig `json:"vaultConfig,omitempty"`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,11 +217,6 @@ func (in *AutoscalingRunnerSetSpec) DeepCopyInto(out *AutoscalingRunnerSetSpec)
|
||||||
*out = new(TLSConfig)
|
*out = new(TLSConfig)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.VaultServerTLS != nil {
|
|
||||||
in, out := &in.VaultServerTLS, &out.VaultServerTLS
|
|
||||||
*out = new(TLSConfig)
|
|
||||||
(*in).DeepCopyInto(*out)
|
|
||||||
}
|
|
||||||
if in.VaultConfig != nil {
|
if in.VaultConfig != nil {
|
||||||
in, out := &in.VaultConfig, &out.VaultConfig
|
in, out := &in.VaultConfig, &out.VaultConfig
|
||||||
*out = new(VaultConfig)
|
*out = new(VaultConfig)
|
||||||
|
|
@ -462,16 +457,16 @@ func (in *EphemeralRunnerSetStatus) DeepCopy() *EphemeralRunnerSetStatus {
|
||||||
// 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 *EphemeralRunnerSpec) DeepCopyInto(out *EphemeralRunnerSpec) {
|
func (in *EphemeralRunnerSpec) DeepCopyInto(out *EphemeralRunnerSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.Proxy != nil {
|
|
||||||
in, out := &in.Proxy, &out.Proxy
|
|
||||||
*out = new(ProxyConfig)
|
|
||||||
(*in).DeepCopyInto(*out)
|
|
||||||
}
|
|
||||||
if in.GitHubServerTLS != nil {
|
if in.GitHubServerTLS != nil {
|
||||||
in, out := &in.GitHubServerTLS, &out.GitHubServerTLS
|
in, out := &in.GitHubServerTLS, &out.GitHubServerTLS
|
||||||
*out = new(TLSConfig)
|
*out = new(TLSConfig)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
|
if in.Proxy != nil {
|
||||||
|
in, out := &in.Proxy, &out.Proxy
|
||||||
|
*out = new(ProxyConfig)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
if in.VaultConfig != nil {
|
if in.VaultConfig != nil {
|
||||||
in, out := &in.VaultConfig, &out.VaultConfig
|
in, out := &in.VaultConfig, &out.VaultConfig
|
||||||
*out = new(VaultConfig)
|
*out = new(VaultConfig)
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ func Read(ctx context.Context, configPath string) (*Config, error) {
|
||||||
return nil, fmt.Errorf("failed to get app config from vault: %w", err)
|
return nil, fmt.Errorf("failed to get app config from vault: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
appConfig, err := appconfig.FromString(appConfigRaw)
|
appConfig, err := appconfig.FromJSONString(appConfigRaw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read app config from string: %v", err)
|
return nil, fmt.Errorf("failed to read app config from string: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ func (r *vaultResolver) appConfig(ctx context.Context, key string) (*appconfig.A
|
||||||
return nil, fmt.Errorf("failed to resolve secret: %v", err)
|
return nil, fmt.Errorf("failed to resolve secret: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return appconfig.FromString(val)
|
return appconfig.FromJSONString(val)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *vaultResolver) proxyCredentials(ctx context.Context, key string) (*url.Userinfo, error) {
|
func (r *vaultResolver) proxyCredentials(ctx context.Context, key string) (*url.Userinfo, error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue