Skip to content

Commit

Permalink
Makes ACME EAB key algo warning value unexported
Browse files Browse the repository at this point in the history
Signed-off-by: irbekrm <irbekrm@gmail.com>
  • Loading branch information
irbekrm committed May 11, 2021
1 parent f46aad2 commit 6cb57c4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/api/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ go_library(
"issuers.go",
"names.go",
"usages.go",
"warnings.go",
],
importpath = "github.com/jetstack/cert-manager/pkg/api/util",
visibility = ["//visibility:public"],
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/apis/certmanager/validation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ go_library(
"clusterissuer.go",
"issuer.go",
"register.go",
"warnings.go",
],
importpath = "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/validation",
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -42,7 +43,6 @@ go_test(
],
embed = [":go_default_library"],
deps = [
"//pkg/api/util:go_default_library",
"//pkg/apis/certmanager/v1:go_default_library",
"//pkg/internal/api/validation:go_default_library",
"//pkg/internal/apis/acme:go_default_library",
Expand Down
3 changes: 1 addition & 2 deletions pkg/internal/apis/certmanager/validation/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"

apiutil "github.com/jetstack/cert-manager/pkg/api/util"
"github.com/jetstack/cert-manager/pkg/internal/api/validation"
cmacme "github.com/jetstack/cert-manager/pkg/internal/apis/acme"
"github.com/jetstack/cert-manager/pkg/internal/apis/certmanager"
Expand Down Expand Up @@ -123,7 +122,7 @@ func ValidateACMEIssuerConfig(iss *cmacme.ACMEIssuer, fldPath *field.Path) (fiel
el = append(el, ValidateSecretKeySelector(&eab.Key, eabFldPath.Child("keySecretRef"))...)

if len(eab.KeyAlgorithm) != 0 {
warnings = append(warnings, apiutil.DeprecatedACMEEABKeyAlgorithmField)
warnings = append(warnings, deprecatedACMEEABKeyAlgorithmField)
}
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/internal/apis/certmanager/validation/issuer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/validation/field"

apiutil "github.com/jetstack/cert-manager/pkg/api/util"
"github.com/jetstack/cert-manager/pkg/internal/api/validation"
cmacme "github.com/jetstack/cert-manager/pkg/internal/apis/acme"
cmapi "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager"
Expand Down Expand Up @@ -205,7 +204,7 @@ func TestValidateACMEIssuerConfig(t *testing.T) {
},
},
},
warnings: validation.WarningList{apiutil.DeprecatedACMEEABKeyAlgorithmField},
warnings: validation.WarningList{deprecatedACMEEABKeyAlgorithmField},
},
"acme solver with missing http01 config type": {
spec: &cmacme.ACMEIssuer{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package util
package validation

// Warning values thrown by validating webhook
// https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/
const (
// DeprecatedACMEEABKeyAlgorithmField is raised when the deprecated keyAlgorithm field for an ACME issuer's external account binding (EAB) is set.
DeprecatedACMEEABKeyAlgorithmField = "ACME issuer spec field 'externalAccount.keyAlgorithm' is deprecated. The value of this field will be ignored."
// deprecatedACMEEABKeyAlgorithmField is raised when the deprecated keyAlgorithm field for an ACME issuer's external account binding (EAB) is set.
deprecatedACMEEABKeyAlgorithmField = "ACME issuer spec field 'externalAccount.keyAlgorithm' is deprecated. The value of this field will be ignored."
)

0 comments on commit 6cb57c4

Please sign in to comment.