Skip to content

Commit

Permalink
Add PlatformCredentialsSet API client (#580)
Browse files Browse the repository at this point in the history
Preparing for the implementation of the **PlatformCredentialsSet per Stack** feature,
this Pull Request adds `PlatformCredentialsSet` to the zalando.org/v1 api.

Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Co-authored-by: Mikkel Oscar Lyderik Larsen <mikkeloscar@users.noreply.github.com>
  • Loading branch information
katyanna and mikkeloscar committed Feb 9, 2024
1 parent 2104a96 commit cc42b67
Show file tree
Hide file tree
Showing 16 changed files with 1,072 additions and 146 deletions.
131 changes: 93 additions & 38 deletions docs/stack_crd.yaml

Large diffs are not rendered by default.

201 changes: 93 additions & 108 deletions docs/stackset_crd.yaml

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions docs/zalando.org_platformcredentialssets.yaml
@@ -0,0 +1,102 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: platformcredentialssets.zalando.org
spec:
group: zalando.org
names:
kind: PlatformCredentialsSet
listKind: PlatformCredentialsSetList
plural: platformcredentialssets
singular: platformcredentialsset
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: PlatformCredentialsSet describes a platform credentials set
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: PlatformCredentialsSpec is the spec part of the StackSet.
properties:
application:
type: string
clients:
additionalProperties:
properties:
grant:
type: string
realm:
type: string
redirectUri:
type: string
required:
- grant
- realm
- redirectUri
type: object
type: object
token_version:
type: string
tokens:
additionalProperties:
properties:
privileges:
items:
type: string
type: array
required:
- privileges
type: object
type: object
required:
- application
- clients
- token_version
- tokens
type: object
status:
description: PlatformCredentialsStatus is the status part of the Stack.
properties:
clients: {}
errors:
items:
type: string
type: array
observedGeneration:
format: int64
type: integer
problems:
items:
type: string
type: array
tokens: {}
required:
- clients
- errors
- observedGeneration
- problems
- tokens
type: object
required:
- spec
- status
type: object
served: true
storage: true
2 changes: 2 additions & 0 deletions pkg/apis/zalando.org/v1/register.go
Expand Up @@ -33,6 +33,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&StackSetList{},
&Stack{},
&StackList{},
&PlatformCredentialsSet{},
&PlatformCredentialsSetList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
Expand Down
60 changes: 60 additions & 0 deletions pkg/apis/zalando.org/v1/types_pcs.go
@@ -0,0 +1,60 @@
package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PlatformCredentialsSet describes a platform credentials set
// +k8s:deepcopy-gen=true
type PlatformCredentialsSet struct {
metav1.TypeMeta `json:""`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec PlatformCredentialsSpec `json:"spec"`
Status PlatformCredentialsStatus `json:"status"`
}

// PlatformCredentialsSpec is the spec part of the StackSet.
// +k8s:deepcopy-gen=true
type PlatformCredentialsSpec struct {
Application string `json:"application"`
Clients map[string]Client `json:"clients"`
Tokens map[string]Token `json:"tokens"`
TokenVersion string `json:"token_version"`
}

// +k8s:deepcopy-gen=true
type Client struct {
Realm string `json:"realm"`
Grant string `json:"grant"`
RedirectURI string `json:"redirectUri"`
}

// +k8s:deepcopy-gen=true
type Token struct {
Privileges []string `json:"privileges"`
}

// PlatformCredentialsStatus is the status part of the Stack.
// +k8s:deepcopy-gen=true
type PlatformCredentialsStatus struct {
ObservedGeneration int64 `json:"observedGeneration"`
Errors []string `json:"errors"`
Problems []string `json:"problems"`
Tokens map[string]struct{} `json:"tokens"`
Clients map[string]struct{} `json:"clients"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PlatformCredentialsSetList is a list of StackSets.
// +k8s:deepcopy-gen=true
type PlatformCredentialsSetList struct {
metav1.TypeMeta `json:""`
metav1.ListMeta `json:"metadata,omitempty"`

Items []PlatformCredentialsSet `json:"items"`
}
168 changes: 168 additions & 0 deletions pkg/apis/zalando.org/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc42b67

Please sign in to comment.