Merge branch 'master' into namespaces

This commit is contained in:
Vincent Fiduccia 2020-03-26 16:31:01 -07:00 committed by GitHub
commit 780647a15d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 2 deletions

View File

@ -30,6 +30,7 @@ trigger:
ref:
- "refs/heads/master"
- "refs/heads/*-dev"
- "refs/heads/release-*"
event:
- push
@ -122,6 +123,7 @@ depends_on:
trigger:
ref:
- "refs/heads/*-dev"
- "refs/heads/release-*"
event:
- push

View File

@ -29,7 +29,9 @@ export default {
methods: {
clicked() {
this.$emit('input', this.value);
if (!this.disabled) {
this.$emit('input', this.value);
}
},
}
};
@ -43,6 +45,7 @@ export default {
:tabindex="grouped ? -1 : 0"
>
<input
:disabled="disabled"
:checked="value"
type="radio"
:name="name"

View File

@ -7,7 +7,7 @@ fi
COMMIT=$(git rev-parse --short HEAD)
COMMIT_DATE=$(git --no-pager log -1 --format='%ct')
COMMIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed -E 's/[^a-zA-Z0-9]+/-/g')
COMMIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed -E 's/[^a-zA-Z0-9.-]+/-/g')
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}
LAST_TAG=${GIT_TAG:-'v0.0.0'}

View File

@ -13,6 +13,8 @@ import Tabbed from '@/components/Tabbed';
import Footer from '@/components/form/Footer';
import GatekeeperViolationsTable from '@/components/GatekeeperViolationsTable';
import RuleSelector from '@/components/form/RuleSelector';
import RadioGroup from '@/components/form/RadioGroup';
import { ucFirst } from '@/utils/string';
function findConstraintTypes(schemas) {
return schemas
@ -21,6 +23,10 @@ function findConstraintTypes(schemas) {
}
const CONSTRAINT_PREFIX = 'constraints.gatekeeper.sh.';
const ENFORCEMENT_ACTION_VALUES = {
DENY: 'deny',
DRYRUN: 'dryrun'
};
export default {
components: {
@ -32,6 +38,7 @@ export default {
NameNsDescription,
NamespaceList,
RuleSelector,
RadioGroup,
Tab,
Tabbed
},
@ -88,6 +95,8 @@ export default {
localValue,
templateOptions,
extraDetailColumns,
enforcementActionOptions: Object.values(ENFORCEMENT_ACTION_VALUES),
enforcementActionLabels: Object.values(ENFORCEMENT_ACTION_VALUES).map(ucFirst)
};
},
@ -116,6 +125,7 @@ export default {
value.type = value.type || this.templateOptions[0].value;
value.spec = value.spec || {};
value.spec.enforcementAction = value.spec.enforcementAction || ENFORCEMENT_ACTION_VALUES.DENY;
value.spec.parameters = value.spec.parameters || {};
value.spec.match = value.spec.match || {};
value.spec.match.kinds = value.spec.match.kinds || [];
@ -184,6 +194,18 @@ export default {
/>
</div>
<br />
<div>
<h2>Enforcement Action</h2>
<RadioGroup
v-model="localValue.spec.enforcementAction"
class="enforcement-action"
:options="enforcementActionOptions"
:labels="enforcementActionLabels"
:mode="mode"
@input="e=>localValue.spec.enforcementAction = e"
/>
</div>
<br />
<br />
<div class="match">
<h2>Match</h2>
@ -228,3 +250,9 @@ export default {
<Footer :mode="mode" :errors="errors" @save="save" @done="done" />
</div>
</template>
<style lang="scss" scoped>
.enforcement-action {
max-width: 200px;
}
</style>