Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DockerRegistry CR types #2169

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/registry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func getConfig(ctx context.Context, client kube.Client) (*RegistryConfig, error)
return nil, err
}

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

return &RegistryConfig{
SecretName: dockerRegistry.Status.SecretName,
SecretName: dockerRegistry.Status.InternalAccess.SecretName,
SecretData: secretConfig,
PodMeta: podMeta,
}, nil
Expand Down
6 changes: 4 additions & 2 deletions internal/registry/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ func fixTestDockerRegistry() *unstructured.Unstructured {
"namespace": "test-namespace",
},
"status": map[string]interface{}{
"secretName": "test-secret",
"state": "Ready",
"internalAccess": map[string]interface{}{
"secretName": "test-secret",
},
"state": "Ready",
},
},
}
Expand Down
10 changes: 7 additions & 3 deletions internal/registry/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ type DockerRegistry struct {
Status DockerRegistryStatus `json:"status,omitempty"`
}

type DockerRegistryStatus struct {
State string `json:"state,omitempty"`
Served string `json:"served"`
type InternalAccess struct {
SecretName string `json:"secretName,omitempty"`
}

type DockerRegistryStatus struct {
State string `json:"state,omitempty"`
Served string `json:"served"`
InternalAccess InternalAccess `json:"internalAccess"`
}