generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from tenzen-y/add-cert-options-to-component-c…
…onfig Add options for internal cert management to component config
- Loading branch information
Showing
15 changed files
with
409 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## v0.3.0 | ||
|
||
Changes since `v0.2.1`: | ||
|
||
### Features | ||
|
||
- Upgrade the `config.kueue.x-k8s.io` API version from `v1alpha1` to `v1alpha2`. `v1alpha1` is no longer supported. | ||
`v1alpha2` includes the following changes: | ||
- Add Namespace to propagate the namespace where kueue is deployed to the webhook certificate. | ||
- Add InternalCertManagement with fields Enable, WebhookServiceName and WebhookSecretName. | ||
- Remove EnableInternalCertManagement. Use InternalCertManagement.Enable instead. | ||
|
||
### Bug fixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
Copyright 2022 The Kubernetes 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 v1alpha2 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/google/go-cmp/cmp" | ||
"k8s.io/utils/pointer" | ||
) | ||
|
||
const overwriteNamespace = "kueue-tenant-a" | ||
|
||
func TestSetDefaults_Configuration(t *testing.T) { | ||
testCases := map[string]struct { | ||
original *Configuration | ||
want *Configuration | ||
}{ | ||
"defaulting namespace": { | ||
original: &Configuration{ | ||
InternalCertManagement: &InternalCertManagement{ | ||
Enable: pointer.Bool(false), | ||
}, | ||
}, | ||
want: &Configuration{ | ||
Namespace: pointer.String(DefaultNamespace), | ||
InternalCertManagement: &InternalCertManagement{ | ||
Enable: pointer.Bool(false), | ||
}, | ||
}, | ||
}, | ||
"defaulting InternalCertManagement": { | ||
original: &Configuration{ | ||
Namespace: pointer.String(overwriteNamespace), | ||
}, | ||
want: &Configuration{ | ||
Namespace: pointer.String(overwriteNamespace), | ||
InternalCertManagement: &InternalCertManagement{ | ||
Enable: pointer.Bool(true), | ||
WebhookServiceName: pointer.String(DefaultWebhookServiceName), | ||
WebhookSecretName: pointer.String(DefaultWebhookSecretName), | ||
}, | ||
}, | ||
}, | ||
"should not defaulting InternalCertManagement": { | ||
original: &Configuration{ | ||
Namespace: pointer.String(overwriteNamespace), | ||
InternalCertManagement: &InternalCertManagement{ | ||
Enable: pointer.Bool(false), | ||
}, | ||
}, | ||
want: &Configuration{ | ||
Namespace: pointer.String(overwriteNamespace), | ||
InternalCertManagement: &InternalCertManagement{ | ||
Enable: pointer.Bool(false), | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for name, tc := range testCases { | ||
t.Run(name, func(t *testing.T) { | ||
SetDefaults_Configuration(tc.original) | ||
if diff := cmp.Diff(tc.want, tc.original); diff != "" { | ||
t.Errorf("unexpected error (-want,+got):\n%s", diff) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 40 additions & 5 deletions
45
.../config/v1alpha1/zz_generated.deepcopy.go → .../config/v1alpha2/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.