Skip to content

Commit c85ca53

Browse files
authored
Update DockerRegistry CR types (#2169)
1 parent 461b3ee commit c85ca53

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

internal/registry/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func getConfig(ctx context.Context, client kube.Client) (*RegistryConfig, error)
4040
return nil, err
4141
}
4242

43-
secretConfig, err := getRegistrySecretData(ctx, client.Static(), dockerRegistry.Status.SecretName, dockerRegistry.GetNamespace())
43+
secretConfig, err := getRegistrySecretData(ctx, client.Static(), dockerRegistry.Status.InternalAccess.SecretName, dockerRegistry.GetNamespace())
4444
if err != nil {
4545
return nil, err
4646
}
@@ -51,7 +51,7 @@ func getConfig(ctx context.Context, client kube.Client) (*RegistryConfig, error)
5151
}
5252

5353
return &RegistryConfig{
54-
SecretName: dockerRegistry.Status.SecretName,
54+
SecretName: dockerRegistry.Status.InternalAccess.SecretName,
5555
SecretData: secretConfig,
5656
PodMeta: podMeta,
5757
}, nil

internal/registry/config_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ func fixTestDockerRegistry() *unstructured.Unstructured {
197197
"namespace": "test-namespace",
198198
},
199199
"status": map[string]interface{}{
200-
"secretName": "test-secret",
201-
"state": "Ready",
200+
"internalAccess": map[string]interface{}{
201+
"secretName": "test-secret",
202+
},
203+
"state": "Ready",
202204
},
203205
},
204206
}

internal/registry/types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ type DockerRegistry struct {
1919
Status DockerRegistryStatus `json:"status,omitempty"`
2020
}
2121

22-
type DockerRegistryStatus struct {
23-
State string `json:"state,omitempty"`
24-
Served string `json:"served"`
22+
type InternalAccess struct {
2523
SecretName string `json:"secretName,omitempty"`
2624
}
25+
26+
type DockerRegistryStatus struct {
27+
State string `json:"state,omitempty"`
28+
Served string `json:"served"`
29+
InternalAccess InternalAccess `json:"internalAccess"`
30+
}

0 commit comments

Comments
 (0)