Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Aug 7, 2023
1 parent 5744687 commit 4722f9a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions charts/consul/templates/crd-gatewayclassconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ spec:
type: string
type: object
type: array
openshiftSCCName:
description: The name of an existing Openshift SCC
to bind to the managed role.
type: string
type: object
type: object
served: true
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/templates/gateway-resources-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
- {{- toYaml .Values.connectInject.apiGateway.managedGatewayClass.copyAnnotations.service.annotations | nindent 14 -}}
{{- end }}
- -service-type={{ .Values.connectInject.apiGateway.managedGatewayClass.serviceType }}
- -openshift-scc-name={{ .Values.connectInject.apiGateway.openshiftSccName }}
- -openshift-scc-name={{ .Values.connectInject.apiGateway.managedGatewayClass.openshiftSccName }}
{{- end}}
resources:
requests:
Expand Down
4 changes: 0 additions & 4 deletions control-plane/api-gateway/common/helm_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ type HelmConfig struct {
// and should create SecurityContextConstraints.
EnableOpenShift bool

// OpenshiftSCCName allows the user to specify which security context they
// would like to run their gateways with.
OpenshiftSCCName string

// ReleaseName indicates the name of the release for the Helm installation. This value is used
// as a prefix for some resources - SecurityContextConstraints, for example - so it must be known.
ReleaseName string
Expand Down
1 change: 1 addition & 0 deletions control-plane/api/v1alpha1/api_gateway_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestGatewayClassConfigDeepCopy(t *testing.T) {
NodeSelector: map[string]string{
"test": "test",
},
OpenshiftSCCName: "restricted-v2",
}
config := &GatewayClassConfig{
ObjectMeta: metav1.ObjectMeta{
Expand Down
3 changes: 2 additions & 1 deletion control-plane/subcommand/gateway-resources/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ func (c *Command) init() {
"The annotations to copy over from a gateway to its service.",
)
c.flags.StringVar(&c.flagOpenshiftSCCName, "openshift-scc-name", "",
"Name of security context constraint to use for gateways on Openshift")
"Name of security context constraint to use for gateways on Openshift.",
)

c.k8s = &flags.K8SFlags{}
flags.Merge(c.flags, c.k8s.Flags())
Expand Down
2 changes: 2 additions & 0 deletions control-plane/subcommand/gateway-resources/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ bar: 2`,
flagServiceAnnotations: `
- foo
- bar`,
flagOpenshiftSCCName: "restricted-v2",
},
},
} {
Expand Down Expand Up @@ -245,6 +246,7 @@ func TestRun(t *testing.T) {
"-release-name", "test",
"-component", "test",
"-controller-name", "test",
"-openshift-scc-name", "restricted-v2",
})

require.Equal(t, 0, code)
Expand Down

0 comments on commit 4722f9a

Please sign in to comment.