Renam Url to URL

This commit is contained in:
Nikola Jokic
2026-06-15 10:41:30 +02:00
parent 0e921def3b
commit 6089fcbb3f
11 changed files with 37 additions and 25 deletions
@@ -179,9 +179,9 @@ func (c *ProxyConfig) ToHTTPProxyConfig(secretFetcher func(string) (*corev1.Secr
}
if c.HTTP != nil {
u, err := url.Parse(c.HTTP.Url)
u, err := url.Parse(c.HTTP.URL)
if err != nil {
return nil, fmt.Errorf("failed to parse proxy http url %q: %w", c.HTTP.Url, err)
return nil, fmt.Errorf("failed to parse proxy http url %q: %w", c.HTTP.URL, err)
}
if c.HTTP.CredentialSecretRef != "" {
@@ -204,9 +204,9 @@ func (c *ProxyConfig) ToHTTPProxyConfig(secretFetcher func(string) (*corev1.Secr
}
if c.HTTPS != nil {
u, err := url.Parse(c.HTTPS.Url)
u, err := url.Parse(c.HTTPS.URL)
if err != nil {
return nil, fmt.Errorf("failed to parse proxy https url %q: %w", c.HTTPS.Url, err)
return nil, fmt.Errorf("failed to parse proxy https url %q: %w", c.HTTPS.URL, err)
}
if c.HTTPS.CredentialSecretRef != "" {
@@ -260,7 +260,7 @@ func (c *ProxyConfig) ProxyFunc(secretFetcher func(string) (*corev1.Secret, erro
type ProxyServerConfig struct {
// Required
Url string `json:"url,omitempty"`
URL string `json:"url,omitempty"`
// +optional
CredentialSecretRef string `json:"credentialSecretRef,omitempty"`
@@ -324,10 +324,13 @@ type AutoscalingRunnerSetStatus struct {
// EphemeralRunner counts separated by the stage ephemeral runners are in, taken from the EphemeralRunnerSet
// +optional
// +kubebuilder:validation:Minimum=0
PendingEphemeralRunners int `json:"pendingEphemeralRunners"`
// +optional
// +kubebuilder:validation:Minimum=0
RunningEphemeralRunners int `json:"runningEphemeralRunners"`
// +optional
// +kubebuilder:validation:Minimum=0
FailedEphemeralRunners int `json:"failedEphemeralRunners"`
}
@@ -14,11 +14,11 @@ import (
func TestProxyConfig_ToSecret(t *testing.T) {
config := &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://proxy.example.com:8080",
URL: "http://proxy.example.com:8080",
CredentialSecretRef: "my-secret",
},
HTTPS: &v1alpha1.ProxyServerConfig{
Url: "https://proxy.example.com:8080",
URL: "https://proxy.example.com:8080",
CredentialSecretRef: "my-secret",
},
NoProxy: []string{
@@ -48,11 +48,11 @@ func TestProxyConfig_ToSecret(t *testing.T) {
func TestProxyConfig_ProxyFunc(t *testing.T) {
config := &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://proxy.example.com:8080",
URL: "http://proxy.example.com:8080",
CredentialSecretRef: "my-secret",
},
HTTPS: &v1alpha1.ProxyServerConfig{
Url: "https://proxy.example.com:8080",
URL: "https://proxy.example.com:8080",
CredentialSecretRef: "my-secret",
},
NoProxy: []string{
@@ -16547,12 +16547,15 @@ spec:
minimum: 0
type: integer
failedEphemeralRunners:
minimum: 0
type: integer
pendingEphemeralRunners:
minimum: 0
type: integer
phase:
type: string
runningEphemeralRunners:
minimum: 0
type: integer
type: object
type: object
@@ -16547,12 +16547,15 @@ spec:
minimum: 0
type: integer
failedEphemeralRunners:
minimum: 0
type: integer
pendingEphemeralRunners:
minimum: 0
type: integer
phase:
type: string
runningEphemeralRunners:
minimum: 0
type: integer
type: object
type: object
@@ -1364,11 +1364,11 @@ func TestTemplateRenderedWithProxy(t *testing.T) {
require.NotNil(t, ars.Spec.Proxy)
require.NotNil(t, ars.Spec.Proxy.HTTP)
assert.Equal(t, "http://proxy.example.com", ars.Spec.Proxy.HTTP.Url)
assert.Equal(t, "http://proxy.example.com", ars.Spec.Proxy.HTTP.URL)
assert.Equal(t, "http-secret", ars.Spec.Proxy.HTTP.CredentialSecretRef)
require.NotNil(t, ars.Spec.Proxy.HTTPS)
assert.Equal(t, "https://proxy.example.com", ars.Spec.Proxy.HTTPS.Url)
assert.Equal(t, "https://proxy.example.com", ars.Spec.Proxy.HTTPS.URL)
assert.Equal(t, "https-secret", ars.Spec.Proxy.HTTPS.CredentialSecretRef)
require.NotNil(t, ars.Spec.Proxy.NoProxy)
@@ -16547,12 +16547,15 @@ spec:
minimum: 0
type: integer
failedEphemeralRunners:
minimum: 0
type: integer
pendingEphemeralRunners:
minimum: 0
type: integer
phase:
type: string
runningEphemeralRunners:
minimum: 0
type: integer
type: object
type: object
@@ -954,11 +954,11 @@ var _ = Describe("Test AutoScalingListener controller with proxy", func() {
proxy := &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://localhost:8080",
URL: "http://localhost:8080",
CredentialSecretRef: "proxy-credentials",
},
HTTPS: &v1alpha1.ProxyServerConfig{
Url: "https://localhost:8443",
URL: "https://localhost:8443",
CredentialSecretRef: "proxy-credentials",
},
NoProxy: []string{
@@ -1353,7 +1353,7 @@ var _ = Describe("Test client optional configuration", Ordered, func() {
RunnerGroup: "testgroup",
Proxy: &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: proxy.URL,
URL: proxy.URL,
},
},
Template: corev1.PodTemplateSpec{
@@ -1431,7 +1431,7 @@ var _ = Describe("Test client optional configuration", Ordered, func() {
RunnerGroup: "testgroup",
Proxy: &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://test:password@" + proxy.Listener.Addr().String(),
URL: "http://test:password@" + proxy.Listener.Addr().String(),
CredentialSecretRef: "proxy-credentials",
},
},
@@ -1367,7 +1367,7 @@ var _ = Describe("EphemeralRunner", func() {
ephemeralRunner.Spec.GitHubConfigURL = "http://example.com/org/repo"
ephemeralRunner.Spec.Proxy = &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: proxy.URL,
URL: proxy.URL,
CredentialSecretRef: "proxy-credentials",
},
}
@@ -1388,10 +1388,10 @@ var _ = Describe("EphemeralRunner", func() {
ephemeralRunner := newExampleRunner("test-runner", autoScalingNS.Name, configSecret.Name)
ephemeralRunner.Spec.Proxy = &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://proxy.example.com:8080",
URL: "http://proxy.example.com:8080",
},
HTTPS: &v1alpha1.ProxyServerConfig{
Url: "http://proxy.example.com:8080",
URL: "http://proxy.example.com:8080",
},
NoProxy: []string{"example.com"},
}
@@ -1327,11 +1327,11 @@ var _ = Describe("Test EphemeralRunnerSet controller with proxy settings", func(
RunnerScaleSetID: 100,
Proxy: &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: "http://proxy.example.com",
URL: "http://proxy.example.com",
CredentialSecretRef: secretCredentials.Name,
},
HTTPS: &v1alpha1.ProxyServerConfig{
Url: "https://proxy.example.com",
URL: "https://proxy.example.com",
CredentialSecretRef: secretCredentials.Name,
},
NoProxy: []string{"example.com", "example.org"},
@@ -1510,7 +1510,7 @@ var _ = Describe("Test EphemeralRunnerSet controller with proxy settings", func(
RunnerScaleSetID: 100,
Proxy: &v1alpha1.ProxyConfig{
HTTP: &v1alpha1.ProxyServerConfig{
Url: proxy.URL,
URL: proxy.URL,
CredentialSecretRef: "proxy-credentials",
},
},
@@ -85,9 +85,9 @@ func (sr *SecretResolver) GetActionsService(ctx context.Context, obj object.Acti
}
if proxy.HTTP != nil {
u, err := url.Parse(proxy.HTTP.Url)
u, err := url.Parse(proxy.HTTP.URL)
if err != nil {
return nil, fmt.Errorf("failed to parse proxy http url %q: %w", proxy.HTTP.Url, err)
return nil, fmt.Errorf("failed to parse proxy http url %q: %w", proxy.HTTP.URL, err)
}
if ref := proxy.HTTP.CredentialSecretRef; ref != "" {
@@ -101,9 +101,9 @@ func (sr *SecretResolver) GetActionsService(ctx context.Context, obj object.Acti
}
if proxy.HTTPS != nil {
u, err := url.Parse(proxy.HTTPS.Url)
u, err := url.Parse(proxy.HTTPS.URL)
if err != nil {
return nil, fmt.Errorf("failed to parse proxy https url %q: %w", proxy.HTTPS.Url, err)
return nil, fmt.Errorf("failed to parse proxy https url %q: %w", proxy.HTTPS.URL, err)
}
if ref := proxy.HTTPS.CredentialSecretRef; ref != "" {