Skip to content

Commit

Permalink
Add PlatformCredentialsSet client
Browse files Browse the repository at this point in the history
Preparing for the implementation of the PlatformCredentialsSet per Stack feature,
this commit adds PlatformCredentialsSet to the zalando.org/v1 api.

Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
  • Loading branch information
katyanna committed Feb 8, 2024
1 parent 2104a96 commit ffebd18
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 0 deletions.
102 changes: 102 additions & 0 deletions docs/zalando.org_platformcredentialssets.yaml
Original file line number Diff line number Diff line change
@@ -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
60 changes: 60 additions & 0 deletions pkg/apis/zalando.org/v1/types_pcs.go
Original file line number Diff line number Diff line change
@@ -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.

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

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

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

2 changes: 2 additions & 0 deletions pkg/client/informers/externalversions/generic.go

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

0 comments on commit ffebd18

Please sign in to comment.