Skip to content

Commit

Permalink
Add Agones custom kinds to the Allow-List (#4488)
Browse files Browse the repository at this point in the history
* Support `agones.dev/Fleet` kind

Signed-off-by: David Gageot <[email protected]>

* Support `agones.dev/GameServer` kind

Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot authored Jul 17, 2020
1 parent 1600809 commit 867e1df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/skaffold/deploy/kubectl/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/yaml"
)

// transformableWhitelist is the set of kinds that can be transformed by Skaffold.
var transformableWhitelist = map[apimachinery.GroupKind]bool{
// transformableAllowlist is the set of kinds that can be transformed by Skaffold.
var transformableAllowlist = map[apimachinery.GroupKind]bool{
{Group: "", Kind: "Pod"}: true,
{Group: "apps", Kind: "DaemonSet"}: true,
{Group: "apps", Kind: "Deployment"}: true, // v1beta1, v1beta2: deprecated in K8s 1.9, removed in 1.16
Expand All @@ -37,6 +37,8 @@ var transformableWhitelist = map[apimachinery.GroupKind]bool{
{Group: "extensions", Kind: "Deployment"}: true, // v1beta1: deprecated in K8s 1.9, removed in 1.16
{Group: "extensions", Kind: "ReplicaSet"}: true, // v1beta1: deprecated in K8s 1.9, removed in 1.16
{Group: "serving.knative.dev", Kind: "Service"}: true,
{Group: "agones.dev", Kind: "Fleet"}: true,
{Group: "agones.dev", Kind: "GameServer"}: true,
}

// FieldVisitor represents the aggregation/transformation that should be performed on each traversed field.
Expand Down Expand Up @@ -104,7 +106,7 @@ func shouldTransformManifest(manifest map[string]interface{}) bool {
Kind: gvk.Kind,
}

return transformableWhitelist[groupKind]
return transformableAllowlist[groupKind]
}

// recursiveVisitorDecorator adds recursion to a FieldVisitor.
Expand Down

0 comments on commit 867e1df

Please sign in to comment.