Skip to content

Commit

Permalink
Skip chart generation for feature and featureset (#83)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha authored May 5, 2023
1 parent d91da22 commit 5bee95e
Show file tree
Hide file tree
Showing 151 changed files with 5,927 additions and 405 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ require (
k8s.io/kube-aggregator v0.25.1
k8s.io/kubectl v0.25.3
kmodules.xyz/client-go v0.25.22
kmodules.xyz/resource-metadata v0.17.1
kmodules.xyz/resource-metadata v0.17.2
kmodules.xyz/sets v0.25.0
kubepack.dev/chart-doc-gen v0.4.7
kubepack.dev/kubepack v0.6.5-0.20230430191512-e45228dff467
kubepack.dev/lib-helm v0.6.5-0.20230504235627-6f85f96818ac
kubepack.dev/kubepack v0.7.0
kubepack.dev/lib-helm v0.7.0
sigs.k8s.io/controller-runtime v0.13.1
sigs.k8s.io/yaml v1.3.0
x-helm.dev/apimachinery v0.0.9-0.20230504073133-059a2432d5a2
x-helm.dev/apimachinery v0.0.9
)

require (
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1727,16 +1727,16 @@ kmodules.xyz/apply v0.25.0 h1:4rB+473m1HrbIr0KrEbU69eA9nq2fDhuDmZwMbkjO2E=
kmodules.xyz/apply v0.25.0/go.mod h1:qxixMI6esjBWAEl4PRT8Ax+7o/nqw+m6v3vXoCCXjgk=
kmodules.xyz/client-go v0.25.22 h1:gtRyVl5Ar87zzKj4g7Nx+0QSeWq9yTKADoasZP+brZg=
kmodules.xyz/client-go v0.25.22/go.mod h1:KWVpgjAj/VNzCzj/BihpJkY39aWIqe8qMp5RuPsuSJA=
kmodules.xyz/resource-metadata v0.17.1 h1:klZ7a4DLHD3vEMsnuIB/xmFoZBzN4T9XID/XwiGUWtI=
kmodules.xyz/resource-metadata v0.17.1/go.mod h1:MP+u4U1VMdtn2j52SLMw0pqzBDOa+wxnGoYNLtsJzYM=
kmodules.xyz/resource-metadata v0.17.2 h1:J81LB78NswSi8F23RtxaKKDXyAML07Yupi3rs7+FAT0=
kmodules.xyz/resource-metadata v0.17.2/go.mod h1:w1Mdovr5Jo0Tuyum2yAH4UAvmsz7d7w30WC5ED4IKOE=
kmodules.xyz/sets v0.25.0 h1:belY/3trp/M/CKc1TEteA40jb2uCIdwKHhjpvrIxG+8=
kmodules.xyz/sets v0.25.0/go.mod h1:ICWmplgCsxniWkImSBGlJrLT9npqOXKhX/Bwbc7bmEw=
kubepack.dev/chart-doc-gen v0.4.7 h1:SN+p8dXKoOCrpJBfYXNlTJWmU+PtKPnvkZdDjlatMao=
kubepack.dev/chart-doc-gen v0.4.7/go.mod h1:cUKd7EHAQrxKj156uk+TVG31aEGn/oxYLzZolgxcv6U=
kubepack.dev/kubepack v0.6.5-0.20230430191512-e45228dff467 h1:L957qp2WEjGs4pkpooxcqDL5EsbSGclNeffkUUZZKOU=
kubepack.dev/kubepack v0.6.5-0.20230430191512-e45228dff467/go.mod h1:i8Sb93dEhJsK/qb54z6LtMv5dBJTwdEuYVPObbifDCo=
kubepack.dev/lib-helm v0.6.5-0.20230504235627-6f85f96818ac h1:+JdN3HiXFKz1aDwoSBd353Vuha/jZHwOhFibo07e+YQ=
kubepack.dev/lib-helm v0.6.5-0.20230504235627-6f85f96818ac/go.mod h1:h1RPsJf4fFRrsF2PwWcSBTfLYeUmLOZ+DO3tDY8yblM=
kubepack.dev/kubepack v0.7.0 h1:Cu3sx5OUTF33ZzTct+19F0+znY/X/miQTn8j/xkUspk=
kubepack.dev/kubepack v0.7.0/go.mod h1:R3R7MW3F7iFK+PYcAA3na8fS5DWpjHUcWrzx19PlbSQ=
kubepack.dev/lib-helm v0.7.0 h1:I+a9PjzRmJLfgX67Vsos+uyakIwDKrESzvQVtKTbdjY=
kubepack.dev/lib-helm v0.7.0/go.mod h1:WluKebF92iGj04lD6fkOD+d/HRaGU1rDJbwZDt5UBFA=
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
oras.land/oras-go v1.2.0 h1:yoKosVIbsPoFMqAIFHTnrmOuafHal+J/r+I5bdbVWu4=
oras.land/oras-go v1.2.0/go.mod h1:pFNs7oHp2dYsYMSS82HaX5l4mpnGO7hbpPN6EWH2ltc=
Expand All @@ -1760,5 +1760,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ih
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
x-helm.dev/apimachinery v0.0.9-0.20230504073133-059a2432d5a2 h1:RKqmG0TpQcCsJ2XEOJ8Be9b8UDWEVFlDS4EYxxCbOco=
x-helm.dev/apimachinery v0.0.9-0.20230504073133-059a2432d5a2/go.mod h1:4P/kgSsP5YNYfcsjxuruZArDE1bU/Yn86LbPFUv2mPA=
x-helm.dev/apimachinery v0.0.9 h1:rw6VFDIiNZ741qrRQvchdhPew5gG46OFWZBD7Co6+Bs=
x-helm.dev/apimachinery v0.0.9/go.mod h1:4P/kgSsP5YNYfcsjxuruZArDE1bU/Yn86LbPFUv2mPA=
5 changes: 5 additions & 0 deletions pkg/simple/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func NewCmdSimple() *cobra.Command {
}

registry.Visit(func(key string, rd *rsapi.ResourceDescriptor) {
if rd.Spec.Resource.Group == "ui.k8s.appscode.com" &&
(rd.Spec.Resource.Kind == "Feature" || rd.Spec.Resource.Kind == "FeatureSet") {
return
}

err := GenerateSimpleEditorChart(chartDir, descriptorDir, rd.Spec.Resource.GroupVersionResource(), registry, skipExisting)
if err != nil {
panic(err)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
apiVersion: meta.k8s.appscode.com/v1alpha1
kind: ResourceDescriptor
metadata:
creationTimestamp: null
labels:
k8s.io/group: charts.x-helm.dev
k8s.io/kind: ChartPreset
k8s.io/resource: chartpresets
k8s.io/version: v1alpha1
name: charts.x-helm.dev-v1alpha1-chartpresets
spec:
resource:
group: charts.x-helm.dev
kind: ChartPreset
name: chartpresets
scope: Namespaced
version: v1alpha1
validation:
openAPIV3Schema:
description: ChartPreset is the Schema for the chartpresets API
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:
properties:
name:
description: 'Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
namespace:
description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"
type: string
labels:
additionalProperties:
type: string
description: 'Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type: object
annotations:
additionalProperties:
type: string
description: 'Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type: object
type: object
spec:
description: ClusterChartPresetSpec defines the desired state of ClusterChartPreset
properties:
displayName:
type: string
usePresets:
items:
description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
selector:
description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies to.
type: string
operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
required:
- kind
type: object
x-kubernetes-map-type: atomic
type: array
values:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
type: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
apiVersion: meta.k8s.appscode.com/v1alpha1
kind: ResourceDescriptor
metadata:
creationTimestamp: null
labels:
k8s.io/group: charts.x-helm.dev
k8s.io/kind: ClusterChartPreset
k8s.io/resource: clusterchartpresets
k8s.io/version: v1alpha1
name: charts.x-helm.dev-v1alpha1-clusterchartpresets
spec:
resource:
group: charts.x-helm.dev
kind: ClusterChartPreset
name: clusterchartpresets
scope: Cluster
version: v1alpha1
validation:
openAPIV3Schema:
description: ClusterChartPreset is the Schema for the clusterchartpresets API
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:
properties:
name:
description: 'Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
labels:
additionalProperties:
type: string
description: 'Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type: object
annotations:
additionalProperties:
type: string
description: 'Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type: object
type: object
spec:
description: ClusterChartPresetSpec defines the desired state of ClusterChartPreset
properties:
displayName:
type: string
usePresets:
items:
description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
selector:
description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies to.
type: string
operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
required:
- kind
type: object
x-kubernetes-map-type: atomic
type: array
values:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
type: object
Loading

0 comments on commit 5bee95e

Please sign in to comment.