Skip to content

Commit

Permalink
Configure extension DNS settings in the spec.extensions section (ga…
Browse files Browse the repository at this point in the history
…rdener#1888)

* Adapted to DNS Changes

* PR Feedback #1

* Removed getResourceRefName utils function

* PR Feedback gardener#2

* Made custom cluster domain required if checkbox is selected
Made "Recommended DNS Configuration" Button more prominent

* Removed dnsState
Operate directly on manifest

* Some minor code styling changes
Removed readonly checks -> Show secretname as disabled v-text-field in case secretbinding is missing

* Feedback to `enh/adapt_to_dns_changes` (gardener#1928)

* extract useShootDns composable

* move dns tests to own file

* Some UI Feedback

* Explicit DNS Configuration Migration
UI optimizations

* changed ddns vendor name to rfc2136 (as this is the correct value for this provider)

* Fixed dns provider combobox chips
Show dns domain settings if checkbox selected
Some naming updates (again)

* Reset domain input field
Apply alert optimizations

* PR Feedback

* PR Feedback

* PR Feedback

---------

Co-authored-by: Holger Koser <[email protected]>
  • Loading branch information
grolu and holgerkoser authored Jul 8, 2024
1 parent f433480 commit 4af534a
Show file tree
Hide file tree
Showing 30 changed files with 1,085 additions and 767 deletions.
14 changes: 0 additions & 14 deletions backend/lib/routes/shoots.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,6 @@ router.route('/:name/spec/controlPlane/highAvailability')
}
})

router.route('/:name/spec/dns')
.all(metricsMiddleware)
.put(async (req, res, next) => {
try {
const user = req.user
const namespace = req.params.namespace
const name = req.params.name
const body = req.body
res.send(await shoots.replaceDns({ user, namespace, name, body }))
} catch (err) {
next(err)
}
})

