Skip to content

Commit

Permalink
Introduce Kustomize API group
Browse files Browse the repository at this point in the history
To be used by the kustomize-controller and helm-controller for various
patching functionalities.

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Feb 3, 2021
1 parent 736039c commit 62a4aa3
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apis/kustomize/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2021 The Flux authors
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 kustomize contains a selective set of Kustomize APIs for use by
// toolkit components.
package kustomize
3 changes: 3 additions & 0 deletions apis/kustomize/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/fluxcd/pkg/apis/kustomize

go 1.15
75 changes: 75 additions & 0 deletions apis/kustomize/kustomize_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
Copyright 2021 The Flux authors
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 kustomize

// Image contains an image name, a new name, a new tag or digest,
// which will replace the original name and tag.
type Image struct {
// Name is a tag-less image name.
// +required
Name string `json:"name"`

// NewName is the value used to replace the original name.
// +optional
NewName string `json:"newName,omitempty"`

// NewTag is the value used to replace the original tag.
// +optional
NewTag string `json:"newTag,omitempty"`

// Digest is the value used to replace the original image tag.
// If digest is present NewTag value is ignored.
// +optional
Digest string `json:"digest,omitempty" yaml:"digest,omitempty"`
}

// Selector specifies a set of resources.
// Any resource that matches intersection of all conditions is included in this set.
type Selector struct {
// Group is the API group to select.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
// +optional
Group string `json:"group,omitempty"`

// Version of the API Group to select.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
// +optional
Version string `json:"version,omitempty"`

// Kind of the API Group to select.
// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
// +optional
Kind string `json:"kind,omitempty"`

// +optional
Namespace string `json:"namespace,omitempty"`

// +optional
Name string `json:"name,omitempty"`

// AnnotationSelector is a string that follows the label selection expression
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
// It matches with the resource annotations.
// +optional
AnnotationSelector string `json:"annotationSelector,omitempty"`

// LabelSelector is a string that follows the label selection expression
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
// It matches with the resource labels.
// +optional
LabelSelector string `json:"labelSelector,omitempty"`
}

0 comments on commit 62a4aa3

Please sign in to comment.