-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task: adding another api
ArgoRolloutConfigKeeperClusterScope
for ma…
…naging configs in cluster scope.
- Loading branch information
1 parent
048c715
commit e76297d
Showing
21 changed files
with
1,161 additions
and
319 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
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,83 @@ | ||
/* | ||
Copyright 2024. | ||
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. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"encoding/json" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ArgoRolloutConfigKeeperClusterScopeSpec defines the desired state of ArgoRolloutConfigKeeperClusterScope | ||
type ArgoRolloutConfigKeeperClusterScopeSpec struct { | ||
FinalizerName string `json:"finalizerName"` | ||
AppLabel string `json:"appLabel,omitempty"` | ||
AppVersionLabel string `json:"appVersionLabel,omitempty"` | ||
ConfigLabelSelector map[string]string `json:"configLabelSelector,omitempty"` | ||
IgnoredNamespaces []string `json:"ignoredNamespaces,omitempty"` | ||
} | ||
|
||
func (in *ArgoRolloutConfigKeeperClusterScopeSpec) UnmarshalJSON(b []byte) error { | ||
type alias ArgoRolloutConfigKeeperClusterScopeSpec | ||
tmp := struct { | ||
*alias | ||
}{ | ||
alias: (*alias)(in), | ||
} | ||
if err := json.Unmarshal(b, &tmp); err != nil { | ||
return err | ||
} | ||
if tmp.alias.AppVersionLabel == "" { | ||
tmp.alias.AppVersionLabel = "app.kubernetes.io/version" | ||
} | ||
if tmp.alias.AppLabel == "" { | ||
tmp.alias.AppLabel = "app.kubernetes.io/name" | ||
} | ||
return nil | ||
} | ||
|
||
// ArgoRolloutConfigKeeperClusterScopeStatus defines the observed state of ArgoRolloutConfigKeeperClusterScope | ||
type ArgoRolloutConfigKeeperClusterScopeStatus struct { | ||
State string `json:"state"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
//+kubebuilder:printcolumn:name="FinalizerName",type="string",JSONPath=".spec.finalizerName",description="The name of managed Finalizer" | ||
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath="..metadata.creationTimestamp",description="Aqua Database Age" | ||
|
||
// ArgoRolloutConfigKeeperClusterScope is the Schema for the argorolloutconfigkeeperclusterscopes API | ||
type ArgoRolloutConfigKeeperClusterScope struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ArgoRolloutConfigKeeperClusterScopeSpec `json:"spec,omitempty"` | ||
Status ArgoRolloutConfigKeeperClusterScopeStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// ArgoRolloutConfigKeeperClusterScopeList contains a list of ArgoRolloutConfigKeeperClusterScope | ||
type ArgoRolloutConfigKeeperClusterScopeList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ArgoRolloutConfigKeeperClusterScope `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ArgoRolloutConfigKeeperClusterScope{}, &ArgoRolloutConfigKeeperClusterScopeList{}) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
83 changes: 83 additions & 0 deletions
83
config/crd/bases/configkeeper.run.ai_argorolloutconfigkeeperclusterscopes.yaml
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,83 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.15.0 | ||
name: argorolloutconfigkeeperclusterscopes.configkeeper.run.ai | ||
spec: | ||
group: configkeeper.run.ai | ||
names: | ||
kind: ArgoRolloutConfigKeeperClusterScope | ||
listKind: ArgoRolloutConfigKeeperClusterScopeList | ||
plural: argorolloutconfigkeeperclusterscopes | ||
singular: argorolloutconfigkeeperclusterscope | ||
scope: Cluster | ||
versions: | ||
- additionalPrinterColumns: | ||
- description: The name of managed Finalizer | ||
jsonPath: .spec.finalizerName | ||
name: FinalizerName | ||
type: string | ||
- description: Aqua Database Age | ||
jsonPath: ..metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: ArgoRolloutConfigKeeperClusterScope is the Schema for the argorolloutconfigkeeperclusterscopes | ||
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: | ||
type: object | ||
spec: | ||
description: ArgoRolloutConfigKeeperClusterScopeSpec defines the desired | ||
state of ArgoRolloutConfigKeeperClusterScope | ||
properties: | ||
appLabel: | ||
type: string | ||
appVersionLabel: | ||
type: string | ||
configLabelSelector: | ||
additionalProperties: | ||
type: string | ||
type: object | ||
finalizerName: | ||
type: string | ||
ignoredNamespaces: | ||
items: | ||
type: string | ||
type: array | ||
required: | ||
- finalizerName | ||
type: object | ||
status: | ||
description: ArgoRolloutConfigKeeperClusterScopeStatus defines the observed | ||
state of ArgoRolloutConfigKeeperClusterScope | ||
properties: | ||
state: | ||
type: string | ||
required: | ||
- state | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
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
config/rbac/argorolloutconfigkeeperclusterscope_editor_role.yaml
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 @@ | ||
# permissions for end users to edit argorolloutconfigkeeperclusterscopes. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: clusterrole | ||
app.kubernetes.io/instance: argorolloutconfigkeeperclusterscope-editor-role | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: argo-rollout-config-keeper | ||
app.kubernetes.io/part-of: argo-rollout-config-keeper | ||
app.kubernetes.io/managed-by: kustomize | ||
name: argorolloutconfigkeeperclusterscope-editor-role | ||
rules: | ||
- apiGroups: | ||
- configkeeper.run.ai | ||
resources: | ||
- argorolloutconfigkeeperclusterscopes | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- configkeeper.run.ai | ||
resources: | ||
- argorolloutconfigkeeperclusterscopes/status | ||
verbs: | ||
- get |
Oops, something went wrong.