router.route('/:name/spec/provider')
.all(metricsMiddleware)
.patch(async (req, res, next) => {
Expand Down
12 changes: 0 additions & 12 deletions backend/lib/services/shoots.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,6 @@ exports.replaceControlPlaneHighAvailability = async function ({ user, namespace,
return client['core.gardener.cloud'].shoots.mergePatch(namespace, name, payload)
}

exports.replaceDns = async function ({ user, namespace, name, body }) {
const client = user.client
const dns = body
const payload = {
spec: {
dns
}
}

return client['core.gardener.cloud'].shoots.mergePatch(namespace, name, payload)
}

exports.patchProvider = async function ({ user, namespace, name, body }) {
const client = user.client
const payload = {
Expand Down
150 changes: 0 additions & 150 deletions backend/test/acceptance/__snapshots__/api.shoots.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -315,156 +315,6 @@ exports[`api shoots should replace addons 2`] = `
}
`;

exports[`api shoots should replace control plane high availablility 1`] = `
[
[
{
":authority": "kubernetes:6443",
":method": "patch",
":path": "/apis/core.gardener.cloud/v1beta1/namespaces/garden-foo/shoots/barShoot",
":scheme": "https",
"authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZvb0BleGFtcGxlLm9yZyIsImlhdCI6MTU3NzgzNjgwMCwiYXVkIjpbImdhcmRlbmVyIl0sImV4cCI6MzE1NTcxNjgwMCwianRpIjoianRpIn0.k3kGjF6AgugJLdwERXEWZPaibFAPFPOnmpT3YM9H0xU",
"content-type": "application/merge-patch+json",
},
{
"spec": {
"controlPlane": {
"highAvailability": {
"failureTolerance": {
"type": "node",
},
},
},
},
},
],
]
`;

exports[`api shoots should replace control plane high availablility 2`] = `
{
"metadata": {
"annotations": {
"gardener.cloud/created-by": "[email protected]",
},
"name": "barShoot",
"namespace": "garden-foo",
"resourceVersion": "43",
"uid": 2,
},
"spec": {
"cloudProfileName": "infra1-profileName",
"controlPlane": {
"highAvailability": {
"failureTolerance": {
"type": "node",
},
},
},
"hibernation": {
"enabled": false,
},
"kubernetes": {
"version": "1.16.0",
},
"provider": {
"type": "fooInfra",
},
"purpose": "barPurpose",
"region": "foo-west",
"secretBindingName": "foo-infra1",
"seedName": "infra1-seed",
},
"status": {
"advertisedAddresses": [
{
"name": "external",
"url": "https://api.barShoot.foo.shoot.test",
},
],
"technicalID": "shoot--foo--barShoot",
},
}
`;

exports[`api shoots should replace dns 1`] = `
[
[
{
":authority": "kubernetes:6443",
":method": "patch",
":path": "/apis/core.gardener.cloud/v1beta1/namespaces/garden-foo/shoots/barShoot",
":scheme": "https",
"authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZvb0BleGFtcGxlLm9yZyIsImlhdCI6MTU3NzgzNjgwMCwiYXVkIjpbImdhcmRlbmVyIl0sImV4cCI6MzE1NTcxNjgwMCwianRpIjoianRpIn0.k3kGjF6AgugJLdwERXEWZPaibFAPFPOnmpT3YM9H0xU",
"content-type": "application/merge-patch+json",
},
{
"spec": {
"dns": {
"domain": "foo.bar",
"providers": [
{
"primary": "true",
"secretName": "foo-secret",
"type": "foo-provider",
},
],
},
},
},
],
]
`;

exports[`api shoots should replace dns 2`] = `
{
"metadata": {
"annotations": {
"gardener.cloud/created-by": "[email protected]",
},
"name": "barShoot",
"namespace": "garden-foo",
"resourceVersion": "43",
"uid": 2,
},
"spec": {
"cloudProfileName": "infra1-profileName",
"dns": {
"domain": "foo.bar",
"providers": [
{
"primary": "true",
"secretName": "foo-secret",
"type": "foo-provider",
},
],
},
"hibernation": {
"enabled": false,
},
"kubernetes": {
"version": "1.16.0",
},
"provider": {
"type": "fooInfra",
},
"purpose": "barPurpose",
"region": "foo-west",
"secretBindingName": "foo-infra1",
"seedName": "infra1-seed",
},
"status": {
"advertisedAddresses": [
{
"name": "external",
"url": "https://api.barShoot.foo.shoot.test",
},
],
"technicalID": "shoot--foo--barShoot",
},
}
`;

exports[`api shoots should replace hibernation enabled 1`] = `
[
[
Expand Down
45 changes: 0 additions & 45 deletions backend/test/acceptance/api.shoots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,51 +484,6 @@ describe('api', function () {
expect(res.body).toMatchSnapshot()
})

it('should replace dns', async function () {
mockRequest.mockImplementationOnce(fixtures.shoots.mocks.patch())

const res = await agent
.put(`/api/namespaces/${namespace}/shoots/${name}/spec/dns`)
.set('cookie', await user.cookie)
.send({
domain: 'foo.bar',
providers: [
{
primary: 'true',
secretName: 'foo-secret',
type: 'foo-provider'
}
]
})
.expect('content-type', /json/)
.expect(200)

expect(mockRequest).toBeCalledTimes(1)
expect(mockRequest.mock.calls).toMatchSnapshot()

expect(res.body).toMatchSnapshot()
})

it('should replace control plane high availablility', async function () {
mockRequest.mockImplementationOnce(fixtures.shoots.mocks.patch())

const res = await agent
.put(`/api/namespaces/${namespace}/shoots/${name}/spec/controlPlane/highAvailability`)
.set('cookie', await user.cookie)
.send({
failureTolerance: {
type: 'node'
}
})
.expect('content-type', /json/)
.expect(200)

expect(mockRequest).toBeCalledTimes(1)
expect(mockRequest.mock.calls).toMatchSnapshot()

expect(res.body).toMatchSnapshot()
})

it('should return a shoot admin kubeconfig', async function () {
mockRequest.mockImplementationOnce(fixtures.shoots.mocks.createAdminKubeconfigRequest())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`composables > useShootContext > should add dns providers 1`] = `
{
"domain": "example.org",
"providers": [
{
"primary": true,
"secretName": "aws-route53-secret",
"type": "aws-route53",
},
],
}
`;

exports[`composables > useShootContext > should add workers and update zones network config 1`] = `
[
{
Expand Down
Loading

0 comments on commit 4af534a

Please sign in to comment.