-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cluster issuer resource viewer (#82)
This change adds the Cluster Issuer resource viewer.
- Loading branch information
1 parent
bc4d327
commit 9a0627a
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...ceViewerDialog/components/FirstClassViewers/StructuredMetadata/resources/clusterIssuer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { ClusterIssuer } from '../../../../../../types/ClusterIssuer'; | ||
import { KubernetesResource } from '../../../../../../types/KubernetesResource'; | ||
import { Metadata } from '../StructuredMetadata'; | ||
|
||
export const getClusterIssuerStructuredMetadata = ( | ||
resource: KubernetesResource, | ||
): Metadata => { | ||
const clusterIssuer = resource as ClusterIssuer; | ||
|
||
return { | ||
server: clusterIssuer.spec.acme.server, | ||
email: clusterIssuer.spec.acme.email, | ||
privateKeySecretName: clusterIssuer.spec.acme.privateKeySecretRef?.name, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { KubernetesKeyValueObject } from './KubernetesResource'; | ||
|
||
export type ClusterIssuer = { | ||
kind: string; | ||
apiVersion: string; | ||
metadata: ClusterIssuerMetadata; | ||
spec: ClusterIssuerSpec; | ||
}; | ||
|
||
export type ClusterIssuerMetadata = { | ||
name: string; | ||
namespace?: string; | ||
labels?: KubernetesKeyValueObject; | ||
annotations?: KubernetesKeyValueObject; | ||
}; | ||
|
||
export type ClusterIssuerSpec = { | ||
acme: ACMEIssuer; | ||
}; | ||
|
||
export type ACMEIssuer = { | ||
server: string; | ||
email?: string; | ||
privateKeySecretRef?: ACMEIssuerPrivateKeySecretRef; | ||
}; | ||
|
||
export type ACMEIssuerPrivateKeySecretRef = { | ||
name: string; | ||
}; |